我有一个具有以下配置的 WCF 服务:
<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()