title: WCF use of SOAP gives error when deserializing response defined in WSDL as empty message
body: <p>I'm very new to WCF and the related technologies. (Using WCF 4.0, by the way.)</p>
  
  <p>Here are some snippets from the WSDL file for a web service that I need to interface with. </p>
  
  <pre><code>  &lt;wsdl:binding name="MPGWCSTAOperations_v1_1SoapBinding" type="impl:MPGWCSTAOperations"&gt;
      &lt;wsdlsoap:binding transport="http://schemas.xmlsoap.org/soap/http" /&gt;
      ...
      &lt;wsdl:operation name="MonitorStartLine"&gt;
        &lt;wsdlsoap:operation soapAction="urn:v1_1.csta.ws.mpgw.gintel.com/MonitorStart" /&gt;
        &lt;wsdl:input name="MonitorStartLineRequest"&gt;
          &lt;wsdlsoap:body use="literal" /&gt;
        &lt;/wsdl:input&gt;
        &lt;wsdl:output name="MonitorStartLineResponse"&gt;
          &lt;wsdlsoap:body use="literal" /&gt;
        &lt;/wsdl:output&gt;
      &lt;/wsdl:operation&gt;
      ...
    &lt;/wsdl:binding&gt;
  
    &lt;wsdl:portType name="MPGWCSTAOperations"&gt;
    ...
      &lt;wsdl:operation name="MonitorStartLine" parameterOrder="monitorStartLine"&gt;
        &lt;wsdl:input name="MonitorStartLineRequest" message="impl:MonitorStartLineRequest" /&gt;
        &lt;wsdl:output name="MonitorStartLineResponse" message="impl:MonitorStartLineResponse" /&gt;
      &lt;/wsdl:operation&gt;
      ....
    &lt;/wsdl:portType&gt;
  
    &lt;wsdl:message name="MonitorStartLineResponse" /&gt;
  </code></pre>
  
  <p>My understanding is that the MonitorStartLine operation is defined to return a response message MonitorStartLineResponse, which is defined to be an empty message.</p>
  
  <p>I've used Visual Studio's Project - Add Service Reference facility to generate C# proxy code for this. </p>
  
  <p>Then I do something like this:</p>
  
  <pre><code>   MPGWCSTAOperationsClient cstaOperationsClient = new MPGWCSTAOperationsClient();
  
     MonitorStartLine monitorStartLine = new MonitorStartLine();
     monitorStartLine.pnis = new string[] {"0000032"};
  
     cstaOperationsClient.MonitorStartLine(monitorStartLine);
  </code></pre>
  
  <p>This results in the following exception:</p>
  
  <pre><code>System.ServiceModel.CommunicationException was unhandled
    HResult=-2146233087
    Message=Error in deserializing body of reply message for operation 'MonitorStartLine'. 
    End element 'Body' from namespace 'http://schemas.xmlsoap.org/soap/envelope/' expected. 
    Found element 'monitorStartLineResponse' from namespace 'urn:v1_1.csta.ws.mpgw.gintel.com'. Line 1, position 296.
    Source=mscorlib
  </code></pre>
  
  <p>Using Fiddler I'm seeing the response as follows:</p>
  
  <pre><code>HTTP/1.1 200 OK
  Server: Apache-Coyote/1.1
  X-Powered-By: Servlet 2.5; JBoss-5.0/JBossWeb-2.1
  Content-Type: text/xml;charset=utf-8
  Transfer-Encoding: chunked
  Date: Wed, 16 Oct 2013 22:01:44 GMT
  
  149
  &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
                    xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
    &lt;soapenv:Body&gt;
      &lt;monitorStartLineResponse xmlns="urn:v1_1.csta.ws.mpgw.gintel.com"/&gt;
    &lt;/soapenv:Body&gt;
  &lt;/soapenv:Envelope&gt;
  </code></pre>
  
  <p>Which looks to me like it conforms to the WSDL. </p>
  
  <p>I'm thinking that I can probably just ignore the error (the server will never be the wiser), but I'd prefer to fix the problem if possible.</p>