Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/security/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Soap Mule ESB Web服务映射_Soap_Cxf_Transform_Mule_Forward - Fatal编程技术网

Soap Mule ESB Web服务映射

Soap Mule ESB Web服务映射,soap,cxf,transform,mule,forward,Soap,Cxf,Transform,Mule,Forward,我是一个尝试在Mule中实现简单web服务映射的新手 基本上,流应该接收一个Soap请求(“ExampleWS1”),将其打包到一个bean,将这个bean映射到另一个bean,然后将其发送到另一个服务。作为回报,应该执行相同的映射过程,直到Soap响应返回给调用方 通过一个技巧,我可以以对象(“CriteriaWS1”)的形式转发请求,在返回响应对象(“PersonWS1”)之前一切都正常,但我得到了以下例外: com.acme.example.ws1.beans.PersonWS1不能强制转

我是一个尝试在Mule中实现简单web服务映射的新手

基本上,流应该接收一个Soap请求(“ExampleWS1”),将其打包到一个bean,将这个bean映射到另一个bean,然后将其发送到另一个服务。作为回报,应该执行相同的映射过程,直到Soap响应返回给调用方

通过一个技巧,我可以以对象(“CriteriaWS1”)的形式转发请求,在返回响应对象(“PersonWS1”)之前一切都正常,但我得到了以下例外:

com.acme.example.ws1.beans.PersonWS1不能强制转换为com.acme.example.ws1.beans.CriteriaWS1

诀窍是用这个契约发布ExampleWS1,允许它转发Criteria1,但我想现在这是阻止响应:

公共准则WS1搜索(@webgram(name=“criteria”)准则WS1准则)

我想这个服务应该返回PersonWS1,但是如何转发对象CriteriaWS1呢? 我尝试了以下每种线性组合:cxf:代理服务、模式:web代理服务、转换器引用、响应转换器引用。。。但不可能。 也许我必须使用Mule API从内部搜索(-)方法执行类似的操作:

这是我使用的配置。我正在Mule IDE下使用Mule 3.2.1

如有任何帮助,我们将不胜感激,敬请提前感谢

加布里埃尔

<flow name="Demo_WS_2_WS_RequestReply_1">
    <inbound-endpoint address="http://localhost:4006/services/ExampleWS1" exchange-pattern="request-response" />
    <cxf:jaxws-service serviceClass="com.acme.example.ws1.ExampleWS1"/>
    <component>
        <singleton-object class="com.acme.example.ws1.ExampleWS1" />
    </component>
    <custom-transformer name="WS1WS2TransformerIn" class="com.acme.example.WS1WS2TransformerLegacy"/> 

    <vm:outbound-endpoint exchange-pattern="request-response" path="vm1_acq" responseTimeout="1000" />
    <custom-transformer name="WS2WS1TransformerOut" class="com.acme.example.WS2WS1TransformerLegacy"/> 
</flow>
<flow name="Demo_WS_2_WS_RequestReply_2">
    <vm:inbound-endpoint exchange-pattern="request-response" path="vm1_acq" responseTimeout="1000" />
    <cxf:jaxws-client 
             clientClass="com.acme.example.ws2.ExampleWS2Service" 
             port="ExampleWS2Port"
             wsdlLocation="classpath:ExampleWS2.wsdl" 
             operation="search"/>
    <outbound-endpoint exchange-pattern="request-response" address="http://localhost:4003/services/ExampleWS2"/>
</flow>

2) 声明web方法以返回一个“对象”,然后像上面的示例一样链接请求,但注释方法以允许JABX以正确的方式绑定响应:


@WebResult(name=“personWS1”)


我希望我能帮上忙,但只要看一下配置就很难了。哪个组件正在引发您遇到的类强制转换异常?为什么WS2WS1TransformerRout不能通过构建例外对象类型来纠正这种情况?还请记住,cxf元素在消息属性中添加了上下文数据:您可能在不知不觉中弄乱了它。最后:我个人会选择合成而不是链接,即让com.acme.example.ws1.ExampleWS1与MuleClient一起调用vm://vm1\u acq。非常感谢David。现在这两种解决方案都可以工作了,让我公开它们,因为它们可能对某些人有用:1)在CXF将请求解组后,使用web服务类中的MuleClient转发请求2)声明web方法以返回“对象”,然后链接请求,如上面的示例所示,但是注释方法让JABX以正确的方式绑定响应再次感谢您宝贵的帮助。加布里埃尔
<flow name="Demo_WS_2_WS_RequestReply_1">
    <inbound-endpoint address="http://localhost:4006/services/ExampleWS1" exchange-pattern="request-response" />
    <cxf:jaxws-service serviceClass="com.acme.example.ws1.ExampleWS1"/>
    <component>
        <singleton-object class="com.acme.example.ws1.ExampleWS1" />
    </component>
    <custom-transformer name="WS1WS2TransformerIn" class="com.acme.example.WS1WS2TransformerLegacy"/> 

    <vm:outbound-endpoint exchange-pattern="request-response" path="vm1_acq" responseTimeout="1000" />
    <custom-transformer name="WS2WS1TransformerOut" class="com.acme.example.WS2WS1TransformerLegacy"/> 
</flow>
<flow name="Demo_WS_2_WS_RequestReply_2">
    <vm:inbound-endpoint exchange-pattern="request-response" path="vm1_acq" responseTimeout="1000" />
    <cxf:jaxws-client 
             clientClass="com.acme.example.ws2.ExampleWS2Service" 
             port="ExampleWS2Port"
             wsdlLocation="classpath:ExampleWS2.wsdl" 
             operation="search"/>
    <outbound-endpoint exchange-pattern="request-response" address="http://localhost:4003/services/ExampleWS2"/>
</flow>
public PersonWS1 search(@WebParam(name="criteria") CriteriaWS1 criteria) {
    ...
        MuleMessage resultMessage = muleContext.getClient().process("vm://VM_FROM_INBOUND", MessageExchangePattern.REQUEST_RESPONSE, new DefaultMuleMessage(criteria, muleContext));
        result = (PersonWS1)resultMessage.getPayload();
    ...
    return result;
}
public Object search(@WebParam(name = "criteria") CriteriaWS1 criteria) {
    return criteria;
}