title: How to develop REST and SOAP interface for same web service using MuleSoft?
body: <p>Right now some services are exposed using REST while some using SOAP. There are more than 2000 services. The requirement is to expose all these in SOAP 1.2 and REST API (yes both).</p>
  
  <p>I was wondering if I can take build something on an integration layer (preferable Mulesoft) to do this. The integration layer will call the services and then expose/convert "REST as SOAP" and "SOAP as REST"</p>
  
  <p><img src="https://i.stack.imgur.com/6021d.png" alt="Flow of call"></p>
  
  <ol>
  <li>Client makes a SOAP call to MuleSoft</li>
  <li>Mulesoft makes REST call to the actual service</li>
  <li>Mulesoft receives the REST response</li>
  <li>Mulesoft uses the above response and send it back to client as a SOAP response</li>
  </ol>
  
  <p>How may I achieve the above flow in MuleSoft? An algorithm would be very very helpful.</p>
  
  <p>Thanks in advance.</p>
  
  <p>For example: changeName(string id, string newName)
  Should be called from SOAP as:</p>
  
  <pre><code>&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:enterprise.soap.sforce.com"&gt;
     &lt;soapenv:Header&gt;
      &lt;/soapenv:Header&gt;
     &lt;soapenv:Body&gt;
        &lt;urn:changeName&gt;
           &lt;urn:id&gt;1001&lt;/urn:id&gt;
           &lt;urn:newName&gt;Steve Jobs&lt;/urn:newName&gt;
        &lt;/urn:changeName&gt;
     &lt;/soapenv:Body&gt;
  &lt;/soapenv:Envelope&gt;
  </code></pre>
  
  <p>AND also form REST, for example</p>
  
  <pre><code>http://www.mywebserviceurl/changeName/
  POST 
  {id:1001, name:Steve Jobs}
  </code></pre>