1
我有以下配置的WCF服務:ChannelFactory.EndPoint上的Address屬性爲null。端點必須有一個有效的地址
<service behaviorConfiguration="LoginService.LoginBehavior" name="AuthenticationServices.Login">
<endpoint address="" behaviorConfiguration="web" binding="webHttpBinding"
bindingConfiguration="WebHttpEndpointBinding"
contract="AuthenticationServices.ILoginService">
<identity>
爲了測試我創建了消耗它的控制檯應用程序的服務。
static void Main(string[] args)
{
LoginService.LoginServiceClient client = new WCFDriver.LoginService.LoginServiceClient();
client.ValidateUserID();
}
現在,當我打電話從控制檯應用程序的服務,它拋出以下錯誤:
Unhandled Exception: System.InvalidOperationException: The Address property on C
hannelFactory.Endpoint was null. The ChannelFactory's Endpoint must have a vali
d Address specified.
at System.ServiceModel.ChannelFactory.CreateEndpointAddress(ServiceEndpoint e
ndpoint)
at System.ServiceModel.ChannelFactory`1.CreateChannel()