【发布时间】:2013-10-01 10:11:55
【问题描述】:
我在 VS 2010 中开发了 WCF 服务 (3.5)。通常我可以通过 WCF 测试客户端对其进行测试,并从任何浏览器调用该服务。我在我的 Windows 7 开发机器上,所以一切都是默认的。地址如http://localhost:54538/MyService.svc
但是,当我尝试从第三方客户端(最终是我的目标)调用服务时,客户端根本没有得到任何响应。响应只是空。我还尝试通过 PHP curl 从本地 Apache 网络服务器调用该服务 - 也是一个空响应。
所以我认为配置可能有问题。 服务部分是:
<services>
<service behaviorConfiguration="MyNamespace.Service1Behavior" name="MyNamespace.MyService">
<endpoint address="" binding="wsHttpBinding" contract="MyNamespace.IMyService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
我是否必须添加端点或更改其他任何内容?
【问题讨论】:
-
使用 WCF 测试客户端表示 SOAP 服务,而从任何浏览器调用该服务将表示 REST 服务 (
webHttpBinding)。 ....