cancel
Showing results for 
Search instead for 
Did you mean: 

To remove the SOAP Envelope from the Response

Former Member
0 Kudos

We have scenario that is proxy to soap with synchronize. I am unable to convert the response structure into the required response structure. Could you please anyone provide me the xslt structure for the below.

Input (Webservice Response) Structure.

  

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/04/secext">

- <SOAP-ENV:Body>

<F059Response xmlns="http://www.Lichtsinfotech.com/Schema/Personal/RetailParty/ACIP">

<F059Result>

<ResultCondition xmlns="http://www.Lichtsinfotech.com/Schema/Infrastructure/SOAP">

  <SeverityCode>0</SeverityCode>

  </ResultCondition>

  </F059Result>

  <AdditionalDataIn>0</AdditionalDataIn>

<AddressStaticData>

  <AddressTownNm>INDIA</AddressTownNm>

  <OutPostCd>SM9</OutPostCd>

  <InPostCd>0NB</InPostCd>

  </AddressStaticData>

<AddressMatches>

  <OrganisationNm>Lichts Infotech</OrganisationNm>

  <BuildingNo>45</BuildingNo>

<AddressLinePaf>

  <AddressLineTx>XXXX</AddressLineTx>

  </AddressLinePaf>

  <DelivPointSuffixCd>1X</DelivPointSuffixCd>

  </AddressMatches>

  </F059Response>

  </SOAP-ENV:Body>

  </SOAP-ENV:Envelope>

Output (Required) Structure:

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

<ns0:R099Response xmlns:ns0="http://www.lichtsinfoteh.com/Schema/Infrastructure/SOAP">

   <ns0:R099Result>

      <ns0:ResultCondition>

         <ns0:ExtraConditions>

            <ns0:Condition>

               <ns0:SeverityCode/>

               <ns0:ReasonCode/>

               <ns0:ReasonText/>

               <ns0:ReasonDetail/>

            </ns0:Condition>

         </ns0:ExtraConditions>

         <ns0:SeverityCode/>

         <ns0:ReasonCode/>

         <ns0:ReasonText/>

         <ns0:ReasonDetail/>

      </ns0:ResultCondition>

   </ns0:R099Result>

   <ns0:AdditionalDataIn/>

   <ns0:AddressStaticData>

      <ns0:AddressDistrictNm/>

      <ns0:AddressTownNm/>

      <ns0:AddressCountyNm/>

      <ns0:OutPostCd/>

      <ns0:InPostCd/>

   </ns0:AddressStaticData>

   <ns0:AddressMatches>

      <ns0:OrganisationNm/>

      <ns0:SubBuildingNm/>

      <ns0:BuildingNm/>

      <ns0:BuildingNo/>

      <ns0:AddressLinePaf>

         <ns0:AddressLineTx/>

      </ns0:AddressLinePaf>

      <ns0:DelivPointSuffixCd/>

   </ns0:AddressMatches>

</ns0:R099Response>

Kindly provide me the XSLT mapping for the above structures.

Regards,

Venkat.

Accepted Solutions (1)

Accepted Solutions (1)

iaki_vila
Active Contributor

Hi Venkat,

With this XSL you will remove all SOAP tags:

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

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">

    <xsl:output indent="yes"/>

    <xsl:template match="@* | node()">

        <xsl:copy>

            <xsl:apply-templates select="@* | node()"/>

        </xsl:copy>

    </xsl:template>

    <xsl:template match="soapenv:*">

        <xsl:apply-templates select="@* | node()"/>

    </xsl:template>

</xsl:stylesheet>

Later, you can use the message mapping to make the payload changes in order to get your desired output.

Regards.

Former Member
0 Kudos

Many thanks Iñaki Vila for the update.

After updating XSLT Code there is an error Message while doing the test from OM

RuntimeException when executing application mapping program

com/sap/xi/tf/_G111_MM_F011Response_;Details:

com.sap.aii.utilxi.misc.api.BaseRuntimeException;Content is not allowed in prolog.

iaki_vila
Active Contributor
Former Member
0 Kudos

