【发布时间】:2011-05-24 06:27:54
【问题描述】:
我在本地创建并测试了 WCF 服务,当然它工作正常。我发布到一个共享托管站点并浏览到 wsdl,看起来还不错。但是,当我在 WP7 代码中调用该服务时,我收到一条错误消息并显示无用的错误消息。启用 includeExceptionDetailInFaults 和 WCF 跟踪错误读取后。 “System.ServiceModel.ProtocolException:内容类型 application/soap+xml;charset=utf-8 已发送到需要 text/xml 的服务;charset=utf-8。客户端和服务绑定可能不匹配。”
这里是 web.config 的一部分...
<behaviors>
<serviceBehaviors>
<behavior name="SL_SeeYaThere_WCF.Web.SeeYaThereWCFBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug httpHelpPageEnabled ="true" includeExceptionDetailInFaults="true" />
</behavior>
<!—- other services… -->
</serviceBehaviors>
</behaviors>
<bindings>
<basicHttpBinding>
<!—- there is not a binding for this service should there be? -->
<!—- other services… -->
</basicHttpBinding>
</bindings>
服务>
服务>
^^ 申请格式。编辑器无法正确显示标记。
这是我第一次使用 WFC,但并不愉快。我做错了什么?
感谢您的帮助。
【问题讨论】:
标签: wcf-binding