.Net Core and MTOM

  • Thread starter Thread starter WRBehning
  • Start date Start date
W

WRBehning

Guest
I apologize if this is in the wrong forum - there does not seem to be one for .net Core.

I am trying to consume a Soap service with ASP .Net Core, but it seems that MTOM is not supported in .Net Core.

The problem is that there are many Web Services out there that use MTOM, and we as developers have no control over that. We can't just tell a third party that they have to update their web service.

If .Net Core cannot consume these services, I don't see any point of going down the .net Core path. From what I have read, Microsoft does not seem to interested in fixing this issue.

We are trying to adopt .Net Core, but road blocks like these make it really difficult.

My only option here is to go with a .Net Framework solution.


Here is the excption:


Message:
Test method UnitTest1.Should_Be_Able_To_Consume_WCF threw exception:
System.AggregateException: One or more errors occurred. (The content type multipart/related; type="application/xop+xml"; start="<http://tempuri.org/0>"; boundary="uuid:0b570f41-b787-490d-88fb-a15d746ce27f+id=2"; 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 704 bytes of the response were: '
--uuid:0b570f41-b787-490d-88fb-a15d746ce27f+id=2
Content-ID: <http://tempuri.org/0>
Content-Transfer-Encoding: 8bit
Content-Type: application/xop+xml;charset=utf-8;type="text/xml"

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><PingResponse xmlns="http://tempuri.org/"><PingResult xmlns:a="http://schemas.datacontract.org/2004/07/FileNetGateway.Models" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><a:Error i:nil="true" xmlns:b="http://schemas.datacontract.org/2004/07/System"/><a:HasError>false</a:HasError><a:Message>Alive at 9/9/2019 10:06:50 AM</a:Message></PingResult></PingResponse></s:Body></s:Envelope>
--uuid:0b570f41-b787-490d-88fb-a15d746ce27f+id=2--
'.) ---> System.ServiceModel.ProtocolException: The content type multipart/related; type="application/xop+xml"; start="<http://tempuri.org/0>"; boundary="uuid:0b570f41-b787-490d-88fb-a15d746ce27f+id=2"; 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 704 bytes of the response were: '
--uuid:0b570f41-b787-490d-88fb-a15d746ce27f+id=2
Content-ID: <http://tempuri.org/0>
Content-Transfer-Encoding: 8bit
Content-Type: application/xop+xml;charset=utf-8;type="text/xml"

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><PingResponse xmlns="http://tempuri.org/"><PingResult xmlns:a="http://schemas.datacontract.org/2004/07/FileNetGateway.Models" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><a:Error i:nil="true" xmlns:b="http://schemas.datacontract.org/2004/07/System"/><a:HasError>false</a:HasError><a:Message>Alive at 9/9/2019 10:06:50 AM</a:Message></PingResult></PingResponse></s:Body></s:Envelope>
--uuid:0b570f41-b787-490d-88fb-a15d746ce27f+id=2--
'.
Stack Trace:
at AsyncResult.End[TAsyncResult](IAsyncResult result)
at SendAsyncResult.End(SendAsyncResult result)
at ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
at <>c__DisplayClass1_0.<CreateGenericTask>b__0(IAsyncResult asyncResult)
at --- End of inner exception stack trace ---
at Task`1.GetResultCore(Boolean waitCompletionNotification)
at UnitTest1.Should_Be_Able_To_Consume_WCF() in UnitTest1.cs line: 49

Continue reading...
 
Back
Top