Hi,
we're developing some web services and use the local development server of
Visual Studio 2005 to create, run and debug the project. The web service
methods connect to a database hosted on a dedicated server and the Microsoft
CRM 3.0 server, also on a separate machine. As the CRM server installation
makes changes to the Active Directory, they are located in a separate
domain, while the development machines are member of the companies domain.
There's no trust relationship between these domains. However, authentication
works fine with one problem:
Scenario 1:
The web service is hosted on a remote machine and in VS 2005 we add a web
reference to it, say http://remoteMachine:4444/webservice/service.asmx. When
creating a new instance of the generated web service proxy class, we set the
URL to the location of the web service (which is the same as the web
reference location, thus the default) and the Credentials property to a
valid NetworkCredential. Beside authenticating the user, the web service
further uses this credential to connect to the web services offered by the
CRM server. All of this works fine.
Scenario 2:
The exactly same web service is hosted on the local development machine and
in VS 2005 we add a web reference to it, say
http://localhost:2142/webservice/service.asmx. Beside that reference,
everything else is the same, so we create a new instance of the generated
web service proxy class, set the URL to the location of the web service
(which is http://remoteMachine:4444/webservice/service.asmx, thus different
from the default) and the Credentials property to a valid NetworkCredential.
So our request still goes to the remote machine, but this time each request
fails with 401 Forbidden/Access denied.
This is reproducable. If I change the web service reference back to the
remote machine, the application will work without problems. If I use the
local address, authentication errors will occur in each call to a web
service, though the remote address and network credential do not change.
Any suggestions?
Thanks
Michael