cancel
Showing results for 
Search instead for 
Did you mean: 

File upload with the SOAP Axis Framework

Former Member
0 Kudos

Hi,

my scenario is as follows:

ERP --> PI --> System A (3rd party application)

ERP sends data (IDoc) to the PI and is mapped there to a xml structure expected by A.

IDoc --> PI --> target xml structure

On A runs a Web service (Axis Framework) with a method uploadFile that expects one parameter (client of A) and the file for the upload has to come as attachment (call.addAttachment).

I imported already the wsdl and can see the message uploadFile in the IR. The Axis Framework is also available already in the SOAP adapter.

So I have

IDoc --> PI --> target xml structure

but want to call

PI --> uploadFile(client) \[with the target xml structure as attachment\]

How can I map the parameter to uploadFile and get the mapped xml structure as attachment?

Thanks and regards

Patrick

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Patrick,

Did you try the PayloadSwapBean? I have practically never worked with handling attachments in a WS scenario. When you use this bean, the payload is converted to attachment and sent. But I am not sure if this will be mapped to your uploadFile parameter.

Give it a try and let me know.

Regards,

Jaishankar

Former Member
0 Kudos

Hi,

thanks for your answer. The PayloadSwapBean could be a solution for the problem and I will try to use it.

Here is another (simplified) version of my scenario:

I have one source interface with three data fields

SD1

SD2

SD3

This should get mapped to a target interface with two data fields

TD1

TD2

So if a source message arrives at PI a Message Mapping is called and the message gets mapped to the target structure.

The result of this mapping should get the attachment of a Web service call.

In a sample client for this Web service it looks like:

Service service = new Service();

Call call = (Call) service.createCall();

...

call.setOperationName(new QName(... "uploadFile"));

...

call.addAttachmentPart(...);

The target interface of the Web service is the message uploadFile in an imported wsdl file. This interface has one data field

WSD1

and is independent of the other data fields.

For filling WSD1 another mapping is necessary (or maybe not?).

Regards

Patrick

Former Member
0 Kudos

Hi,

the PayloadSwapBean seems to take an attachment and use it as a new payload.

I need the opposite of it -> taking the payload and use it as attachment.

Regards

Patrick

Answers (0)