- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在使用我公司购买的产品的网络服务时,我遇到了一个奇怪的问题。该产品名为 Campaign Commander,由一家名为 Email Vision 的公司制造。我们正在尝试使用“Data Mass Update SOAP API”。
每当我尝试调用 Web 服务上的任何方法时,调用实际上都会成功,但客户端在处理响应时会失败,并且会出现异常。
错误的详细信息如下,感谢您提供的帮助。
当使用该服务作为 Web 引用时,我进行的任何调用都会收到 InvalidOperationException
,并显示以下消息:
Client found response content type of 'multipart/related; type="application/xop+xml"; boundary="uuid:170e63fa-183c-4b18-9364-c62ca545a6e0"; start="<root.message@cxf.apache.org>"; start-info="text/xml"', but expected 'text/xml'.
The request failed with the error message:
--
--uuid:170e63fa-183c-4b18-9364-c62ca545a6e0
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml";
Content-Transfer-Encoding: binary
Content-ID: <root.message@cxf.apache.org>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns2:openApiConnectionResponse xmlns:ns2="http://api.service.apibatchmember.emailvision.com/" xmlns:ns3="http://exceptions.service.apibatchmember.emailvision.com/">
<return>DpKTe-9swUeOsxhHH9t-uLPeLyg-aa2xk3-aKe9oJ5S9Yymrnuf1FxYnzpaFojsQSkSCbJsZmrZ_d3v2-7Hj</return>
</ns2:openApiConnectionResponse>
</soap:Body>
</soap:Envelope>
--uuid:170e63fa-183c-4b18-9364-c62ca545a6e0--
--.
正如您所看到的,响应soap信封看起来有效(这是一个有效的响应并且调用成功),但客户端的内容类型似乎有问题并生成异常。
当我将服务作为服务引用使用时,我进行的任何调用都会收到 ProtocolException
,并显示以下消息:
The content type multipart/related; type="application/xop+xml"; boundary="uuid:af66440a-012e-4444-8814-895c843de5ec"; start="<root.message@cxf.apache.org>"; start-info="text/xml" 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. The first 648 bytes of the response were: '
--uuid:af66440a-012e-4444-8814-895c843de5ec
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml";
Content-Transfer-Encoding: binary
Content-ID: <root.message@cxf.apache.org>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns2:openApiConnectionResponse xmlns:ns2="http://api.service.apibatchmember.emailvision.com/" xmlns:ns3="http://exceptions.service.apibatchmember.emailvision.com/">
<return>Dqaqb-MJ9V_eplZ8fPh4tdHUbxM-ZtuZsDG6GalAGZSfSzyxgtuuIxZc3aSsnhI4b0SCbJsZmrZ_d3v2-7G8</return>
</ns2:openApiConnectionResponse>
</soap:Body>
</soap:Envelope>
--uuid:af66440a-012e-4444-8814-895c843de5ec--'.
就像前面的例子一样;我们得到了有效的肥皂响应并且调用成功,但客户端似乎有内容类型问题并生成了异常。
是否可以设置任何选项,以便客户端不会遇到响应类型问题?我已经进行了一些 Google 搜索,但到目前为止我发现的任何内容都对我没有帮助。
最佳答案
对于遇到同样问题的人;我找到了一种将 Web 服务用作服务引用 (WCF) 的解决方案。 BasicHttpBinding.MessageEncoding属性需要设置为“Mtom”。
这是所需配置设置的片段:
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding messageEncoding="Mtom">
</binding>
</basicHttpBinding>
</bindings>
</system.serviceModel>
</configuration>
编辑:如果您在自定义绑定(bind)方面遇到同样的问题,请参阅 answer from @robmzd .
我还没有找到将其用作旧式 Web 引用的解决方案。
关于c# - 使用 Web 服务时出错,内容类型 "application/xop+xml"与预期类型 "text/xml"不匹配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10496186/
我有下一个问题: 我使用一些 Bulldozer (xop) 指令进行了一些与 xop 检查相关的测试。 我必须仅在 Bulldozer 处理器上运行此测试。 如何检查我的处理器在编译时是否支持 xo
我们的应用程序使用 SOAP 将文件附件发送到 Web 服务。该服务在 Oracle Service Bus 11g 上运行。我们在客户端使用Spring WS + SAAJ + MTOM来发送请求。
这是我已经回答过的那些“问题”之一,但是根据一周的谷歌搜索,我发布的信息似乎几乎为零。 TL;DR:WCF MTOM 编码的 BasicHttpBinding 客户端到外部/第三部分,非 .NET W
我的数据源已从 Base64 嵌入图像数据切换到 XOP 图像数据。我正在使用 Java/JAXB 来解码数据,但找不到任何描述其完成方式的良好来源。所有引用文献似乎都描述了使用 SOAP 消息执行此
我正在尝试使用 MTOM + XOP 在 Spring Web 服务中返回一个 byte[] 但是当编码结果时它会抛出一个带有消息的 SAXParseException: cvc-type.3.1.2
我想知道使用 WS 和 MTOM 的主要好处是什么。 (不流式传输附件) 据我了解,有效负载不会包含将成为 MIME 一部分的二进制数据 “当您使用 MTOM/XOP 优化 SOAP 消息时,XOP
我如何解析/反序列化 MTOM/XOP我从使用 WCF 的 Web 服务获得的响应?我在磁盘上有响应。我已复制以下回复: Date: Wed, 02 May 2012 09:38:57 GMT Ser
我对将 MTOM/XOP 与 JAX-WS 结合使用有疑问。我正在编写一个发送大量二进制数据的网络服务。客户端请求多个文件,服务器在响应中返回文件。 我能够让它正确构建响应,从而正确实现 XOP,但我
我只想知道,有没有简单的方法来解析 MTOM/XOP SOAP 响应。问题是我使用纯 HTTP 发送 soap 消息和 javax.xml 来解析响应。但是有些服务用 mulipart/related
我正在尝试连接到描述为 .wsdl 文件的第三方服务。我无法提供整个文件,因为它太长了,但重要的部分是: .ec2HttpSoap12Endpoint/"/>
我有一个 XML 模式,它定义了一个元素,该元素可以是 base64 文本或 xop:Include 元素。目前,这被定义为 base64Binary 类型: 当我插入 xop:Include 元素
我正在使用一个 Web 服务,在该服务中我发送了一个带有附件的请求,我们从服务器收到了包含各种信息的响应。我在另一个问题 Adding an attachment to SOAP request 中记
在使用我公司购买的产品的网络服务时,我遇到了一个奇怪的问题。该产品名为 Campaign Commander,由一家名为 Email Vision 的公司制造。我们正在尝试使用“Data Mass U
我正在尝试使用他们的 FileTransfer API 将批量数据交换调用上传到 eBay。为此,我必须向 eBay 服务器发布一个 xml 请求字符串,但 xml请求包含 必须包含您正在传输的数据的
我在与 Java WS 交谈时遇到问题。我使用“wsHttpBinding”绑定(bind)客户端证书进行身份验证,消息编码设置为“文本”,.net 框架为 4.0。服务器端是 Java,我无法控制它
我是一名优秀的程序员,十分优秀!