cancel
Showing results for 
Search instead for 
Did you mean: 

Zip module in mail adapter

Former Member
0 Kudos

Hi,

I have proxy -> mail scenario and I have to use PayloadZipBean to zip mail attachment.

I dynamically set from, to, subject, etc fields so I have "Use Mail Package" and "Keep Attachments" checked.

When I unchecked "Use Mail Package" option I receive mail with zip file.

Is it possible to use zip module and mail package together?

How can I do it?

I tried many options but without success.

In configuration in Module tab I have PayloadZipBean and XIMailAdapterBean

and zip.filenameKey -> contentType and zip.mode -> zipOne

but channel is returning error:

Mail: error occured: com.sap.aii.af.ra.ms.api.RecoverableException:
com.sap.aii.messaging.util.XMLScanException: java.lang.NullPointerException; nested exception caused by: 
com.sap.engine.lib.xml.parser.NestedSAXParserException: Fatal Error: 
com.sap.engine.lib.xml.parser.ParserException: XMLParser: 
No data allowed here: (hex) 50, 4b, 3(:main:, row:1, col:3)(:main:, row=1, col=3) -> 
com.sap.engine.lib.xml.parser.ParserException: XMLParser
: No data allowed here: (hex) 50, 4b, 3(:main:, row:1, col:3)

What I am doing wrong?

Best Regards,

Przemek

Accepted Solutions (1)

Accepted Solutions (1)

stefan_grube
Active Contributor
0 Kudos

> Is it possible to use zip module and mail package together?

No, this is not possible.

Use adapter specific message attributes instead of the Mailpackage.

Former Member
0 Kudos

Hi Stefan,

Thanks for response.

> > Is it possible to use zip module and mail package together?

> No, this is not possible.

> Use adapter specific message attributes instead of the Mailpackage.

I set THeaderTO and THeaderSUBJECT in UDF in mapping, and I see them in SOAP envelope. But they are not used by channel (subject is still empty).

I unchecked "use mail package" and checked "Use Adapter specific message attributes" on advanced tab.

What else should I do?

Best Regards,

Przemek

stefan_grube
Active Contributor
0 Kudos

> I unchecked "use mail package" and checked "Use Adapter specific message attributes" on advanced tab.

> What else should I do?

You have to check also "Variable Transport Binding", don't know why

Former Member
0 Kudos

Hi,

> You have to check also "Variable Transport Binding", don't know why

It works I thought that I was trying all combination...

Thank you.

Best Regards,

Przemek

Former Member
0 Kudos

Hi again,

I used zip module successfully (no errors on rwb, received mail with zip attachment)

but when I am trying to unzip it I receive message:

Error: structure error in zip file.

Do you have any suggestion?

And the last question (I hope), is it possible to zip text file (without xml tags)?

After mapping (with asma and without zipping and mail package) I received xml file.

In my previous version (with mail package) in attachment I had text file.

Best Regards,

Przemek

Answers (2)

Answers (2)

Former Member
0 Kudos

Error in created zip file, issue not solved

stefan_grube
Active Contributor
0 Kudos

Maybe you look into my blog:

/people/stefan.grube/blog/2007/02/20/working-with-the-payloadzipbean-module-of-the-xi-adapter-framework

You have to set a name for the files in the zip file also.

former_member187339
Active Contributor
0 Kudos

Hi Przemek,

>>Is it possible to use zip module and mail package together?How can I do it?

I guess not, but if you write a custom module (or through XSLT) and take the actual payload details from the Content field of the XML (generated from Mail package XSD) then there can be a change.

But this is going to be a real challenge

Regards

Suraj

Former Member
0 Kudos

Hi Suraj,

Thanks for your answer.

> >Is it possible to use zip module and mail package together?How can I do it?

> I guess not, but if you write a custom module (or through XSLT) and take the actual payload details from the Content field of the XML (generated from Mail package XSD) then there can be a change.

Do you suggest to create zip file from content field in XSLT mapping?

Could you write something more about this option or provide example?

Best Regards,

Przemek

former_member187339
Active Contributor
0 Kudos

Hi Przemek,

>>Do you suggest to create zip file from content field in XSLT mapping. Could you write something more about this option or provide example?

What I meant was the XML generated fromt he MailPackage will have the content in the COntent field. Now when you say about zipping the payload, it should be this content. Right?

Though I have never tried but would have used the following test

1. I would try to take the value in the Content field of the ouput XML. For this either java module of XSLT code will be used.

2. Once I get the content I would have used SoapPayload and PayloadZipBean and try to zip the [ayload

But again this is just an idea from my end, since I have not tried I am not sure about the feasibility

Regards

Suraj

stefan_grube
Active Contributor
0 Kudos

> What I meant was the XML generated fromt he MailPackage will have the content in the COntent field. Now when you say about zipping the payload, it should be this content. Right?

A zip is a binary which you cannot use as content for the Mailpackage.