首页 > 解决方案 > WSE 3.0 WSE839 异常

问题描述

我想用 WSE 3.0 调用一个 Java-Soap-Service,我使用 WSDL-File 生成了一个代理,但该服务需要 MTOM 来获取它的数据。我也遵循了本教程,它运行良好但没有帮助: http ://twit88.com/blog/2008/05/14/net-mtom-enabled-your-application-using-wse/

我得到的例外是:

System.FormatException: "WSE839: An HTTP response was received that used the following content type: text/xml;charset=UTF-8. The following content type was expected: multipart/related; type=application/xop+xml."

我知道 WSE 3.0 已经过时,如果有其他方法请告诉我。

有人可以帮忙吗?

标签: c#soapmtomwsewse3.0

解决方案


将生成的类基类从 System.Web.Services.Protocols.SoapHttpClientProtocol 更改为 Microsoft.Web.Services3.WebServicesClientProtocol。完成后,您将能够访问名为 RequireMtom 的字段。在调用任何需要发送 MTOM 的方法之前将此设置为 true。确保为非 MTOM 呼叫禁用它。


推荐阅读