WSE 3.0 WSE839异常

时间:2018-08-31 13:14:27

标签: c# soap mtom wse wse3.0

有一个Java Soap-Service,我想用WSE 3.0调用,我用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已过时,如果还有其他方法可以解决。

有人可以帮忙吗?

1 个答案:

答案 0 :(得分:1)

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