cancel
Showing results for 
Search instead for 
Did you mean: 

XSLT: Remove Envelope from WS response into SAP

Former Member
0 Kudos

Hello experts,

First of all, believe me I've been searching for a few days already and have tried way many different variants, but I still get an error message when testing from SAP side using SPROXY.

I'm working on a Synchronous scenario with a WebService that uses Envelope for Request and Response. Request seems to be working fine. Before using a custom Message Type MT_FacturasPendientesResp, I managed to get a response in SPROXY but still with a different error message.

The funny thing is when testing the XSL mapping in ESR works fine and I get the expected result. The error I get when using SPROXY is as follows.

Probably there's something I can't see, but seems some kind of misunderstanding perhaps namespaces?. Can anyone see any big mistakes?

Please advice.

I appreciate any help to solve this issue.

Thank you for your time.

Patricio.

Error testing Service Interface in SPROXY

Operation Mapping

I remove all namespaces with this template.

Output.xsl


<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

xmlns:ns0="http://xxxxxxx.com">

    <xsl:output indent="yes"/>

   

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

        <xsl:copy>

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

        </xsl:copy>

    </xsl:template>

   

    <xsl:template match="/">

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

    </xsl:template>

   

    <xsl:template match="*">

        <xsl:element name="{local-name()}">

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

        </xsl:element>

       

    </xsl:template>

   

</xsl:stylesheet>

Then I try to build the same structure in MT_FacturasPendientesResp as in ESR

Output_2.xsl (namespace used here is same as MT in ESR)


<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"

xmlns:p1="http://xxxxxxxxxxxxx.com">

<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>

  <xsl:template match="/">

  <p1:MT_FacturasPendientesResp>

     <respuesta>

    <items>

    <factura>

  

  <xsl:for-each select="Envelope/Body/consultarFacturasConSaldosPendientesResponse/respuesta/items/factura">

      <nroFactura>

      <xsl:value-of select="nroFactura"/>

      </nroFactura>

     </xsl:for-each>

    

      </factura>

    </items>

    </respuesta>

    </p1:MT_FacturasPendientesResp>

  

  </xsl:template>

</xsl:stylesheet>

MT_FacturasPendientesResp

Here's also MONI info:

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi All!

Thank you all for your help.

This has been resolved!


SAP OSS helped us.

They sugested to follow the resolution in Note 1658476

Resolution

- Apply the SAP Note 1522630 XI runtime: Payload ignored due to parsing error

- Depending on the scenario, it may also be necessary to apply this note on backend R/3 systems which are involved in the message exchange e.g. ECC etc

Also, this is the XSL I've applied for input:


<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

xmlns:ns2="http://xxxxxxxxxxxxx.com.ar/"

xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">

<xsl:output indent="yes"/>

  <xsl:template match="ns2:consultarFacturasYSaldosPorFacturasResponse">

  <xsl:copy>

   <xsl:apply-templates select="ns2:consultarFacturasYSaldosPorFacturasResponse|@*"/>

  </xsl:copy>

</xsl:template>

    <xsl:template match="ns2:consultarFacturasYSaldosPorFacturasResponse|@*">

      <xsl:copy-of select="." />

     </xsl:template>

      

</xsl:stylesheet>

Where xmlns:ns2="http://xxxxxxxxxxxxx.com.ar/" is namespace of WS response.

This is to remove Envelope and Body tags from SOAP response.

Hope this helps if anybody hits with a similar issue.

Regards,

Patricio.-

Answers (3)

Answers (3)

Former Member
0 Kudos

Thank you all for your help.


I did try all of your recommendations, and now I get error message as follows in CC Monitoring:

For SOAP Communication Channel:

Message processing failed. Cause: com.sap.engine.interfaces.messaging.api.exception.MessagingException: iaik.security.ssl.SSLCertificateException: Peer certificate rejected by ChainVerifier

I already contacted the End-Client which explained there is no need of Certificate. Anyway I'm still waiting for an answer on their development team.

Tests with SOAP UI works ok, without any specific certificate, so I'm not sure what this error message means.

If any ideas come up, please let me know. Anything might help.

Thanks again,
Patricio.

former_member186851
Active Contributor
0 Kudos

Hello Patricio,

Make sure of certificates first and also check from the basis team of PI whether the URL is enabled and whitelisted.

former_member182412
Active Contributor
0 Kudos

Hi Patricio,

Are you using https URL in SOAP receiver channel?? If yes then run the XPI Inspector as shown in this blog and see the URL is expecting any certificates, if the URL expects any certificates trace will display the list of certificates, you can also download the certificates from there and deploy them into NWA trusted CA key store view. After you install the certificate you need to stop and start the channel to load the new certificate in the channel cache.

Regards,

Praveen.

Former Member
0 Kudos

Thanks Praveen!

This looks quite helpful.

I'll need some time to deploy the XPI inspector and will come back with results.

Regards,

Patricio.

former_member182412
Active Contributor
0 Kudos

Hi Patricio,

Have you enable the check box "Do Not Use SOAP Envelope" in your receiver SOAP adapter because you are dealing with envelope in the mapping.

Regards,

Praveen.

Former Member
0 Kudos

Hi Praveen,

"Do not use SOAP Envelope" is already checked.

Thanks,

Patricio.

nitindeshpande
Active Contributor
0 Kudos

Hello Patricio,

Can you try removing the default namespace provided in your Message type of receiver interface/

Regards,

Nitin

former_member186851
Active Contributor
0 Kudos

Hello Patrico

In the operation mapping try enabling/Disabling use SAP XML tookit option and check once.

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Patricio,

Have you tried testing the response message in your xlst mapping? It is also possible that a fault message has been returned and you don't have a mapping for that.

Also add XMBWS.NoSOAPIgnoreStatusCode = true in your module configuration for the receiver adapter.

Regards,

Mark

Former Member
0 Kudos

Hello Mark,

Thank you for answer.

I tested the response and the xslt mapping is working fine in ESR. I got response structure using SOAP UI, with the same payload I get from SXI_MONITOR.

Is XMBWS.NoSOAPIgnoreStatusCode the parameter name for soap Module Key?

Like this?

Thanks,
Patricio.

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Patricio,

Yes, that is correct. Try reactivating the interface determination. If that does not work, I'm afraid you need to raise OSS.

Regards,

Mark