cancel
Showing results for 
Search instead for 
Did you mean: 

SOAP to Idoc Scenario help

Former Member
0 Kudos

Dear All,<br />

I need help in implementing the following scenario:<br />

<br />

Scenario description:<br />

<br />

Basic aim of the interface is to receive supplieru2019s Invoice document in UBL2.0 format to SAP PI 7.1 and generate INVOIC02 IDOC to be received by our ECC. Supplier will be using SOAP to communicate with SAP PI. Hence the scenario is <br />

<br />

SOAP -&gt; SAP PI -&gt; IDOC<br />

<br />

As you may know, UBL2.0 is a kind of XML file that contains all information about the invoice details.<br />

<br />

If supplier sends the SOAP message containing only UBL data in SOAP BODY, there is no problem and SAP PI can handle this pretty easily. Because, the entire UBL message becomes payload and I could easily map the UBL format (using graphical mapping editor) to INOVIC02 IDOC. I already implemented this and its working fine. <br />

<br />

<br />

However because of their (Supplier) interface, following format of SOAP message will be sent to SAP PI:<br />

&lt;soapenv:Envelope u2026u2026u2026u2026 &gt;<br />

&lt;soapenv:Header&gt;<br />

u2026u2026u2026u2026u2026<br />

u2026u2026u2026u2026u2026<br />

&lt;/soapenv:Header&gt;<br />

&lt;soapenv:Body&gt;<br />

&lt;ns:Request&gt; <br />

&lt;ns:attribute1&gt; attribute1 value &lt;/ns:attribute1&gt;<br />

&lt;ns:attribute2&gt; attribute2 value &lt;/ns:attribute2&gt;<br />

&lt;ns:attribute3&gt; attribute3 value &lt;/ns:attribute3&gt;<br />

&lt;ns:attribute4&gt; attribute4 value &lt;/ns:attribute3&gt;<br />

&lt;ns:attribute4&gt; <br />

&lt;ns:attribute4.att1&gt; attribute4.attr1 value &lt;/ ns:attribute4.att1&gt; <br />

&lt;ns:attribute4.att2&gt; attribute4.attr1 value &lt;/ns:attribute4.att2&gt;<br />

&lt;/ns:attribute4&gt;<br />

&lt;ns:attribute5&gt;<br />

&lt;ns:mimeType&gt;text/xml&lt;/ns:mimeType&gt;<br />

&lt;ns:filename&gt;invoice.xml&lt;/ns:filename&gt;<br />

&lt;ns:content&gt; base64 encoded UBL2.0 message here &lt;/ns:content&gt;<br />

&lt;/soapenv:Body&gt;<br />

&lt;/soapenv:Envelope&gt;<br />

<br />

Please note that, the actual UBL XML data is encoded using BASE64 and added in the one of the attribute of SOAP BODY. <br />

<br />

With the above format of SOAP, I have following challenges. <br />

1. What should be my Source message type. Please note that, I received the WSDL file from supplier, and when I used this WSDL file to create external definitions, it created message type &lt;Request&gt;. And this message type contains the format that I described above. The content has data type base64Binary.<br />

<br />

2. What should be my target message type. When I imported the IDOC message type INVOIC02, SAP PI has the message type and data type information. Should I use any intermediate message types to extract UBL message?.<br />

<br />

3. How to decode the UBL XML message that is contained in one of attribute (ns.content) of SOAP BODY. <br />

<br />

Once I get the decoded UBL XML message, I can map this to IDOC using SAP PI graphical mapping editor.

<br />

<br />

Thanks in advance.

<br/>

<br />

Kind Regards,<br />

Prasad.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Prasad

I searched after seeing your post , request you to please see this discussion about the problems in loading of UML in message mapping

If its not an issue in your case then can you please have a look at the below approach,

You can use the source structure as you mentioned and the content of <ns:content> base64 encoded UBL2.0 message here </ns:content> can be taken as a input to a java mapping to do the decoding ,after decoding you can for a temporary structure which will have the required fields which are needed to be mapped to IDOC. You can use a second mapping between temp and IDOC structure already imported .

Regards,

Srinivas

Former Member
0 Kudos

Hello Srinivas,

Thanks for your reply.

Fortunatly, we dont have issue with memory when loading UBL.

Could you provide any code to do the decoding of base64 in java. In ABAP we find a function module to do that, however this goes wrong with special characters( such as german alphabets ).

Thanks once again,

Kind Regards,

Prasad.

Former Member
0 Kudos

Dear All,

In my above Scenario( SOAP - PI - IDOC ), I would like to send the SOAP Response back to the SOAP Client. The SOAP response envolope should contain following format:

<soapenv:Envelope u2026u2026u2026u2026 >

<soapenv:Header>

u2026u2026u2026u2026u2026

u2026u2026u2026u2026u2026

</soapenv:Header>

<soapenv:Body>

<ns:Response>

<ns:attribute1> attribute1 value </ns:attribute1>

<ns:attribute2> attribute2 value </ns:attribute2>

<ns:attribute3> attribute3 value </ns:attribute3>

<ns:attribute4> attribute4 value </ns:attribute4>

</ns:Response>

</soapenv:Body>

</soapenv:Envelope>

All the values for these attributes are available with SOAP Request.

Please note that, I have already implemented the ASYNC SOAP --> PI --> ASYNC IDOC. And this is working fine. When I execute this Scenario from SOAPUI tool, I get an empty SOAP response.

All I need is, to fill this empty SOAP response with attributes from SOAP Request. Could anybody provide some hints to implement this. I did quite some search in SDN but most of the Scenarios talking about the response from target system(IDOC in my case). However, I need to simply fill the SOAP response from the same SOAP request within the same session.

I appriciate any help in this regard. Thanks in advance.

Kind Regards,

Prasad.