cancel
Showing results for 
Search instead for 
Did you mean: 

Editing SOAP envelope for SAP HCI receiver channel

0 Kudos

Hi all,

I have a specific requirement to edit the SOAP envelope being sent from SAP HCI ( i am using SOAP 1.x receiver adapter)

required format : <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://xyz.abc.com">

where as envelope sent from HCI is: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">

Please suggest any method where we can achieve the required namespaces in the envelope.

Accepted Solutions (0)

Answers (3)

Answers (3)

Varanganti
Explorer

as you are adding SOAP envelope with xslt code then try to use HTTP receiver adapter instead of SOAP

Sriprasadsbhat
Active Contributor

Hello Somen,

Can you try having below XSLT before your call to SOAP Adapter.

XML Input:

<TestSOAPReqest>
    <Record>
        <Field1>F11</Field1>
        <Field2>F22</Field2>
    </Record>
</TestSOAPReqest>

XSLT Mapping:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ser="http://xyz.abc.com" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes"/>
    <xsl:strip-space elements="*"/>
    <xsl:template match="/TestSOAPReqest">
        <soapenv:Envelope>
            <soapenv:Header/>
            <soapenv:Body>
                <ser:TestSOAPReqest>
                    <xsl:copy-of select="*"/>
                </ser:TestSOAPReqest>
            </soapenv:Body>
        </soapenv:Envelope>
    </xsl:template>
</xsl:stylesheet>

Please give a try with the above code i have tested XSLT code but not sure about how it behaves in when you add it before SOAP call.

Please do revert back with your observation it would help find out the exact behavior.

Regards,

Sriprasad Shivaram Bhat

0 Kudos

Hi Sriprasad,

Please your help with my iflow.

2019-11-05-13-12-23.png

The XSLT mapping run correctly, but the SOAP Receiver generates error.

Error Details java.lang.IllegalArgumentException: The PayLoad elements cannot fit with the message parts of the BindingOperation. Please check the BindingOperation and PayLoadMessage.XSLT Mapping<?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:template match="/"> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/"> <soapenv:Header> <tem:CabeceraCR> <tem:Usuario>USER</tem:Usuario> <tem:Clave>PASS</tem:Clave> </tem:CabeceraCR> </soapenv:Header> <soapenv:Body> <xsl:copy-of select="."/> </soapenv:Body> </soapenv:Envelope> </xsl:template> </xsl:stylesheet>
Payload After XSLT Mapping<?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/"> <soapenv:Header> <tem:CabeceraCR> <tem:Usuario>USER</tem:Usuario> <tem:Clave>PASS</tem:Clave> </tem:CabeceraCR> </soapenv:Header> <soapenv:Body> <tem:ObtenerReporteMarcimex> <tem:tipoDocumento>C</tem:tipoDocumento> <tem:numeroDocumento>123456</tem:numeroDocumento> <tem:fechaNacimiento/> <tem:estadoCivil>C</tem:estadoCivil> <tem:tipoVivienda>P</tem:tipoVivienda> <tem:genero>M</tem:genero> <tem:tieneTelefonoConvencional/> <tem:tieneTelefonoMovil/> <tem:numeroCargas>1</tem:numeroCargas> <tem:fechaIngresoTrabajo/> <tem:maxDiasVencido>100</tem:maxDiasVencido> <tem:maxMontoVencido>50</tem:maxMontoVencido> </tem:ObtenerReporteMarcimex> </soapenv:Body> </soapenv:Envelope>
2019-11-05-13-27-20.png
The same XML is used in SoapUI and works correctlyRegards.