title: Avoid intermediate data conversion between RPC (SOAP) APIs?
body: <p><img src="https://i.stack.imgur.com/kmruf.png" alt="enter image description here"></p>
  
  <p>Lets assume I develop two services called <strong>ProductAPI</strong> and <strong>OrderAPI</strong>.Both of them uses a <strong>Common Domain Model</strong> (common Entity hierarchy).</p>
  
  <p>Both of the services are finally exposed as RCP (SOAP or REST).
  The OrderAPI internally invokes ProductAPI.</p>
  
  <p><strong><em>In the case of the REST:</em></strong></p>
  
  <p>We can develop ProductAPI using JAX-RS and we can implement a "ProductAPI REST Client" to be used within OrderAPI to access ProductAPI.</p>
  
  <p>This client can use the same class heirachy to deserialize the JSON into the same classes used in ProductAPI.</p>
  
  <p>So,no indermediate format convertion.</p>
  
  <p><strong><em>In the case of SOAP:</em></strong></p>
  
  <p>We develop the ProductAPI using  JAX-WS (or Axis2..etc) and expose the service in WSDL.
  In this case, we have to implement a "ProductAPI SOAP Client" using the exposed WSDL.(may be using a stub generation tool using the exposed WSDL).</p>
  
  <p>In this came the generated Classes are generated from the XSD definition in WSDL and we have to do additional format conversion if we want to use the same Common Domain Model classes.</p>
  
  <p>My questions:</p>
  
  <p>1) In the case of SOAP is there a way to skip this format conversion ?</p>
  
  <p>2) In an enterprise application (like eCommerce) , is it a good practice to avoid this kind of middle data conversions for performance?</p>