Mule WSProxyService抛出异常

时间:2015-11-16 22:05:55

标签: mule

一个几乎开箱即用的例子,[https://docs.mulesoft.com/mule-user-guide/v/3.7/proxying-web-services#wsproxyservice]  抛出以下错误:我错过了什么?

  • 发出SoapUI xml请求时 org.mule.component.ComponentException:导致异常的组件是:DefaultJavaComponent {HttpWebServiceBridge.component.193834439}。消息有效内容的类型为:BufferInputStream

  • 当我发出WSDL get请求时 org.mule.component.ComponentException:导致异常的组件是:DefaultJavaComponent {HttpWebServiceBridge.component.1639543744}。消息有效内容的类型为:NullPayload

<spring:beans>
    <spring:bean name="WSProxyService" class="org.mule.module.cxf.WSProxyService">
        <spring:property name="wsdlFile" value="schema/calculator.wsdl"/>
    </spring:bean>
</spring:beans>

<http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="8081" doc:name="HTTP Listener Configuration"/>
<http:request-config name="HTTP_Request_Configuration" host="http://www.dneonline.com/calculator.asmx" port="80" doc:name="HTTP Request Configuration"/> 

<flow name="HttpWebServiceBridge">
    <http:listener config-ref="HTTP_Listener_Configuration" path="/calc" doc:name="HTTP" />
    <component >
        <spring-object bean="WSProxyService" />
     </component>
    <http:request config-ref="HTTP_Request_Configuration" path="#[message.inboundProperties.'http.listener.path']" method="#[message.inboundProperties.'http.method']" doc:name="HTTP"/>
</flow>

1 个答案:

答案 0 :(得分:1)

看起来示例不起作用 - 请参阅此jira - JIRA

要回答您的问题,请使用以下流程和CXF标记来获取结果。

<http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="8085" doc:name="HTTP Listener Configuration"/>

<http:request-config name="HTTP_Request_Configuration" host="http://www.dneonline.com" port="80" doc:name="HTTP Request Configuration" basePath="calculator.asmx">

    </http:request-config>
    <cxf:configuration name="CXF_Configuration" enableMuleSoapHeaders="false" initializeStaticBusInstance="true" doc:name="CXF Configuration"/> 

<flow name="HttpWebServiceBridge">
    <http:listener config-ref="HTTP_Listener_Configuration" path="/calc" doc:name="HTTP" />
   <cxf:proxy-service wsdlLocation="calculator.wsdl"
   service="Calculator" configuration-ref="CXF_Configuration" doc:name="CXF" namespace="http://tempuri.org/" payload="body" port="CalculatorSoap"/>
    <http:request config-ref="HTTP_Request_Configuration" path="/" method="GET" doc:name="HTTP"/>
</flow>