.NET/C#调用webservice的坑

  1. 服务引用和Web服务引用是有区别的: 如果他的Service为 WCF Service  那得添加服务引用 , 如果是普通的WebServices  就添加 Web服务引用。 
  2. 如果你的webservice调用是写在dll里面的, 那么应该把dllname.dll.config改名为exename.exe.config, 才能读到配置文件里面的webservice地址,否则要自己通过代码去指定.
  3. 身份验证:             SI_QST2SAP_IT182_SNDService client = new SI_QST2SAP_IT182_SNDService();
                client.Credentials = new NetworkCredential("WSUSER", "WSPASS");


猜你喜欢

转载自blog.csdn.net/shixueli/article/details/77460800