cancel
Showing results for 
Search instead for 
Did you mean: 

Payload Convertion

Former Member
0 Kudos

Hi,

I am doing interface like RFC to SOAP and SOAP to RFC .Response.

The payload of the soap response is below. Can some one help to create the SOAP Response structure based on the below structure to map to the BAPI Response.

<?xml version="1.0" encoding="UTF-8"?>

<!-- Inbound Message -->

<AddressValidatorResponse xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.org/geostan3/AddressValidator">

<AddressValidatorResult>

<xs:schema id="AddressCheck" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="">

<xs:element name="AddressCheck" msdata:IsDataSet="true">

<xs:complexType>

<xs:choice maxOccurs="unbounded">

<xs:element name="Address">

<xs:complexType>

<xs:sequence>

<xs:element name="Addline1" type="xs:string" minOccurs="0"/>

<xs:element name="Addline2" type="xs:string" minOccurs="0"/>

<xs:element name="URB" type="xs:string" minOccurs="0"/>

<xs:element name="Lastline" type="xs:string" minOccurs="0"/>

<xs:element name="Location" type="xs:string" minOccurs="0"/>

<xs:element name="OutBlock" type="xs:string" minOccurs="0"/>

<xs:element name="OutCBSA" type="xs:string" minOccurs="0"/>

<xs:element name="MatchCode" type="xs:string" minOccurs="0"/>

<xs:element name="LocationCode" type="xs:string" minOccurs="0"/>

<xs:element name="DPVConfirm" type="xs:string" minOccurs="0"/>

<xs:element name="DPVFalse" type="xs:string" minOccurs="0"/>

<xs:element name="FootNote1" type="xs:string" minOccurs="0"/>

<xs:element name="FootNote2" type="xs:string" minOccurs="0"/>

<xs:element name="FootNote3" type="xs:string" minOccurs="0"/>

<xs:element name="Msg" type="xs:string" minOccurs="0"/>

</xs:sequence>

</xs:complexType>

</xs:element>

</xs:choice>

</xs:complexType>

</xs:element>

</xs:schema>

<diffgr:diffgram xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">

<AddressCheck xmlns="">

<Address diffgr:id="Address1" msdata:rowOrder="0" diffgr:hasChanges="inserted">

<Addline1>220 W MAIN ST</Addline1>

<Addline2/>

<URB/>

<Lastline>LOUISVILLE, KY 40202-1395</Lastline>

<Location>-85754010, 38256144</Location>

<OutBlock>211110049001067</OutBlock>

<OutCBSA>31140</OutCBSA>

<MatchCode>SE1</MatchCode>

<LocationCode>AS0</LocationCode>

<DPVConfirm/>

<FootNote1/>

<FootNote2/>

<FootNote3/>

<Msg>OK</Msg>

</Address>

</AddressCheck> </diffgr:diffgram>

</AddressValidatorResult>

</AddressValidatorResponse>

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

As you said I tried with XSLT but still I am getting the same response. Can you send me with step by step how to do this.

Thank you veru much in advance

Regards,

Ksihore

Former Member
0 Kudos

Hi,

follow these general steps:

1 - Create 4 data type, you can import it from the soap structure above:

a- Named "schema"

b- Named "diffgram"

c- Named " AddressValidatorResponse"

d - Named "AddressCheck"(this one will be used in the mapping)

The third DT has to include the 1st and 2nd.

2 - create message type "AddressValidatorResponse" and "AddressCheck"

3 - Create a message mapping which correlates the "AddressCheck" with the RFC message fields.

4 - Import into "Imported Archive" a zip file containing the XSLT.

5 - Create an interface mapping with source interface "AddressValidatorResponse" and target

interface BAPI, in the response side insert the mapping program XSL and then choose the other mapping created at 3rd step.At the end you will have two mapping steps for the response.

these are general guideline you should adapt them to your requirements.

Regards,

Emiliano

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Emiliano,

Thank you very much and it's working now.

Former Member
0 Kudos

Hi,

I had such a similar issue, that was my source message:

**********************************************************************************

<?xml version="1.0" encoding="UTF-8"?>

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">

<SOAP-ENV:Body>

<NewOrder xmlns="http://tjkure.no">

<ds>

<xs:schema id="InputDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">

<xs:element msdata:UseCurrentLocale="true" msdata:IsDataSet="true" name="InputDataSet">

<xs:complexType>

<xs:choice minOccurs="0" maxOccurs="unbounded">

<xs:element name="Header">

<xs:complexType>

<xs:sequence>

<xs:element type="xs:string" minOccurs="0" name="user_name"/>

<xs:element type="xs:string" minOccurs="0" name="password"/>

<xs:element type="xs:string" minOccurs="0" name="language"/>

<xs:element type="xs:string" minOccurs="0" name="reference_number"/>

<xs:element type="xs:string" minOccurs="0" name="po_is_urgent"/>

</xs:sequence>

</xs:complexType>

</xs:element>

<xs:element name="Parts">

<xs:complexType>

<xs:sequence>

<xs:element type="xs:string" minOccurs="0" name="sp_code"/>

<xs:element type="xs:string" minOccurs="0" name="sp_quantity"/>

</xs:sequence>

</xs:complexType>

</xs:element>

</xs:choice>

</xs:complexType>

</xs:element>

</xs:schema>

<diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">

<InputDataSet xmlns="">

<Header>

<user_name>1000078?</user_name>

<password>abc</password>

<language>FR</language>

<reference_number>FFAIT2040_P06112509562</reference_number>

<po_is_urgent>N</po_is_urgent>

</Header>

<Parts>

<sp_code>C00900019</sp_code>

<sp_quantity>1</sp_quantity>

</Parts>

</InputDataSet> </diffgr:diffgram>

</ds>

</NewOrder>

</SOAP-ENV:Body>

</SOAP-ENV:Envelope>

**********************************************************************************

And I had to extract the bold part(InputDataSet). I solved the problem by implemeting

an adapter module that uses a customized sax parser combined with an XMLDataSetFilter.

Regards,

Emiliano

Former Member
0 Kudos

Hi Emiliano,

Can you please help me to write a adapter module to solve this.

Regards

Kishore

Former Member
0 Kudos

Hi,

I have another easier solution to the problem. I have made an XSLT mapping, that

simply extracts the portion of code you need(AddressCheck)


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml"/>
  <xsl:template match="/">
    <xsl:apply-templates/>
  </xsl:template>
  <xsl:template match="AddressCheck">
    <xsl:copy-of select=".">
    </xsl:copy-of>
  </xsl:template>
</xsl:stylesheet>

So you make 2 message mapping the first one with XSLT as mapping program,

and the second with a graphical message mapping.

Regards,

Emiliano

Former Member
0 Kudos

hi,

You dont need to have a external definition for this. You can directly import your WSDL like you are importing external definiton. When importing choose wsdl insted of xsd. Then after impoting the WSDL you can proceed like a normal scenario.

For some help on this go through this weblog:

/people/shabarish.vijayakumar/blog/2006/03/23/rfc--xi--webservice--a-complete-walkthrough-part-1

/people/shabarish.vijayakumar/blog/2006/03/28/rfc--xi--webservice--a-complete-walkthrough-part-2

regards

chandra