title: Why can I access a WSDL file from a browser, but not from application?
body: <p>We've having trouble deploying a web service that works in our development environment, but not in production.  Part of the problem is that our production servers are load-balanced, so to upgrade one of the servers, we have to take it out of the load-balance and try to test the sever in isolation, which is a challenge.</p>
  <p>The computer I'm working on is called <code>Web01</code> and the computer I'm using to test is called <code>Ts01</code>.  On both machines, I've modified the hosts file to redirect <code>example.com</code> to the appropriate IP of the web site on <code>Web01</code>.</p>
  <p>I'm testing two ways of accessing the web service on each machine:</p>
  <ul>
  <li>A simple browser call to <code>http://www.example.com/services/myservice.asmx?WSDL</code>.</li>
  <li>A VB6 test app that calls the web service using the WSDL referenced above via <code>SOAPClient</code>.</li>
  </ul>
  <p>Here are the results of the test:</p>
  <pre>
                     Browser              VB6 App
      Ts01             OK                   OK
      Web01            OK                  ERROR
  </pre>
  <p>The test seems to work OK for every situation except the VB6 app installed on the web server.  The Error I get back is :</p>
  <blockquote>
  <p>-2147024809 - WSDLReader:Loading of the WSDL file failed HRESULT=0x80070057 - WSDLReader:XML Parser failed at linenumber 0, lineposition 0, reason is: The system cannot locate the object specified.</p>
  <p>HRESULT=0x1</p>
  </blockquote>
  <p>I get the same error back on <code>Ts01</code> if I supply a bad WSDL address in the VB6 app.  It seems as if the VB6 application on <code>Web01</code> can't access the web service dll on <code>Web01</code>, which is a big problem.</p>
  <p>It may be worth noting that it works on my local developer machine as well, where I have the VB6 app and the web service installed on the same machine.</p>
  <p>Why might the VB6 app be having trouble communicating with the web service via <code>SOAPClient</code> when run from the same box that the web service exists?</p>
  <hr />
  <p>I used fiddler to inspect the headers of the requests on my local machine calling our dev server.  Here's the difference between the browser and SOAPclient requests:</p>
  <p>Browser:</p>
  <pre><code>GET http://devserver/services/myservice.asmx?WSDL HTTP/1.1
  Accept: image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/xaml+xml, application/vnd.ms-xpsdocument, application/x-ms-xbap, application/x-ms-application, application/x-shockwave-flash, */*
  Accept-Language: en-us
  User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.0.3705; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)
  Accept-Encoding: gzip, deflate
  Connection: Keep-Alive
  Host: devserver
  Cookie: SIFR-PREFETCHED=true
  </code></pre>
  <p>SOAPClient (from VB6 App):</p>
  <pre><code>GET http://devserver/services/myservice.asmx?WSDL HTTP/1.1
  Accept: */*
  Accept-Encoding: gzip, deflate
  User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.0.3705; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)
  Host: hbhswebnet
  Connection: Keep-Alive
  Pragma: no-cache
  </code></pre>
  <p>I'm not sure if that information is helpful, but perhaps it is.</p>