我正在尝试使用Web服务连接器在mule studio中配置流。端点期望的SOAP主体看起来像:
<soapenv:Body>
<v4:readFields>
<filter>
<type>?</type>
<id>?</id>
<name>
<operator>?</operator>
<value>?</value>
</name>
</filter>
<pageNumber>?</pageNumber>
</v4:readFields>
</soapenv:Body>
<filter>
节点本身是必需的,但内容是可选的,所以我想让我的流程发送一个像:
<soapenv:Body>
<v4:readFields>
<filter />
<pageNumber>1</pageNumber>
</v4:readFields>
</soapenv:Body>
有没有办法设置消息有效负载来发送此请求?
运行Anypoint Studio 5.1.0,Mule ESB 3.6 我目前的流量配置:
<flow name="GetFieldInfo">
<http:listener config-ref="localhost" path="/fields" doc:name="HTTP"/>
<enricher source="#[payload]" target="#[flowVars.sessionId]" doc:name="GetSessionId">
<flow-ref name="GetSessionId" doc:name="Login"/>
</enricher>
<data-mapper:transform config-ref="Xml_loginResponse__To_Xml_sessionHeader_" input-ref="#[flowVars["sessionId"]]" target="#[message.outboundProperties["soap.sessionHeader"]]" doc:name="Set Session Header"/>
<ws:consumer config-ref="BrontoAPI" operation="readFields" doc:name="Web Service Consumer"/>
<echo-component doc:name="Echo"/>
</flow>
答案 0 :(得分:0)
您可以使用mule parse模板发送带有可变数据的静态xml
示例:
<soapenv:Body>
<v4:readFields>
<filter />
<pageNumber>#[payload]</pageNumber>
</v4:readFields>
</soapenv:Body>
您可以在https://developer.mulesoft.com/docs/display/current/Parse+Template+Reference
找到相关文档