开发者

Add soap header to a webservice in .net

开发者 https://www.devze.com 2023-03-05 00:22 出处:网络
I am trying to access to a webservice in my .net aplication, but 开发者_JS百科the webservice needs credentials.

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();
}
0

精彩评论

暂无评论...
验证码 换一张
取 消