3

I am trying to consume a SoapAPI service however am encountering a strange exception. Here is the full exception message:

The content type multipart/related; type="application/xop+xml"; boundary="uuid:753c4c1a-9c8a-41c4-8bf8-15a5e555e5a2"; 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 1024 bytes of the response were: '--uuid:753c4c1a-9c8a-41c4-8bf8-15a5e555e5a2
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-ENV:Header xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"/><soap:Body><ns2:exportDevicesResponse xmlns:ns2="http://devicemgmt.nbapi.cgms.cisco.com/"><deviceReport><data><xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:634e78b2-e85f-48ad-ab03-714fe69989e0-32@cxf.apache.org"/></data><date>2021-06-25T13:37:25.781-04:00</date><query>deviceType:cgr1000</query><status>COMPLETED</status></deviceReport></ns2:exportDevicesResponse></soap:Body></soap:Envelope>
--uuid:753c4c1a-9c8a-41c4-8bf8-15a5e555e5a2
Content-Type: application/octet-stream
Content-Transfer-Encoding: binary
Content-ID: <634e78b2-e85f-48ad-ab03-714fe69989e0-32@cxf.apache.org>
Content-Disposition: attachment;name="8287_1624642645781.csv"

Exported '.

I have used SoapUI to successfully send and receive messages back from this API, and some of my other function calls on this specific service do work so I know that my service is work; but, it just seems as there is an issue when trying to process the result. I've looked at several other responses to this exact question, however none of them have actually helped resolve the problem. My app.config file has the message encoded as Mtom and when I run WCF service configuration editor, I know that the configuration for my binding is set to be Mtom.

EDIT: I've I have looked through this post however none of the solutions have helped. Since I am using .NET Core 3.1 Console App, I do not have an app.config file and even if I did add the app.config file, it did not change the result. Additionally, I can not use WCF Config Editor because there does not exist a .config file. And because I am using .NET Core and not .NET Framework, my BasicHTTPBinding setting has no "MessageEncoding". I know that I am able to connect to the server because I am able to complete two different requests that connect to this same server.

slam06
  • 43
  • 6
  • There's a few solutions on this link that's similar to your problem https://stackoverflow.com/questions/10496186/error-consuming-webservice-content-type-application-xopxml-does-not-match-ex – Andrew Reese Jun 25 '21 at 18:14
  • @AndrewReese I've tried all the solutions in that post but still can't resolve this error. – slam06 Jun 28 '21 at 13:52

0 Answers0