C# 更改WCF终结点
我创建了一个包含两个项目的解决方案Asp.net网站和一个服务。我试图向站点项目添加服务引用,但VS引发了一个错误C# 更改WCF终结点,c#,asp.net,web-services,wcf,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 ret
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
所以。有趣的是,如果我在没有结果的情况下更改服务的端点配置。消息是一样的
soap 1.1是
'文本/xml;字符集=utf-8'
据我所知,服务器无论如何都需要SOAP1.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,为什么服务要求文本/xml?或者可能是我的配置错误?配置中没有地址吗?所以。现在我添加了address=,同样的结果…您如何调用该服务?你试过使用普通的basicHttpBinding吗?我现在不叫它。我只是想在VS.About basicHttpBinding中将服务添加到引用中。是的,我有。如果浏览到,你会得到什么?