我创建了一个 WS-BPEL 工作流,它将调用异步 Web 服务并等待回调响应。碳应用程序也成功部署到 BPS 中。
关于我的外部异步 Web 服务的详细信息
1. 它需要通过 http 进行基本身份验证。
2. 它要求肥皂封头在肥皂信封中可用。
3. 它将处理请求并向它在soap 标头中接收到的ReplyTo地址发送回调,并使用MessageID来关联回调。
我的 BPEL 流程的deploy.xml文件如下所示...
<?xml version="1.0" encoding="UTF-8"?>
<deploy xmlns="http://www.apache.org/ode/schemas/dd/2007/03"
xmlns:callback.integration.service="http://callback.integration.service/"
xmlns:epr="http://wso2.org/bps/bpel/endpoint/config"
xmlns:sample="http://wso2.org/bps/sample"
xmlns:ws.integration.service="http://ws.integration.service/">
<process name="sample:Test">
<active>true</active>
<retired>false</retired>
<process-events generate="all"/>
<provide partnerLink="client">
<service name="sample:Test" port="TestPort"/>
</provide>
<provide partnerLink="IntegrationService">
<service name="callback.integration.service:IntegrationCallback" port="IntegrationResponsePort"/>
</provide>
<invoke partnerLink="IntegrationService">
<service name="ws.integration.service:IntegrationService" port="IntegrationRequestPort">
<epr:endpoint endpointReference="IntegrationService.epr"/>
</service>
</invoke>
</process>
</deploy>
IntegrationService.epr文件如下所示 ...
<wsa:EndpointReference
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3schools.com uep_schema.xsd"
xmlns:wsa="http://www.w3.org/2005/08/addressing"
xmlns:wsdl11="http://schemas.xmlsoap.org/wsdl/">
<wsa:Address>http://http://server:8080/integration/IntegrationService</wsa:Address>
<wsa:Metadata>
<id>SInvokeEPR</id>
<qos>
<enableAddressing />
</qos>
<transport type="http">
<authorization-username>username</authorization-username>
<authorization-password>password</authorization-password>
</transport>
</wsa:Metadata>
</wsa:EndpointReference>
现在,当我从 carbon 服务管理控制台测试 bpel 进程时,我确实收到了对我的异步 Web 服务的请求。然而,soap 信封看起来如下,它缺少一个正确的回复地址来发送回调。
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:To>http://server:8080/integration/IntegrationService</wsa:To>
<wsa:ReplyTo>
<wsa:Address>http://www.w3.org/2005/08/addressing/none</wsa:Address>
</wsa:ReplyTo>
<wsa:MessageID>urn:uuid:91ac4ebd-b100-440e-a01d-c4a5c0d8a56f</wsa:MessageID>
<wsa:Action>http://ws.integration.service/IntegrationRequestPortType/createTask</wsa:Action>
</soapenv:Header>
<soapenv:Body>
...
</soapenv:Body>
</soapenv:Envelope>
现在我需要用回调来回复这个请求。回调肥皂信封将包含此MessageID,以便回调与正确的流程实例相关联。
您如何获得附加到肥皂标题的正确回复地址?