Web服务消费者Anypoint Studio(CE运行时):如何传递params?

时间:2016-01-07 18:21:47

标签: web-services soap mule anypoint-studio

我需要在Web服务/ SOAP调用上传递params。

我在Anypoint Studio中使用Web服务消费者(需要在Mule CE上运行 - 社区版),但我收到以下消息:“不支持超过1部分的操作消息”

是否有一个表单可以在Mule CE上调用Web Service / SOAP传递params?

感谢您提供任何帮助/示例!

编辑:

Accord评论,我正在测试一个计算器Web服务,在SoapUI中返回结果OK,但是在mule返回0。

我正在使用Set Payload组件传递params。我在SoapUI上返回“xml request”设置了值。

遵循XML代码。

<ws:consumer-config name="Web_Service_Consumer1" wsdlLocation="http://www.dneonline.com/calculator.asmx?WSDL" service="Calculator" port="CalculatorSoap12" serviceAddress="http://www.dneonline.com/calculator.asmx" doc:name="Web Service Consumer"/>
<flow name="calculadora-soap-publicoFlow">
    <poll doc:name="Poll">
        <set-payload value="&lt;soap:Envelope xmlns:soap=&quot;http://www.w3.org/2003/05/soap-envelope&quot; xmlns:tem=&quot;http://tempuri.org/&quot;&gt; &lt;soap:Header/&gt; &lt;soap:Body&gt; &lt;tem:Add&gt; &lt;tem:intA&gt;3&lt;/tem:intA&gt; &lt;tem:intB&gt;2&lt;/tem:intB&gt; &lt;/tem:Add&gt; &lt;/soap:Body&gt; &lt;/soap:Envelope&gt;" doc:name="Set Payload"/>
    </poll>
    <ws:consumer config-ref="Web_Service_Consumer1" operation="Add" doc:name="Web Service Consumer"/>
    <json:xml-to-json-transformer doc:name="XML to JSON"/>
    <logger level="INFO" doc:name="Logger" message="#[message.payload]"/>
</flow>

哪里可能是问题?谢谢!

1 个答案:

答案 0 :(得分:0)

我发现它是如何工作的。

我们需要传递Web Service Consumer它只是params,不是完整的XML包络。按照Set Payload的值只是params:

  <ns0:Add xmlns:ns0="http://tempuri.org/">
     <ns0:intA>1</ns0:intA>
     <ns0:intB>3</ns0:intB>
  </ns0:Add>
相关问题