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.
Error using Web Reference (old style webservice client)
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="<[email protected]>"; 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: <[email protected]>
<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.
Error using Service Reference (WCF client)
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="<[email protected]>"; 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: <[email protected]>
<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.
question from:
https://stackoverflow.com/questions/10496186/error-consuming-webservice-content-type-application-xopxml-does-not-match-ex 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…