代码改变世界

WebService 访问代理及安全性验证设置

2008-11-06 08:52  Vincent.C  阅读(285)  评论(0编辑  收藏  举报
  1.             ERPWS.ErpInterface ws = new ERPWS_Demo.ERPWS.ErpInterface();
  2.             //Local Network Proxy Settings
  3.             ws.Proxy = new System.Net.WebProxy("172.31.170.21:8089"true);
  4.             ws.Proxy.Credentials = new System.Net.NetworkCredential("username""password""doamin");
  5.             //Server Credential Settings
  6.             CredentialCache cache = new CredentialCache();
  7.             cache.Add(new Uri(ws.Url), "Negotiate"new NetworkCredential("username""password""doamin"));
  8.             ws.Credentials = cache;