首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ReplyTo属性在SOAPHeader中缺失

ReplyTo属性在SOAPHeader中缺失
EN

Stack Overflow用户
提问于 2013-03-04 11:44:35
回答 1查看 2.3K关注 0票数 3

我已经创建了一个WS工作流,它将调用异步web服务并等待回调响应。碳应用也成功地应用到BPS中。

我的外部异步web服务的详细信息

  1. 它需要在http上进行基本身份验证。
  2. 它要求soap头在soap信封中可用。
  3. 它将处理请求并将回调发送到它在soap头中接收到的ReplyTo地址,并使用MessageID关联回调。

BPEL流程的deploy.xml文件如下所示.

代码语言:javascript
复制
<?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文件看起来像这样..。

代码语言:javascript
复制
<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>  

现在,当我从碳服务管理控制台测试bpel过程时,我确实收到了对异步web服务的请求。但是,soap信封看起来如下所示,它缺少一个适当的ReplyTo地址来发送回调。

代码语言:javascript
复制
<?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>  

现在我需要用回调来回复这个请求。回调soap信封将包含此MessageID,以便回调与正确的流程实例相关。

如何获得附加到soap头的适当的ReplyTo地址?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-05-03 11:25:26

如果我假设您正确地使用了WSO2 BPS (或与Apache相关的内容),您可以在赋值中使用此副本手动设置标头。(http://ode.apache.org/extensions/headers-handling.html)

代码语言:javascript
复制
<bpel:copy>
  <bpel:from>
   <bpel:literal>
     <wsa:ReplyTo xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <Address>http://localhost:9763/services/SIServerCallback</Address>
     </wsa:ReplyTo>
   </bpel:literal>
 </bpel:from>
 <bpel:to variable="ServiceInvokerIARequest" header="ReplyTo">
 </bpel:to>
</bpel:copy>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15200776

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档