Skip to content

Instantly share code, notes, and snippets.

@jdeoliveira
Created July 1, 2012 02:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdeoliveira/3026562 to your computer and use it in GitHub Desktop.
Save jdeoliveira/3026562 to your computer and use it in GitHub Desktop.
WCFConsumer mule application configuration
<flow name="wcfconsumerFlow1" doc:name="wcfconsumerFlow1">
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" path="submitOrder" doc:name="HTTP"/>
<response>
<object-to-string-transformer doc:name="Object to String"/>
</response>
<http:body-to-parameter-map-transformer doc:name="Body to Parameter Map"/>
<choice doc:name="Choice">
<when expression="#[Integer.parseInt(payload['qty']) &lt; 100]">
<processor-chain>
<scripting:component doc:name="Groovy">
<scripting:script engine="Groovy">
<scripting:text>
<![CDATA[
import com.mulesoft.wcfconsumer.*;
ObjectFactory of = new ObjectFactory();
Order o = of.createOrder();
o.setProductId(of.createOrderProductId(payload['productCode']));
o.setQuantity(of.createOrderQuantity(payload['qty']));
return o;
]]>
</scripting:text>
</scripting:script>
</scripting:component>
<cxf:jaxws-client operation="CreateOrder" serviceClass="com.mulesoft.wcfconsumer.IWCFRetailService" enableMuleSoapHeaders="true" doc:name="SOAP"/>
<http:outbound-endpoint exchange-pattern="request-response" host="localhost" port="49676" path="WCFRetailService.svc" doc:name="HTTP"/>
</processor-chain>
</when>
<otherwise>
<processor-chain>
<mulexml:object-to-xml-transformer doc:name="Object to XML"/>
<file:outbound-endpoint path="src/test/resources" responseTimeout="10000" doc:name="File"/>
</processor-chain>
</otherwise>
</choice>
</flow>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment