使用非 UTF-8 编码在 BizTalk 进程中托管终结点

Hosting the endpoint in the BizTalk process using non UTF-8 encoding

使用此处详细描述的 WCF 编码存在问题:博客 post WCF: Text Message Encoding and ISO-8859-1 Encoding

我收到类似的响应错误:

A message sent to adapter "WCF-BasicHttp" on send port "XXXX" with URI "http://XXXXXXXX:8080/index.php" is suspended.

Error details: System.ServiceModel.ProtocolException: The content type text/xml; charset=ISO-8859-1 of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly.

我想在 BizTalk 环境中创建一个简单的代理 WS。我使用 WCF-BasicHttp/WCF-Custom(均无效)适配器和发送端口 (SOAP WCF-BasicHttp) 创建了 1 个接收位置。发送端口正在订阅接收位置,如此处所述:

我在此处提到的 BizTalk 进程中创建了端点:Codit 博客 Hosting WCF HTTP receive location inside BizTalk, without using IIS.

我无法设置 UTF-8 以外的其他文本编码,在尝试设置 ISO-8859-1 时出现错误:

"The text encoding ISO-8859-1 used in the text message format is not supported. Parameter name: encoding"

有什么方法可以 运行 在 BizTalk 环境中使用一些自定义编码器吗?

我自己设法做到了。 我从 Receive and Send WCF-Custom adapter

中删除了 textMessageEncoding 绑定

我将 customMessageEncoder 与 soap11 和适当的 iso 编码绑定,而不是它。请注意,httpTransport 应该位于绑定列表的最后。