我有消耗web服务为我的公司已经购买了产品时,一个奇怪的问题。该产品被称为营销司令和它的由一家名为电子邮件愿景。我们正在尝试使用数据批量更新SOAP API。
每当我尝试调用任何的Web服务的方法,电话居然成功,但处理响应当客户端失败,我得到一个例外。
错误的细节如下,感谢您的帮助你们可以提供。
在消费服务作为Web引用,我得到一个 InvalidOperationException异常
的任何电话,我让,并显示以下消息:
客户端发现的多部分响应内容类型/相关; TYPE =应用程序/ XOP + XML;边界=UUID:170e63fa-183C-4b18-9364-c62ca545a6e0;开始=&其中; root.message@cxf.apache.org>;启动信息=文本/ xml的,但预期为text / xml。
请求失败,错误信息:
-
--uuid:170e63fa-183C-4b18-9364-c62ca545a6e0
内容类型:应用程序/ XOP + XML的;字符集= UTF-8; TYPE =为text / xml;
内容传输编码:二进制
内容ID:< root.message@cxf.apache.org>
<肥皂:信封XMLNS:肥皂=http://schemas.xmlsoap.org/soap/envelope/>
<肥皂:身体与GT;
< 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>
&LT; / NS2:openApiConnectionResponse&GT;
&LT; / SOAP:身体与GT;
&LT; /肥皂:信封&GT;
--uuid:170e63fa-183C-4b18-9364-c62ca545a6e0--
- 。
如你所见,响应SOAP信封看起来有效(这是一个有效的响应,并调用成功),但客户端似乎有与内容类型的问题,并产生了异常。
当我使用该服务的服务引用我收到了的ProtocolException
的任何电话,我让,并显示以下消息:
的内容类型多部分/相关; TYPE =应用程序/ XOP + XML;边界=UUID:af66440a-012E-4444-8814-895c843de5ec;开始=&其中; root.message@cxf.apache.org>;启动信息的响应消息不匹配绑定的内容类型=文/ XML(文/ XML;字符集= UTF-8)。如果使用自定义的连接codeR,确保IsContentTypeSupported方法正确实施。第一648字节响应的分别为:
--uuid:af66440a-012E-4444-8814-895c843de5ec
内容类型:应用程序/ XOP + XML的;字符集= UTF-8; TYPE =为text / xml;
内容传输编码:二进制
内容ID:&LT; root.message@cxf.apache.org>
&LT;肥皂:信封XMLNS:肥皂=http://schemas.xmlsoap.org/soap/envelope/&GT;
&LT;肥皂:身体与GT;
&LT; NS2:openApiConnectionResponse的xmlns:NS2 =http://api.service.apibatchmember.emailvision.com/的xmlns:NS3 =http://exceptions.service.apibatchmember.emailvision.com/&GT;
<return>Dqaqb-MJ9V_eplZ8fPh4tdHUbxM-ZtuZsDG6GalAGZSfSzyxgtuuIxZc3aSsnhI4b0SCbJsZmrZ_d3v2-7G8</return>
&LT; / NS2:openApiConnectionResponse&GT;
&LT; / SOAP:身体与GT;
&LT; /肥皂:信封&GT;
--uuid:af66440a-012E-4444-8814-895c843de5ec--。
就像用previous例子;我们已经有了一个有效的SOAP响应和调用成功,但客户端似乎有与内容类型的问题,并产生了异常。
是否有任何选择,我可以设置让客户端不与响应类型的问题?我做了一些谷歌搜索,但没有我发现帮助了我这么远。 解决方案
对于任何人同样的问题的痛苦;我已经找到了为使用Web服务作为服务引用(WCF)的解决方案。该BasicHttpBinding.MessageEncoding物业的需求设置为MTOM。
下面是必需的配置设置的一个片段:
&lt;结构&GT;
&LT; system.serviceModel&GT;
&LT;绑定&GT;
&LT; basicHttpBinding的&GT;
&LT;结合messageEncoding =MTOM&GT;
&LT; /装订&GT;
&LT; / basicHttpBinding的&GT;
&LT; /绑定&GT;
&LT; /system.serviceModel>
&LT; /结构&gt;
我还没有找到一个解决方案,消费它作为一个老风格的Web参考呢。
I'm having a weird issue when consuming a webservice for a product that my company has bought. The product is called Campaign Commander and it's made by a company called Email Vision. We're trying to use the "Data Mass Update SOAP API".
Whenever I try to call any of the methods on the webservice, the call actually succeeds but the client fails when processing the response and I get an exception.
The details of the errors are below, thanks for any help you guys can offer.
When consume the service as a Web Reference I get an InvalidOperationException
for any call that I make, with the following message:
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--
--.
As you can see, the response soap envelope looks valid (this is a valid response and the call succeeded), but the client seems to have a problem with the content type and generates an exception.
When I consume the service as a Service Reference I get a ProtocolException
for any call that I make, with the following message:
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--'.
Just like with the previous example; we've got a valid soap response and the call was successful, but the client seems to have a problem with the content type and has generated an exception.
Are there any options I can set so the client doesn't have a problem with the response type? I've done some Google searches, but nothing that I've found has helped me so far.
解决方案For anyone suffering from the same problem; I've found a solution for consuming the web service as a Service Reference (WCF). The BasicHttpBinding.MessageEncoding property needs setting to "Mtom".
Here's a snippet of the required config setting:
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding messageEncoding="Mtom">
</binding>
</basicHttpBinding>
</bindings>
</system.serviceModel>
</configuration>
I still haven't found a solution for consuming it as an old style Web Reference yet.