IIB - 如何在 SOAPAsyncRequest 节点中传递 UserContext

IIB - How to pass UserContext in a SOAPAsyncRequest node

我正在尝试通过覆盖本地环境将用户上下文从 SOAPAsyncRequest 节点传递到 SOAPAsyncResponse 节点,如 IBM 文档 here and here 中所述。

这是我的流程的一部分:

映射到 N 计算节点(计算模式在 LocalEnvironment 和 Message 上设置):

SET OutputLocalEnvironment = InputLocalEnvironment;
SET OutputLocalEnvironment.Variables.RequestId = InputLocalEnvironment.Destination.HTTP.RequestIdentifier;
SET OutputLocalEnvironment.Variables.Language = InputRoot.HTTPInputHeader."Accept-Language";
SET OutputLocalEnvironment.Destination.SOAP.Request.UserContext = CAST(ASBITSTREAM(OutputLocalEnvironment.Variables) as BLOB);

SetRequestId计算节点中:

DECLARE UserContext BLOB;
SET UserContext = InputLocalEnvironment.Destination.SOAP.Response.UserContext;

Map to N节点后LocalEnvironment调试值:

LocalEnvironment
    Destination
        HTTP
            RequestIdentifier:BLOB:[B@54d21920
        RouterList
            DestinationData
                labelName:CHARACTER:GET
        SOAP
            Request
                UserContext:BLOB:[B@3d098be1

SOAP 异步响应 N 节点后的调试值:

LocalEnvironment
    SOAP
        Response
            MessageCorrelId:BLOB:[B@a075817
    Destination
        RouterList
            DestinationData
                labelName:CHARACTER:findXYZ

虽然在映射到N节点之后正确设置了LocalEnvironment(参见上面的调试),UserContext的值始终为空。

编辑: 除了 UserContext 问题,我的流程运行正常。回答第一条评论,是的,正确设置了唯一标识符。

我没有成功传递 Variables 树结构,但我通过连接值并将其存储到 BLOB 中找到了解决方法。这既不是最干净的解决方法,在处理两个以上的对象时也不容易实施。

In 映射到 D 计算节点:

SET ConcatenatedContext = 'YourFirstString' || ';' || 'YourSecondString';
SET OutputLocalEnvironment.Destination.SOAP.Request.UserContext = CAST(ConcatenatedContext AS BLOB CCSID 1208);

SetRequestId中计算节点:

DECLARE RawValue CHARACTER;
SET RawValue = CAST(InputLocalEnvironment.SOAP.Response.UserContext AS CHARACTER CCSID 1208);
SET FirstString = SUBSTRING(RawValue BEFORE ';');
SET SecondString = SUBSTRING(RawValue AFTER ';');