SOAP隐式标头

时间:2018-08-24 14:21:59

标签: web-services soap ibm-integration-bus extended-sql

我想在响应中添加一个自定义的隐式肥皂头。

MsqFlow

enter image description here

ESQL

CREATE FUNCTION Main() RETURNS BOOLEAN
    BEGIN
        SET OutputRoot.MQMD = InputRoot.MQMD;
        CREATE LASTCHILD OF OutputRoot DOMAIN 'SOAP' NAME 'SOAP';
        SET OutputRoot.SOAP.Header.eaie:apiHeader.messageId = UUIDASCHAR;
        SET OutputRoot.SOAP.Header.eaie:apiHeader.timestamp = CURRENT_TIMESTAMP;
        SET OutputRoot.SOAP.Header.eaie:apiHeader.transactionId = Environment.Variables.Generic.Session.TransactionId;
        SET OutputRoot.SOAP.Header.eaie:apiHeader.correlationId = Environment.Variables.Generic.Session.CorrelationId;
        SET OutputRoot.SOAP.Header.eaie:apiHeader.scrSystem = 'EAI';
        SET OutputRoot.XMLNSC = InputRoot.XMLNSC;
        RETURN TRUE;
    END;
END MODULE;
消息中的[计算节点]和[SOAP回复]之间的断点

用正确的参数填充SOAP,但作为响应,仍然看到只有肥皂体而没有头。

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Body>

我缺少什么?

1 个答案:

答案 0 :(得分:1)

我终于找到了解决方案,我没有创建XMLNSC,也没有添加强制性的SOAP Body。

最终代码

CREATE FUNCTION Main() RETURNS BOOLEAN
    BEGIN
        SET OutputRoot.MQMD = InputRoot.MQMD;
        CREATE LASTCHILD OF OutputRoot DOMAIN 'XMLNSC' NAME 'XMLNSC';
        SET OutputRoot.SOAP.Header.eaie:apiHeader.messageId = UUIDASCHAR;
        SET OutputRoot.SOAP.Header.eaie:apiHeader.timestamp = CURRENT_TIMESTAMP;
        SET OutputRoot.SOAP.Header.eaie:apiHeader.transactionId = Environment.Variables.Generic.Session.TransactionId;
        SET OutputRoot.SOAP.Header.eaie:apiHeader.correlationId = Environment.Variables.Generic.Session.CorrelationId;
        SET OutputRoot.SOAP.Header.eaie:apiHeader.scrSystem = 'EAI';
        SET OutputRoot.SOAP.Body.nsOut:getXXXResponse = InputRoot.XMLNSC.nsOut:getXXXResponse;
        SET OutputRoot.XMLNSC = InputRoot.XMLNSC;
        RETURN TRUE;
    END;
END MODULE;