消息不包含有效的 HTTP 上下文信息,需要 return 上下文信息

Message does not contain valid HTTP context information, Need return context info

我正在使用 IBM 集成工具包

我有一个包含两个流程的应用程序;请求流有一个使用 http 请求节点的 json 请求消息,然后该消息通过 MQ 输入、计算节点然后 MQ 回复被抛到另一个流(在另一个代表存根的应用程序中)。

然后它通过 MQ Input 将消息抛到我的应用程序中的响应流

我需要通过 http 回复节点以 json 形式输出消息,但在流程中它运行异常 "Message does not contain valid HTTP context information, Need return context info"

如果有人知道这个错误以及如何解决它 提前致谢

问题是您的 HTTP 响应流不知道它必须响应哪个请求。

如果您确实需要将请求和响应实现为不同的流,则必须将传入 HTTP 或 SOAP 请求的标识符存储在某个地方,例如作为某个专用队列中的消息。

在您的请求流程中,您可以在

中找到请求标识符
 InputLocalEnvironment.Destination.HTTP.RequestIdentifier

 InputLocalEnvironment.Destination.SOAP.RequestIdentifier

取决于输入节点的类型。

然后,您的响应流应该读取请求流写入的消息以找到 RequestIdentifier 的值。 该值应设置到响应消息组件的 LocalEnvironment 中:

OutputLocalEnvironment.Destination.HTTP.Reply.ReplyIdentifier

OutputLocalEnvironment.Destination.SOAP.Reply.ReplyIdentifier

这是 IBM 文档:https://www.ibm.com/support/knowledgecenter/SSMKHH_9.0.0/com.ibm.etools.mft.doc/ac20450_.htm#ac20450___le

When the HTTPInput node receives an input request message, it sets the local environment field Destination.HTTP.RequestIdentifier to a unique value that identifies the Web service client that sent the request. You can refer to this value, and you can save it to another location if appropriate.

For example, if you design a pair of message flows that interact with an existing WebSphere MQ application (as described in Broker calls existing Web service), you can save the identifier value in the request flow, and restore it in the reply flow, to ensure that the correct client receives the reply. If you use this technique, you must not change the data, and you must retain the data as a BLOB.

The HTTPReply node extracts the identifier value from the local environment tree and sets up the reply so that it is sent to the specific client. However, if you are using an HTTPReply node in a flow that does not have an HTTPInput node, and this field has been deleted or set incorrectly, message BIP3143S is issued.