RE: Trying to pass NetworkCredential to WebService



Hello Marshall,

Did your Web service use Windows integrated authentication and disable
anonymous access? For such a web service, we need to pass a valid
credential to it. for example:

localhost.Service1 myProxy = new localhost.Service1();
myProxy.Credentials = System.Net.CredentialCache.DefaultCredentials;

or

localhost.Service1 myProxy = new localhost.Service1();
myProxy.Credentials = new System.Net.NetworkCredential("domain\username",
"password", "");

for details, you can refer to:

http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q813834

Luke


.



Relevant Pages

  • Re: Error calling web service
    ... Make sure your settings on the Web service host virtual directory are ... In Directory Security check "Anonymous Access" and make sure you ... > Dim ws As New localhost.StaffWS ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: Error calling web service
    ... Make sure your settings on the Web service host virtual directory are ... In Directory Security check "Anonymous Access" and make sure you ... > Dim ws As New localhost.StaffWS ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • Re: how to add "Authorization: Basic" for a web service call
    ... accept anonymous access (If it does, the client application never sends the ... you have to use the following code to add the username and password ... // Let Web Service know about your credentials. ... header but I can't find a way to add it. ...
    (microsoft.public.dotnet.framework.webservices)
  • Securing a web service
    ... We are developing a web service that connects to an external LDAP server to ... MachineKey store) to run under anonymous access. ... tried creating a local-machine account, ... SSL, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Securing a web service
    ... We are developing a web service that connects to an external LDAP server to ... MachineKey store) to run under anonymous access. ... tried creating a local-machine account, ... SSL, ...
    (microsoft.public.dotnet.framework.aspnet.security)

Loading