Hi Iñaki Vila,

Soap envelope is successfully removed and again the following error message is appeard when i tried the run the proxy.

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

- <!--  Request Message Mapping

  -->

- <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">

  <SAP:Category>Application</SAP:Category>

  <SAP:Code area="MAPPING">RESOURCE_NOT_FOUND</SAP:Code>

  <SAP:P1>6db32830-64a7-11e2-8084-cf970af5d3d8</SAP:P1>

  <SAP:P2>http://Lichtsinfotech.com/HRT/G111/YourPayToOCIS</SAP:P2>

  <SAP:P3>diya1.xsl</SAP:P3>

  <SAP:P4>-1</SAP:P4>

  <SAP:AdditionalText />

  <SAP:Stack>Unable to find resource 6db32830-64a7-11e2-8084-cf970af5d3d8 in the following software component versions: http://Lichtsinfotech.com/vRT/G111/YourPayToOCISdiya1.xsl-1</SAP:Stack>

  <SAP:Retry>N</SAP:Retry>

  </SAP:Error>

ambrish_mishra
Active Contributor
0 Kudos

Hi Venkat,

The error is because at runtime the system is not able to find the mapping program. please check the cache (SXI_CACHE) for any cache issues.

Ambrish

iaki_vila
Active Contributor
0 Kudos

Hi Venkah,

A few cents to Ambrish suggestion, try to refresh the CPA cache as well, check this http://scn.sap.com/message/13242958#13242958

Regards.

Former Member
0 Kudos

Hi,

 

Cache issue is resolved now but there is no response from PI to Source But we are getting response from target to PI. Can you please advise how to proceed further.

ambrish_mishra
Active Contributor
0 Kudos

What is the error you are getting ?

Former Member
0 Kudos

There is no error but we got the problem with RESPONSE From PI to Source.

Former Member
0 Kudos

There is no error but there is NO RESPONSE From PI to Source.

Former Member
0 Kudos

Now this is the error we are getting :

SOAP: response message contains an error XIAdapter/HTTP/ADAPTER.HTTP_EXCEPTION - HTTP 400 Application Service Request Failed                                                                                              

iaki_vila
Active Contributor
0 Kudos

Hi Venkat,

There is any error in the endpoint, may be the XML that you are sending is not correct. Are you using the check Do not use SOAP envelope? have you tried to test the webservice with SOAPui and later to compare the PI message with SOAPui message?.

Regards.

Former Member
0 Kudos

Hi

Iñaki Vila&Ambrish Mishra

its working fine now.Many thanks for the help.

Former Member
0 Kudos

Hi,

i am facing one more issue while triggering the proxy in ECC there is an error message and if i click to continue the response is success but unable to update the response from corresponding tables

The error message:

PARSE_APPLICATION_DATA Error during XML=>ABAP

conversion: Response Message;

CX_ST_MATCH_ELEMENT in

Contine       Log              Cancel

Please advice how to proceed further and let me know where its failed?

Former Member
0 Kudos

Hi,

i am facing one more issue while triggering the proxy in ECC there is an error message and if i click to continue the response is success but unable to update the response from corresponding tables

The error message:

PARSE_APPLICATION_DATA Error during XML=>ABAP

conversion: Response Message;

CX_ST_MATCH_ELEMENT in

Contine       Log              Cancel

Please advice how to proceed further and let me know where its failed?

iaki_vila
Active Contributor
0 Kudos

Hi Venkat,

I think you could have the same problem that i had yesterday . First, you check that message is correct in the PI response. Take the message and validate it against the output schema with a program like XMLSPY.

