cancel
Showing results for 
Search instead for 
Did you mean: 

Zip and Encode File

Former Member
0 Kudos

I have a FILE-XI-SOAP scenario.

My requirement is to FTP a txt file and then zip it and encode it in base64 format and send it to SOAP receiver.

please suggest different possible ways to achieve this.

Accepted Solutions (0)

Answers (2)

Answers (2)

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

>>>My requirement is to FTP a txt file and then zip it and encode it in base64 format and send it to SOAP receiver

a) as the last mapping create a java mapping class which will encode in base64 and zip the content

b) send it to the SOAP receiver

Regards,

Michal Krawczyk


Former Member
0 Kudos

While creating Java class for mapping in eclipse I got following errors

The type StreamTransformation is deprecated

- Access restriction: The type StreamTransformation is not accessible due to restriction on required library C:\Program Files\Java\jre1.5.0_11\lib\ext

\com.sap.xpi.ib.mapping.lib.jar

Access restriction: The type DynamicConfiguration is not accessible due to restriction on required library C:\Program Files\Java\jre1.5.0_11\lib\ext

\com.sap.xpi.ib.mapping.lib.jar

I have imported following jar files on my local machine from XI server

com.sap.xpi.ib.mapping.lib.jar

com.sap.aii.utilxi.core.jar


Note: I am on PI 7.1

baskar_gopalakrishnan2
Active Contributor
Former Member
0 Kudos

Check this blog for File Zipping:

http://www.saptechnical.com/Tutorials/XI/ZippingFiles/demo2.htm

And then, you can use Encoding in Soap Adapter. Take a look to this document (page 17):

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d23cbe11-0d01-0010-5287-873a22024...

ModuleName: localejbs/sap.com/com.sap.aii.af.soapadapter/XISOAPAdapterBean

Parameter: XMBWS.TransferEncoding

Value: base64

Former Member
0 Kudos

Referring to above solution i have one query

a) is it possible to use loacalejbs/AF_Modules/PayloadZipbean in SOAP receiver channel.

I tried with below configuration

File Sender Channel-to pick the file

SOAP receiver Channel – PayloadZipbean – zip file

                                    localejbs/sap.com/com.sap.aii.af.soapadapter/XISOAPAdapterBean-encode

But I am getting below mentioned error in communication channels

File Sender

Error: com.sap.engine.interfaces.messaging.api.exception.MessagingException: XIAdapterFramework:GENERAL:com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Object not found in lookup of PayloadZipbean.

SOAP Receiver

Message processing failed. Cause: com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Object not found in lookup of PayloadZipbean.

Former Member
0 Kudos

Error  "Object not found in lookup of PayloadZipbean" is resolved by changing the order of modules in Channel and correcting the names of modules. Module Name is case sensitive hence there was no lookup found for  PayloadZipbean, replace this with  PayloadZipBean and it working fine now.

I am using PayloadZipBean and XISOAPAdapterBean in SOAP receiver channel with details as

Module Name AF_Modules/PayloadZipBean

Type Local Enterprise Bean

Module Key          Zip

Parameter Name          zip.mode

Parameter Value          zipAll

Module Name          sap.com/com.sap.aii.af.soapadapter/XISOAPAdapterBean

Type          Local Enterprise Bean

Module Key          SOAP

Parameter Name   XMBWS.TransferEncoding

Paramter Value          base64

Although output i am getting is a xml with UTF-8 encoding (default) and not the zipped one with encoding base64.