I'm pretty new to Mule so this may be a silly question. I'd like to call a remote axis2 SOAP service from Mule and for this I will use the SOAP component. What I am struggling with is the correct pattern for PAYLOAD population. Here is a very simple payload example
<oper:CreateTask xmlns:oper="http://api.abc.com/workflow/operationtypes">
<workType>
<Name>Reminder Task</Name>
</workType>
<activitySubject>
<GenericSubject>Richard Fanning</GenericSubject>
</activitySubject>
<description>This is a Mule generated Reminder Task</description>
</oper:CreateTask>
The payload is currently being populated via the set-payload transformer and the XML is embedded in the flow as seen below
<flow name="createWorkflowTask" doc:name="createWorkflowTask">
<set-payload value="<oper:CreateTask xmlns:oper="http://api.abc.com/workflow/operationtypes"><workType><Name>Reminder Task</Name></workType><activitySubject><GenericSubject>Richard Fanning</GenericSubject></activitySubject><description>This is a Mule generated Reminder Task</description></oper:CreateTask>" doc:name="Set Payload"/>
<cxf:proxy-client doc:name="SOAP" enableMuleSoapHeaders="true" payload="body"/>
<http:outbound-endpoint exchange-pattern="one-way" method="POST" address="http://localhost:6081/workflow/services/ActivityServices" doc:name="HTTP"/>
</flow>
My question is what the most appropriate way of setting this payload. My thoughts would be
- if the PAYLOAD were larger would it be better to maintain this XML in a file in the Mule project and read it as outlined in this question
- I'd prefer not to generate client stub classes for the Request but perhaps I should use CXF to define the service class. What advantages would this provide?
Are there other preferred methods of payload population. In my use case this (sub)flow would be called from a router so I'd not be passing any relevant information that would alter the message.
Aside: Perhaps for the worktype name "Reminder Task" I should extract to mule-app.properties and use XSLT to populate in final request?
Thanks
Rich