IBM BUS更改响应的Soap命名空间

时间:2017-01-25 08:34:20

标签: messagebroker ibm-integration-bus

我的肥皂反应如

<?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>

但是,我需要更改命名空间的前缀和响应,并且必须喜欢这个。

<?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>

1 个答案:

答案 0 :(得分:3)

如果您使用ESQL构建消息,则可以按照此处所述执行此操作:

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';

但是,命名空间标记的值不应该有所作为。