【发布时间】:2015-03-07 09:16:43
【问题描述】:
我正在尝试在需要身份验证的控制台应用程序中使用 SAP Web 服务。我将服务引用添加到控制台应用程序。
ServiceReference1.SAPServiceSoapClient myService = new ServiceReference1.SAPServiceSoapClient();
System.Net.CredentialCache myCredentials = new System.Net.CredentialCache();
NetworkCredential netCred = new NetworkCredential("UserName", "Password");
Uri uriPrefix = new Uri("url");
myCredentials.Add(uriPrefix, "Basic", netCred);
//The following line is giving error that ClientCredentials cannot be assigned as it is read only.
myService.ClientCredentials = myCredentials;
【问题讨论】:
标签: asp.net web-services soap asp.net-web-api asmx