提问人:h.z. 提问时间:3/26/2023 最后编辑:Lex Lih.z. 更新时间:3/28/2023 访问量:907
内容类型为 text/html;响应消息的 charset=utf-8 与关联的内容类型不匹配 (text/xml; charset=utf-8)
The content type is text/html; charset=utf-8 of the response message does not match the content type of the association (text/xml; charset=utf-8)
问:
我在 IIS 和 Visual Studio - asp 项目中使用, 我收到此错误:
System.ServiceModel.ProtocolException HResult=0x80131501 Message=内容类型为 text/html;响应消息的 charset=utf-8 与关联的内容类型 (text/xml; charset=utf-8) 不匹配。如果使用的是自定义编码器,请确保正确实现 IsContentTypeSupported 服务操作。响应的前 1024 个字节是:...
这是我的web.config:
<basicHttpBinding>
<binding name="BasicHttpBinding_ICRMAppsDataProvider" maxReceivedMessageSize="2147483646" />
<binding name="DataServiceSoap" />
<binding name="BasicHttpBinding_IService1" closeTimeout="00:05:00"
openTimeout="00:05:00" receiveTimeout="00:10:00" sendTimeout="00:25:00"
allowCookies="false" bypassProxyOnLocal="false" maxBufferPoolSize="2147483646"
maxReceivedMessageSize="2147483646" useDefaultWebProxy="true" textEncoding="utf-8">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows" />
</security>
</binding>
</basicHttpBinding>
和这个服务器 web.config:
<services>
<service behaviorConfiguration="ManagementServiceBehaviour" name="AService.Service1">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="basicHttpBinding" contract="AService.IService1" />
</service>
<service behaviorConfiguration="webHttpBehavior" name="AService.RestfulService">
<endpoint address="" behaviorConfiguration="webHttpBehavior" binding="webHttpBinding" bindingConfiguration="webBindingHttp" name="webBinding" bindingName="webBindingHttp" contract="AService.IRestfulService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<bindings>
<basicHttpBinding>
<binding name="basicHttpBinding" maxReceivedMessageSize="2147483647" closeTimeout="00:25:00" openTimeout="00:25:00" receiveTimeout="00:25:00" sendTimeout="00:25:00" textEncoding="utf-8">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows" realm="" />
<message clientCredentialType="UserName" />
</security>
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
</binding>
</basicHttpBinding>
<webHttpBinding>
<binding name="webBindingHttp" closeTimeout="00:25:00" openTimeout="00:25:00" receiveTimeout="00:25:00" sendTimeout="00:25:00">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows" realm="" />
</security>
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
</binding>
</webHttpBinding>
</bindings>
我的错误是什么???
答:
评论