Check in the R/3 sxi_monitor (you should enable it if there isn't any message) if the payload appears in the monitoring, If your R/3 SP is lower than 23 and SAP BASIS 7.0 you need to apply the note pointed in this thread http://scn.sap.com/thread/1956488

Regards.

markangelo_dihiansan
Active Contributor
0 Kudos

Hello Venkat,

It just means that the data in one or more of your fields does not match the proxy data type examples would be:

1. backend data type is INT but the data in your field contains letters

2. backend data type length is 3, but you are passing 4 characters

3. Mandatory field in proxy is missing in your output mapping

and so on...

Regards,

Mark

Former Member
0 Kudos

Hi Inaki,

We need to add response namespace in XSLT, Can you please add my namespace the corresponding XSLT Code

The original xslt code:

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

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">

    <xsl:output indent="yes"/>

    <xsl:template match="@* | node()">

        <xsl:copy>

            <xsl:apply-templates select="@* | node()"/>

        </xsl:copy>

    </xsl:template>

    <xsl:template match="soapenv:*">

        <xsl:apply-templates select="@* | node()"/>

    </xsl:template>

</xsl:stylesheet>

Need to add namespace the above code:

http://lichtsinfotech.com/HRT/G111/YourPaynxst

Please help on this.

Former Member
0 Kudos

Its Very urgent..can anyone help on this.

We need to add response namespace in XSLT, Can you please add my namespace the corresponding XSLT Code

The original xslt code:

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

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">

    <xsl:output indent="yes"/>

    <xsl:template match="@* | node()">

        <xsl:copy>

            <xsl:apply-templates select="@* | node()"/>

        </xsl:copy>

    </xsl:template>

    <xsl:template match="soapenv:*">

        <xsl:apply-templates select="@* | node()"/>

    </xsl:template>

</xsl:stylesheet>

Need to add namespace the above code:

http://lichtsinfotech.com/HRT/G111/YourPaynxst

Please help on this.

iaki_vila
Active Contributor
0 Kudos

Hi Venkat,

Please, share the input and desired output XML.

Regards.

Former Member
0 Kudos

Request Test Data

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

<ns0:G150_MT_F059Request xmlns:ns0="http://lichtsinfotech.com/HRT/G111/YourPayToOCIS">*********(Correct namespace - All components under this namespace only)

  <Body>

    <F01Request>

   <MaxRepeatGroupQy>0</MaxRepeatGroupQy>

   <ExtSysId>0</ExtSysId>

   <NoOfLinesReqdCn>7</NoOfLinesReqdCn>

   <MixedCaseAddressReqdIn>N</MixedCaseAddressReqdIn>

   <HouseNoNmTxOutPostCd>25</HouseNoNmTxOutPostCd>

   <OutPostCd>SE1</OutPostCd>

   <InPostCd>0NA</InPostCd>

  </F01Request>

</Body>

</ns0:G150_MT_F01Request>

Response Test Data

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/04/secext">

- <SOAP-ENV:Body>

<F02Response xmlns="http://www.Lichtsinfotech.com/Schema/Personal/RetailParty/OCIS"> *************(This Namespace is wrong)

<F02Result>

<ResultCondition xmlns="http://www.Lichtsinfotech.com/Schema/Infrastructure/SOAP">

  <SeverityCode>0</SeverityCode>

  </ResultCondition>

  </F02Result>

  <AdditionalDataIn>0</AdditionalDataIn>

<AddressStaticData>

  <AddressTownNm>LONDON</AddressTownNm>

  <OutPostCd>SE1</OutPostCd>

  <InPostCd>0NA</InPostCd>

  </AddressStaticData>

<AddressMatches>

  <OrganisationNm>LLOYDS TSB BANK PLC</OrganisationNm>

  <BuildingNo>25</BuildingNo>

<AddressLinePaf>

  <AddressLineTx>LAVINGTON STREET</AddressLineTx>

  </AddressLinePaf>

  <DelivPointSuffixCd>1B</DelivPointSuffixCd>

  </AddressMatches>

  </F02Response>

  </SOAP-ENV:Body>

  </SOAP-ENV:Envelope>

XSLT code for removing envelope

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

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">

    <xsl:output indent="yes"/>

    <xsl:template match="@* | node()">

        <xsl:copy>

            <xsl:apply-templates select="@* | node()"/>

        </xsl:copy>

    </xsl:template>

    <xsl:template match="soapenv:*">

        <xsl:apply-templates select="@* | node()"/>

    </xsl:template>

</xsl:stylesheet>

iaki_vila
Active Contributor
0 Kudos

Hi Venkat,

May be I missunderstood, but with this:

XML source:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/04/secext">

    <SOAP-ENV:Body>

        <F059Response xmlns="http://www.Lichtsinfotech.com/Schema/Personal/RetailParty/ACIP">

            <F059Result>

                <ResultCondition xmlns="http://www.Lichtsinfotech.com/Schema/Infrastructure/SOAP">

                    <SeverityCode>0</SeverityCode>

                </ResultCondition>

            </F059Result>

            <AdditionalDataIn>0</AdditionalDataIn>

            <AddressStaticData>

                <AddressTownNm>INDIA</AddressTownNm>

                <OutPostCd>SM9</OutPostCd>

                <InPostCd>0NB</InPostCd>

            </AddressStaticData>

            <AddressMatches>

                <OrganisationNm>Lichts Infotech</OrganisationNm>

                <BuildingNo>45</BuildingNo>

                <AddressLinePaf>

                    <AddressLineTx>XXXX</AddressLineTx>

                </AddressLinePaf>

                <DelivPointSuffixCd>1X</DelivPointSuffixCd>

            </AddressMatches>

        </F059Response>

    </SOAP-ENV:Body>

</SOAP-ENV:Envelope>

XSL:

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

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">

    <xsl:output indent="yes"/>

    <xsl:template match="@* | node()">

        <xsl:copy>

            <xsl:apply-templates select="@* | node()"/>

        </xsl:copy>

    </xsl:template>

    <xsl:template match="soapenv:*">

        <xsl:apply-templates select="@* | node()"/>

    </xsl:template>

    <xsl:template match="*">

        <xsl:element name="{local-name()}" namespace="http://lichtsinfotech.com/HRT/G111/YourPaynxst">

            <xsl:apply-templates select="@*|node()"/>

        </xsl:element>

    </xsl:template>

</xsl:stylesheet>

XML output:

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

<F059Response xmlns="http://lichtsinfotech.com/HRT/G111/YourPaynxst">

    <F059Result>

        <ResultCondition>

            <SeverityCode>0</SeverityCode>

        </ResultCondition>

    </F059Result>

    <AdditionalDataIn>0</AdditionalDataIn>

    <AddressStaticData>

        <AddressTownNm>INDIA</AddressTownNm>

        <OutPostCd>SM9</OutPostCd>

        <InPostCd>0NB</InPostCd>

    </AddressStaticData>

    <AddressMatches>

        <OrganisationNm>Lichts Infotech</OrganisationNm>

        <BuildingNo>45</BuildingNo>

        <AddressLinePaf>

            <AddressLineTx>XXXX</AddressLineTx>

        </AddressLinePaf>

        <DelivPointSuffixCd>1X</DelivPointSuffixCd>

    </AddressMatches>

</F059Response>

Correct me, if something is wrong

Regards.

Former Member
0 Kudos

thats correct. now i am getting the following error message while triggering the proxy

System expected the element '{http:/lichtinfotech.com/HRT/G111/YourPayToOCIS}G250_MT_F011Response'

Exception of class CX_ST_MATCH_ELEMENT

Answers (2)

Answers (2)

suchitatomar
Participant
0 Kudos

Hi  Inki,

Need your inputs , I have same kind of  requirement , could u please share your email id so that we can discuss this in more details.

Appreciate your help and support for same.

Regards

ambrish_mishra
Active Contributor
0 Kudos

Hi Venkat,

Why don't you map the WS repsonse structure to the target response structure. The required structure would anyways be defined in the proxy. Simply map the WS response to the target response structure required by the proxy.

Ambrish

Former Member
0 Kudos

Many Thanks Ambries for the update.

its already done but while response from WS there is only 2 xml tag appeared and its not retrieving any field values which is requested by us.

The Response of the xml tags:

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

<ns1:G111:G111_MT_F011Response

xmlns:ns1="http://lichtsinfotech.com/VRT/G111/XXXX"></ns1:G111_MT_F011Response>