views:

43

answers:

1

I have a .NET2.0 (VB) running in my IIS6 (XP Pro SP2) and a .NET3.5 (configured as .NET2 under IIS's ASP.NET tab, of course) hosting an ASMX web service.

In chrome I can call the ASMX invoke the web methods successfully, however in calling the web methods in code, from the .NET2 website I get:

The request failed with HTTP status 401: Unauthorized.

How do I get around this?

A: 

You need to set the credentials in you application when you initialise the webservice object.

Something like webService.UseDefaultCredentials = true

This will set the credentials of the request to the current user executing the application.

btlog