title: "The underlying connection was closed: An unexpected error occurred on a receive." while accessing a web reference
body: <p>I've written a c#/.net program that accesses a Web Reference WSDL made in PHP NuSoap, that accesses a soap method through this call:</p>
  
  <pre><code>public kiosk_wsdl.MEMBER_DATA_RECORD record;
  using (kiosk_wsdl.kiosk webService = new kiosk_wsdl.kiosk())
  {
      kiosk_wsdl.USER user = new kiosk_wsdl.KIOSK_WSDL_USER();
      record = webService.GetMemberDetails("000000000001", user);
  }
  </code></pre>
  
  <p>It works well in my localhost and our development servers, but when I transferred the NuSoap server to the production server, this exception occurs when I make the call:</p>
  
  <pre><code>    The underlying connection was closed: An unexpected error occurred on a receive.
  </code></pre>
  
  <p>with the inner exception:</p>
  
  <pre><code>    System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
  </code></pre>
  
  <p>While in this same production server, the method works well when accessed via a PHP NuSoap Client, so I'm guessing the problem is in my .NET client. </p>
  
  <p>I've googled this problem and some say that it is possible that the server might have a default maximum message size configured to be too small, but how can I modify that in our production server? (and why does it work in our development machines where we have the same NuSoap configuration?) I've tried different solutions but to no avail.</p>