更改WCF端点

时间:2014-11-11 13:34:11

标签: c# asp.net web-services wcf

我已经创建了一个包含两个项目Asp.net网站和服务的解决方案。我正在尝试向站点项目添加服务引用,但VS发出错误。

Content Type application/soap+xml; charset=utf-8 was not supported by service http://localhost2:53480/FondSerivce.svc.  The client and service bindings may be mismatched.
The remote server returned an error: (415) Cannot process the message because the content type 'application/soap+xml; charset=utf-8' was not the expected type 'text/xml; charset=utf-8'..
If the service is defined in the current solution, try building the solution and adding the service reference again.

stackoweflow拒绝本地主机链接,所以我在这里找到了localhost2。

如此。有趣的是如果我更改服务的端点配置,那么无效。消息是一样的。

肥皂1.1是 “文本/ XML;字符集= UTF-8'

据我所知,服务器在任何方面都需要soap 1.1请求。 以下是服务配置的一部分:

<system.serviceModel>
  <bindings>
    <wsHttpBinding>
      <binding name="configuration_soap12"/> 
    </wsHttpBinding>
  </bindings>
    <services>
      <service name="FondService.FondSvc">
        <endpoint binding="wsHttpBinding" bindingConfiguration="configuration_soap12" contract="FondService.IFondService"/>
    </service>
  </services>
</system.serviceModel>

如果我使用wsHttpBinding,为什么服务要求text/xml?或者可能是我的配置错了?

0 个答案:

没有答案