cancel
Showing results for 
Search instead for 
Did you mean: 

Reading attachment in SOAP message with ABAP mapping

Former Member
0 Kudos

I am searching an ABAP code to read attachment in sender SOAP message..

I am using PI 7.3, I can read by java mapping but I get another error after reading the attachment.. So I try to abap mapping..

That's it..

Thanx ..

Accepted Solutions (1)

Accepted Solutions (1)

former_member184681
Active Contributor
0 Kudos

Hi,

See the comment by Krishna M for this weblog below:

http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/3509

It describes the IF_WSPROTOCOL_ATTACHMENTS ABAP object that you should find useful for your scenario.

Hope this helps,

Greg

Former Member
0 Kudos

Thanx for your reply,

I am not using Proxy, I have SOAP 2 RFC scenarios. In above example.. It uses proxy..

I am receiving xop:Include attachment, the structure is following

<urn1:attachment>

<urn1:binary>

<inc:Include href="cid:test.jpg" xmlns:inc="http://www.w3.org/2004/08/xop/include" />

</urn1:binary>

</urn1:attachment>

and the error is

EXCEPTION_DURING_EXECUTE

Runtime exception occured during application mapping ...api.BaseRuntimeException: Unexpected value <null> for node ns1:atatchment/ns1:binary

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

Runtime exception occured during application mapping ...api.BaseRuntimeException: Unexpected value <null> for node ns1:atatchment/ns1:binary

Is the Read Attachments option checked in your operation mapping? Did you also check the Do Not Resolve XOP option?

Hope this helps,

Mark

Former Member
0 Kudos

Yes, I check these options, I try the combination of these checks, but nothing changed.

I think PI does not understand the content of the <binary> part which begins with <inc:Include>

But what is the solution..

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

A couple more questions:

1. Is the Keep Attachments Option checked in your SOAP Sender?

2. Are you sending the SOAP message in the Adapter Engine e.g http(s)://host:port/XISOAPAdapter/MessageServlet?channel=p:s:c? Because if you are sending to the Integration Engine, it is not supported

http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/4502

If you are using PI 7.1, you can directly read attachments using UDF

http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/15517

Hope this helps,

Mark

Former Member
0 Kudos

Hello Mark,

1. My Soap Sender Adapter, I checked the Keep Attachment option

2. I am getting the WSDL file from the SOAP Sender Agreement.. it is like http(s)://host:port/XISOAPAdapter/MessageServlet?channel=p:s:c? as you said.

I used the user-defined function, it works when <inc:Include href="cid:test.jpg" xmlns:inc="http://www.w3.org/2004/08/xop/include" /> is deleted in the message.

If the coming message includes <inc:Include href="cid:test.jpg" xmlns:inc="http://www.w3.org/2004/08/xop/include" />,

the <null> error occurs.

Thanx for your reply..

Former Member
0 Kudos

I am sending the test message from SOAPUI, and it sends the message as <inc:Include

but the original coming message starts with <xop:Include

does this error occur because of this difference.

Hasan.

Edited by: ordu_hasan on Feb 27, 2012 12:42 PM

Former Member
0 Kudos

I solved the problem. IF_MAPPING~EXECUTE method has Attachments parameter and I can get attachments from there.

Thanx for your answers.

Answers (1)

Answers (1)

former_member181985
Active Contributor
0 Kudos

>>I am using PI 7.3, I can read by java mapping but I get another error after reading the attachment..

what is the error?