Add soap header to a webservice in .net
I am trying to access to a webservice in my .net aplication, but 开发者_JS百科the webservice needs credentials. how can i add the soap header in .net? the webservice in a NO-.net webservice.
Can you do something like this?
using (var service = new YourWebService())
{
service.PreAuthenticate = true;
service.UseDefaultCredentials = false;
service.Credentials = new NetworkCredential(UserName, Password);
var response = service.SomeMethod();
}
精彩评论