我试图访问一个Web服务在我的.NET aplication,但web服务需要的凭据。 我如何添加SOAP头在.net中? web服务的NO-.net web服务。
I am trying to access to a webservice in my .net aplication, but the webservice needs credentials. how can i add the soap header in .net? the webservice in a NO-.net webservice.
可以做这样的事?
using (var service = new YourWebService())
{
service.PreAuthenticate = true;
service.UseDefaultCredentials = false;
service.Credentials = new NetworkCredential(UserName, Password);
var response = service.SomeMethod();
}