提问人:Osprey1999 提问时间:10/26/2023 更新时间:10/26/2023 访问量:34
无法处理消息,因为内容类型“application/soap+xml;charset=UTF-8”不是预期的类型“application/soap+msbin1+gzip”
Cannot process the message because the content type 'application/soap+xml;charset=UTF-8 was not the expected type 'application/soap+msbin1+gzip'
问:
我正在尝试在 IIS 上托管的 WCF 服务中实现 Gzip 压缩。
以前,绑定配置设置为 --
<customBinding>
<binding name="SOAPBinding">
<textMessageEncoding messageVersion="Soap11WSAddressing10" />
</binding>
</customBinding>
现在为了实现压缩,我将绑定配置更改为 --
<customBinding>
<binding name="SOAPBinding">
<binaryMessageEncoding compressionFormat="GZip" />
</binding>
</customBinding>
进行更改后,每当我尝试获取端点的响应(使用SOAP UI进行测试)时,它都会返回错误响应
Cannot process the message because the content type 'application/soap+xml;charset=UTF-8 was not the expected type 'application/soap+msbin1+gzip'.
使用前面的绑定配置,服务工作正常。一旦我更改了自定义绑定,它就会抛出错误。
预期是,当在请求中发送 Accept-Encoding : gzip 时,一旦启用压缩,服务应返回带有标头 Content-Encoding : gzip 的响应
答: 暂无答案
评论