当我启动新的HttpBasicBinding到尚未启动的Web服务时,因为应用程序池未启动将导致内部服务器错误500.但是当我从浏览器启动Web服务时,服务正在启动
如何在发送新请求之前启动Web服务?
在我的代码下面:
BasicHttpBinding binding = new BasicHttpBinding();
binding.Security.Mode = BasicHttpSecurityMode.TransportCredentialOnly;
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows;
binding.Name = "AXDocumentBinding";
EndpointAddress address = new EndpointAddress(serviceUrl);
AA_DynamicsAXDocuHandlingClient cls = new AA_DynamicsAXDocuHandlingClient(binding, address);
cls.ClientCredentials.Windows.ClientCredential = new NetworkCredential(username, password, domain);
string retVal = cls.loadDocumentStr(AreaId, documentFileName, documentIdentification1, documentIdentification2, documentIdentification3, documentIdentification4, documentIdentification5, documentTable);
提前致谢