我创建了一个简单的WCF库,并在一个具有BasicHttpBinding端点的控制台应用程序中托管该服务。
当控制台主机正在运行时。我尝试在IE9 /Firefox中打开该服务.....http://localhost:8080/EService/basic。在IE9中,它会显示错误,而在Firefox中,它不会显示任何内容。
我以管理员身份运行VS 2010
我附加了代码https://rapidshare.com/files/3306100109/ChatSolution.rar
发布于 2012-01-26 18:47:52
问题是您在EvalServiceLibarary和ConsoleChat应用程序中的两个位置定义了您的服务端点。
从服务库中删除ServiceModel部分,只在您的ConsoleChat应用程序中使用它。我在你的控制台应用程序中尝试了下面的配置,它起作用了:
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="Metadata">
<serviceMetadata httpGetEnabled="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<wsHttpBinding>
<binding name="NoSecurityPlusRM">
<reliableSession enabled="true" />
<security mode="None" />
</binding>
</wsHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="Metadata" name="EvalServiceLibrary.EvalService">
<endpoint address="basic" binding="basicHttpBinding"
contract="EvalServiceLibrary.IEvalService" />
<endpoint address="ws" binding="wsHttpBinding"
bindingConfiguration="NoSecurityPlusRM" contract="EvalServiceLibrary.IEvalService" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8080/evals"/>
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>现在,只需从浏览器浏览到http://localhost:8080/evals,您就可以看到服务页面。
https://stackoverflow.com/questions/9008226
复制相似问题