title: How can I put an XML mocked payload into a POST request payload sended by a WSO2 ESB send mediator?
body: <p>I am absolutly new in <strong>WSO2 ESB</strong> and at this time I have to achive this first simple task but I really don't know from where start.</p>
  
  <p>I have to perform an <strong>HTTP POST request</strong> towards an external web service. This request should contains a mocked <strong>XML</strong> document as payload (at this time the XML have to be merely mocked so I think that I have to "write" it somewhere or something like this).</p>
  
  <p>So starting by this minimalistic official tutorial:</p>
  
  <p><a href="https://docs.wso2.com/display/ESB500/Sending+a+Simple+Message" rel="nofollow noreferrer">https://docs.wso2.com/display/ESB500/Sending+a+Simple+Message</a></p>
  
  <p>I have done the following operation:</p>
  
  <p>1) I have created a new <strong>ESB Solution Project</strong>.</p>
  
  <p>2) On the "main" project named <strong>SampleServices</strong> (at this time I am using the same name of the tutorial) I have registered the <strong>endpoint</strong> to my external web service (<strong>New -> Endpoint</strong>).</p>
  
  <p>3) Then on this project I have add a new <strong>RESP API</strong> (<strong>New -> REST API</strong>). Differently from the tutorial I have enable <strong>POST</strong> request instead of <strong>GET</strong> into the <strong>API Resource properties</strong> because I need to send a <strong>POST</strong> request containing a payload instead the tutorial <strong>GET</strong> request. This is my settings:</p>
  
  <p><a href="https://i.stack.imgur.com/5gzqR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5gzqR.png" alt="enter image description here"></a></p>
  
  <p>4) Then, as done in the tutorial, I have setted the <strong>send mediator</strong> and on this mediator I have setted the <strong>defined endpoint</strong> pointing at my external web service that have to handle the <strong>POST</strong> request and retrieve its payload.</p>
  
  <p>Ok, now my problem is: how can I put a mocked XML document into the body of my <strong>POST</strong> request sended by my *send mediator**?</p>
  
  <p>Reading this second tutorial:
  <a href="https://docs.wso2.com/display/ESB500/Routing+Requests+Based+on+Message+Content" rel="nofollow noreferrer">https://docs.wso2.com/display/ESB500/Routing+Requests+Based+on+Message+Content</a></p>
  
  <p>I know that I can pass the request payload from outside, for example in this second tutorial perform this <strong>CURL</strong> call that starts the <strong>ESB</strong> "process":</p>
  
  <pre><code>curl -v -X POST --data @request.json http://localhost:8280/healthcare/categories/surgery/reserve --header "Content-Type:application/json"
  </code></pre>
  
  <p>This do a call that pass a <strong>JSON</strong> as payload. In the previous example works fine but it is not good for me.</p>
  
  <p>I have to mock the <strong>XML</strong> document payload inside my <strong>ESB</strong> API flow and not take from an external request performed by CURL because in a second implementationstep it will not be mocked but il will come from a previous step in the chain.</p>
  
  <p>So I need a flow like this:</p>
  
  <p><a href="https://i.stack.imgur.com/ARUhk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ARUhk.png" alt="enter image description here"></a></p>
  
  <p>When my <strong>API</strong> is called it perform a <strong>POST</strong> request that send a mocked <strong>XML payload</strong>. Maybe it is have to be putted into the <strong>send mediator</strong> but I don't know...</p>
  
  <p>How can I put this XML in the payload of the requeste sended by the <strong>send mediator</strong>? Where have I to define\write it?</p>