c# - 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 已经过时,如果有其他方法请告诉我。
有人可以帮忙吗?
解决方案
将生成的类基类从 System.Web.Services.Protocols.SoapHttpClientProtocol 更改为 Microsoft.Web.Services3.WebServicesClientProtocol。完成后,您将能够访问名为 RequireMtom 的字段。在调用任何需要发送 MTOM 的方法之前将此设置为 true。确保为非 MTOM 呼叫禁用它。
推荐阅读
- javascript - 当屏幕宽度小于或大于
- java - 我的应用程序不断崩溃。我正在尝试像 instagram 一样做背景动画
- c++ - struct 是否比嵌入式系统中的类具有更好的性能
- python - Django:ModelForm 的 kwargs
- javascript - 一个组件中的表单被其他组件提交
- c - POSIX,在 pthread_t 之间传递应用程序数据
- android - 如何在不单击按钮的情况下验证密码?
- c# - 用正则表达式替换字符串中项目的特定实例
- php - 如何设置 phpmyadmin 和 SQL 以通过 REST-api 进行消息传递?
- java - 具有多个具有 main 方法的类的 intellij 项目