title: Error consuming webservice, content type "application/xop+xml" does not match expected type "text/xml"
body: <p>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".</p>
  
  <p>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.</p>
  
  <p>The details of the errors are below, thanks for any help you guys can offer.</p>
  
  <h2>Error using Web Reference (old style webservice client)</h2>
  
  <p>When consume the service as a Web Reference I get an <code>InvalidOperationException</code> for any call that I make, with the following message:</p>
  
  <pre><code>Client found response content type of 'multipart/related; type="application/xop+xml"; boundary="uuid:170e63fa-183c-4b18-9364-c62ca545a6e0"; start="&lt;root.message@cxf.apache.org&gt;"; 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: &lt;root.message@cxf.apache.org&gt;
  
  &lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;
    &lt;soap:Body&gt;
      &lt;ns2:openApiConnectionResponse xmlns:ns2="http://api.service.apibatchmember.emailvision.com/" xmlns:ns3="http://exceptions.service.apibatchmember.emailvision.com/"&gt;
        &lt;return&gt;DpKTe-9swUeOsxhHH9t-uLPeLyg-aa2xk3-aKe9oJ5S9Yymrnuf1FxYnzpaFojsQSkSCbJsZmrZ_d3v2-7Hj&lt;/return&gt;
      &lt;/ns2:openApiConnectionResponse&gt;
    &lt;/soap:Body&gt;
  &lt;/soap:Envelope&gt;
  --uuid:170e63fa-183c-4b18-9364-c62ca545a6e0--
  --.
  </code></pre>
  
  <p>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.</p>
  
  <h2>Error using Service Reference (WCF client)</h2>
  
  <p>When I consume the service as a Service Reference I get a <code>ProtocolException</code> for any call that I make, with the following message:</p>
  
  <pre><code>The content type multipart/related; type="application/xop+xml"; boundary="uuid:af66440a-012e-4444-8814-895c843de5ec"; start="&lt;root.message@cxf.apache.org&gt;"; 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: &lt;root.message@cxf.apache.org&gt;
  
  &lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;
    &lt;soap:Body&gt;
      &lt;ns2:openApiConnectionResponse xmlns:ns2="http://api.service.apibatchmember.emailvision.com/" xmlns:ns3="http://exceptions.service.apibatchmember.emailvision.com/"&gt;
        &lt;return&gt;Dqaqb-MJ9V_eplZ8fPh4tdHUbxM-ZtuZsDG6GalAGZSfSzyxgtuuIxZc3aSsnhI4b0SCbJsZmrZ_d3v2-7G8&lt;/return&gt;
      &lt;/ns2:openApiConnectionResponse&gt;
    &lt;/soap:Body&gt;
  &lt;/soap:Envelope&gt;
  --uuid:af66440a-012e-4444-8814-895c843de5ec--'.
  </code></pre>
  
  <p>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.</p>
  
  <p>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.</p>