我有一个异步 BPEL 流程,我想从我的 Java EE Web 应用程序中调用它。我怎样才能做到这一点?我正在使用 Oracle SOA-Suite 11g PS3。
问问题
1900 次
1 回答
0
异步 SOAP/HTTP 发送方与同步 SOAP/HTTP 客户端基本相同,只是它丢弃了响应。仅检查响应的 HTTP 状态以验证接收者是否理解您的消息。
异步接收器基本上是一个 SOAP/HTTP 服务器,它监听在请求的“ReplyTo/Adress”字段中发送的地址。收到消息后,它会发送一个带有“200”状态代码的空响应。
使用 WS-Addressing SOAP 标头字段“MessageID”(请求)和“RelatesTo”(响应)将发送和接收的消息关联起来。
如果您对“低技术”解决方案感到满意,您可以像通过 HTTP 的 XML 一样发送/接收异步 SOAP 请求。BPEL 流程“AsynchDummy”将以下 HTTP 请求理解为异步请求。AsynchDummy 是使用 JDeveloper 生成的默认异步 BPEL 流程:
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" env:encodingStyle="">
<env:Header>
<ReplyTo xmlns="http://schemas.xmlsoap.org/ws/2003/03/addressing">
<Address>http://localhost:3333/my/j2ee/servlet</Address>
<PortType xmlns:ptns="http://xmlns.oracle.com/AsynchDummy">ptns:AsynchDummyCallback</PortType>
<ServiceName xmlns:snns="http://xmlns.oracle.com/AsynchDummy">snns:AsynchDummyCallbackService</ServiceName>
</ReplyTo>
<MessageID xmlns="http://schemas.xmlsoap.org/ws/2003/03/addressing" ans1:rootId="610005" xmlns:ans1="http://schemas.oracle.com/bpel" ans1:parentId="160005" ans1:priority="0">ABC123</MessageID>
</env:Header>
<env:Body>
<AsynchDummyProcessRequest xmlns="http://xmlns.oracle.com/AsynchDummy">
<input>this is the request</input>
</AsynchDummyProcessRequest>
</env:Body>
</env:Envelope>
不要忘记将 SOAPAction HTTP 标头设置为“initiate”(包括引号)。
您可以从 BPEL 流程的回调客户端步骤中看到类似的消息:
<?xml version="1.0" encoding="UTF-8"?>
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
<soap-env:Header xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:add="http://schemas.xmlsoap.org/ws/2003/03/addressing" xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
<add:RelatesTo>ABC123</add:RelatesTo>
<add:MessageID ans1:rootId="" ans1:parentId="" ans1:priority="0" xmlns:ans1="http://schemas.oracle.com/bpel">ABC456</add:MessageID>
</soap-env:Header>
<soap-env:Body>
<AsynchDummyProcessResponse xmlns="http://xmlns.oracle.com/AsynchDummy">
<result>this is the result</result>
</AsynchDummyProcessResponse>
</soap-env:Body>
</soap-env:Envelope>
于 2011-05-10T12:41:18.400 回答