TipsOnLips.net

Your .net tips and tricks source

About the author

Author Name is someone.
E-mail me Send mail

Recent comments

Authors

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2010


Web Services & WCF Resources

  1. Encrypting SOAP Messages
  2. Using Session State in a Web Service
  3. How Your WCF Service Can Use MSMQ as a Durable Message Store
  4. Windows Communication Foundation: Videos

Tags: , ,
Categories: WCF | Web Services
Posted by developer on Wednesday, April 01, 2009 9:17 AM
Permalink | Comments (0) | Post RSSRSS comment feed

Call a Web service using basic authentication

 To call a Web service using basic authentication us the following;

 

using System.Net;

localhost.MyWebService myService = new localhost.MyWebService();

System.Net.CredentialCache myCredentials = new System.Net.CredentialCache();

NetworkCredential netCred = new NetworkCredential("UserName", "Password");

myCredentials.Add(new Uri(myService.Url), "Basic", netCred);

myService.Credentials = myCredentials;


Categories: ASP.NET | C# | Web Services
Posted by Admin on Thursday, August 16, 2007 7:14 AM
Permalink | Comments (4) | Post RSSRSS comment feed