开发者

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