title: WSDL operation and SOAP: how this actually works?
body: <p>I'm trying to figure out how WS SOAP server knows what operation to execute when receiving a SOAP. So, can someone pls clarify the following? </p>
  
  <p>There are number of examples on the web that have something like this:</p>
  
  <pre><code>   &lt;wsdl:operation name="function1"&gt;
        &lt;wsdl:input message="function1Request"/&gt;
        &lt;wsdl:output message="function1Response"/&gt;
        &lt;wsdl:fault message="someFault"/&gt;
      &lt;/wsdl:operation&gt;
  
  &lt;wsdl:operation name="function2"&gt;
        &lt;wsdl:input message="function2Request"/&gt;
        &lt;wsdl:output message="function2Response"/&gt;
        &lt;wsdl:fault message="someFault"/&gt;
      &lt;/wsdl:operation&gt;
  </code></pre>
  
  <p>and then SOAP request for calling the function1 looks like this:</p>
  
  <pre><code>&lt;SOAP-ENV:Envelope
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;
    &lt;SOAP-ENV:Body&gt;
      &lt;m:function1Request xmlns:m="http://namespaces.com"&gt;
       ...
      &lt;/m:function1Request&gt;
    &lt;/SOAP-ENV:Body&gt;
  &lt;/SOAP-ENV:Envelope&gt;
  </code></pre>
  
  <p>So, the operation itself is not sent in the SOAP. It contains just the payload of the request. Then, I presume, the server has to match the request type with the operation definitions from the WSDL in order to find out which operation is actually required to be called. </p>
  
  <p>Ok, this works in case of 1 to 1 relation between the operation and the input parameter type.</p>
  
  <p>But, what if I have 2 operations with the same input type? Something like this:</p>
  
  <pre><code>   &lt;wsdl:operation name="function1"&gt;
        &lt;wsdl:input message="function1Request"/&gt;
        &lt;wsdl:output message="function1Response"/&gt;
        &lt;wsdl:fault message="someFault"/&gt;
      &lt;/wsdl:operation&gt;
  
  &lt;wsdl:operation name="function2"&gt;
        &lt;wsdl:input message="function1Request"/&gt;
        &lt;wsdl:output message="function2Response"/&gt;
        &lt;wsdl:fault message="someFault"/&gt;
      &lt;/wsdl:operation&gt;
  </code></pre>
  
  <p>How will the server know which operation to execute?  </p>