Search code examples
messagebrokeribm-integration-bus

IBM BUS Change Soap Namespace of Responce


My Soap Responce like

<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Body>
        <Response xmlns="http://tempuri.org/">
            <Result>
                <Result>LOGON FAILED</Result>
            </Result>
        </Response>
    </soapenv:Body>
</soapenv:Envelope>

But, I need change the prefix of namespace and responce and must like this one.

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Body>
        <Response xmlns="http://tempuri.org/">
            <Result>
                <Result>LOGON FAILED</Result>
            </Result>
        </Response>
    </soapenv:Body>
</soap:Envelope>

Solution

  • If you are using ESQL to construct your message you can do this as described here:

    https://www.ibm.com/support/knowledgecenter/SSKM8N_8.0.0/com.ibm.etools.mft.doc/ac67194_.htm

    DECLARE soapNs NAMESPACE 'http://schemas.xmlsoap.org/soap/envelope/';
    DECLARE tempNs NAMESPACE 'http://tempuri.org/';
    
    SET OutputRoot.XMLNSC.soapNs:Envelope.(XMLNSC.NamespaceDecl)xmlns:soap = soapNs;
    SET OutputRoot.XMLNSC.soapNs:Envelope.soapNs:Body.tempNs:Response.(XMLNSC.NamespaceDecl)xmlns = tempNs;
    SET OutputRoot.XMLNSC.soapNs:Envelope.soapNs:Body.tempNs:Response.tempNs:Result.tempNs:Result = 'LOGON FAILED';
    

    But still, the value of the namespace tags shouldn't make a difference.