[英]Allow BasicHttpBinding to process custom content types
I have a client that does send Soap11 content, but with a different content type. 我有一个确实发送Soap11内容但具有不同内容类型的客户端。 It does not send
text/xml
but application/some-custom-header
. 它不发送
text/xml
而是发送application/some-custom-header
。
The client receives the following exception Cannot process the message because the content type 'application/some-custom-header; charset=utf-8'
客户端收到以下异常,因为内容类型为
'application/some-custom-header; charset=utf-8'
无法处理消息'application/some-custom-header; charset=utf-8'
'application/some-custom-header; charset=utf-8'
was not the expected type 'text/xml; charset=utf-8'
'application/some-custom-header; charset=utf-8'
不是预期的类型'text/xml; charset=utf-8'
'text/xml; charset=utf-8'
. 'text/xml; charset=utf-8'
。
what do i need to change? 我需要改变什么?
I got it. 我知道了。 I combined the encoding elements from the Invoking a web service returning ISO-8859-1 encoded data with BizTalk 2010 example, but replaced the
Read/WriteMessage
methods from the CustomMessageEncoder
with the calls to a MessageEncoder
retrieved from a TextMessageEncodingBindingElement
and its MessageEncoderFactory
. 我将调用ISO返回的ISO-8859-1编码的Web服务的Web服务中的编码元素与BizTalk 2010示例结合在一起 ,但是用从
TextMessageEncodingBindingElement
及其MessageEncoderFactory
检索到的MessageEncoder
的调用替换了CustomMessageEncoder
的Read/WriteMessage
方法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.