cancel
Showing results for 
Search instead for 
Did you mean: 

Proxy to SOAP scenario-With Attachment and Mapping

Former Member
0 Kudos

I have a scenario to be developed, it is a Proxy to SOAP sceanrio.

There are about 8 fields coming from Proxy.

Can we create an attachment from these fields.

Also we have to do a mapping of this attachment to a field in the target External Defination and also 2 fields of the 8 have to mapped to the other respective fields of the external defination.

All this has to be posted on a webservice through SOAP with

the 2 fields in payload and

the attachment in the attachemnt section of the message

Could this be achieved?

Accepted Solutions (1)

Accepted Solutions (1)

stefan_grube
Active Contributor
0 Kudos

I don't understand who designs a scenario where you have two fields in main message and 6 fields in attachment.

This sounds strange.

You should create the attachment in the ABAP proxy ans create the whole message as the receiver requests it.

Former Member
0 Kudos

Thanks for your response. So what you are basically suggesting is that the attachment should come from the proxy and PI without processing it should pass it on to the webservice.

Actually it is a business requirement and have to chekc its feasibility.

Also all 8 fields are part of the attachment and among those 8 2 have to be mapped with the 2 fields of the External definition and 1 field of the External Defintion is there for mapping with the attachment,

Hope you can suggest more to this.

stefan_grube
Active Contributor
0 Kudos

In ABAP proxy you create a message with the two fields which you need for main SOAP message.

The attachment is created exactly how it is requested from web service.

You create a String with the XML (including tags) and do a codepage conversion to UTF-8 (or whatever is requested)

Note: The payload is created in UTF-8 automatically, the attachment is treated as binary.

You can also use a Java mapping for creating the attachment, if you have good Java skills, but I recommend to use program code for one purpose only on one place.

Former Member
0 Kudos

Thanks for your response, I tried with a udf and I guess it is almost sorted.

There is another query which I have. The 8 fields which I was discussing about, out of them 1 has to be stored and provided to the SAP system in addition to the response from the webservice. Can you suggest any way of doing the same? Is global varivale an option, if yes can you provide any link of how to use it.

stefan_grube
Active Contributor
0 Kudos

You cannot use values of t+request message in response.

Is this a sync message? Why do you want the value in response message as the value is available in your ABAP proxy anyway?

Former Member
0 Kudos

Yes it is a sync message.

And the response coming from the webservice is to be sent to SAP system and this field is also required by the SAP system.

stefan_grube
Active Contributor
0 Kudos

When the field is part of the request message, it is already known by the SAP system.

No need to add it to response message. Handle this in ABAP proxy.

Former Member
0 Kudos

Thanks for the response. But if the SAP system wants to just retain that particular field of the 8 fields as a refernce for the response, then this need could rise. As in suppose 1 of the 8 fields is doucment id and the response which is a transfer id is to be stored alongwith that document id for which it is generated, then?

Also when and are global varibales used?

stefan_grube
Active Contributor
0 Kudos

> But if the SAP system wants to just retain that particular field of the 8 fields as a reference for the response, then this need could rise.

The SAP system retains all values of the request message. No need to retrieve them from response.

Former Member
0 Kudos

Yes they reatin all values but when they want to store the response corresponding to this particular input field ---this is basically the requirement. Hope I am able to explain properly.

stefan_grube
Active Contributor
0 Kudos

I give up.

Answers (2)

Answers (2)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Since Proxy uses SOAP message for the communication, you can have both payload and attachment. The previous michal link can help you to write abap program to achieve this. Since you have some fields attachments and some as payload, I would atleast recommend keep mapping required fields in the payload section and rest fields in the attachment. So that you can avoid mapping attachment fields and keep the design simple.

IMO, business requirement fields should appear only in the payload for the mapping. Hope that helps.

Former Member
0 Kudos

Please check the below link

/people/michal.krawczyk2/blog/2006/04/19/xi-rfc-or-abap-proxy-abap-proxies-with-attachments

Thanks

Suma