WSE 3.0 WSE839 异常

WSE 3.0 WSE839 Exception

有一个 Java-Soap 服务,我想用 WSE 3.0 调用它,我用 WSDL 文件生成了一个代理,但该服务需要 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 已过时,如果有其他方法,请告诉。

有人可以帮忙吗?

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