我已经编写了SOAP ASMX Web服务,并且可以在测试环境(postMan等)下正常工作。 现在,我需要为客户端应用程序打开http端点。我的客户正在使用BasicHttpBinding()方法;
如何更改我的服务web.config文件以接受客户端连接? 我的客户端应用程序具有以下代码。
public static string SubmitApplication(string endpointUrl)
{
var binding = new BasicHttpBinding();
binding.Security.Mode = BasicHttpSecurityMode.Transport;
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Basic;
var endpointAddress = new EndpointAddress(endpointUrl);
var client = new ADNContactSoapClient(binding, endpointAddress);
if (client.ClientCredentials != null)
{
client.ClientCredentials.UserName.UserName = @"domain\AAAA";
client.ClientCredentials.UserName.Password = @"xxx";
}
}