WCF web service error
i give an error when connect my wcf service,
The content type text/html of the response message does not match the content type of the binding (application/soap+xml; charset=utf-8)
My wcf service config file below this:
<?xml version="1.0"?>
<configuration>
<customErrors mode="Off">
</customErrors>
<system.serviceModel>
<services>
<service name="WcfService1.Service1" behaviorConfiguration="WcfService1.Service1Behavior">
<!-- Service Endpoints -->
<endpoint address="http://127.0.0.1/ChickenService/Service1.svc" binding="basicHttpBinding" contract="WcfService1.IService1">
<identity>
<dns value="127.0.0.1"/>
</identity>
</endpoint>
<host>
<baseAddresses>
<add baseAddress="http://127.0.0.1/"/>
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="WcfService1.Service1Behavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
How can i solve this problem?
如果你对这篇文章有疑问,欢迎到本站 社区 发帖提问或使用手Q扫描下方二维码加群参与讨论,获取更多帮助。

评论(2)

It sounds like you are getting an ASP.NET Error Page (a.k.a "The Yellow Screen Of Death") when invoking your WCF service, which would explain why the response's MIME type is text/html.
Are you hosting your service in IIS?
After you have enabled exception details like Andrew suggested, you can copy the contents of the exception message you get back from the service, which will be a long HTML string, paste it in a new text file, save it as .HTML and open it in a web browser to look at the error details.
发布评论
需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。