Axis2 MTOM Webservice and a .NET Client to consume it

So i have this new Axis2 MTOM Webservice serving correctly to a java based webservice client.

The problem comes around when i try to add the service (or web) reference to the vs2008 and consume it with the generated code. Until now, is everything OK... this is what happens:

  1. We create the necessary objects (client, request and parameter object)
  2. We call the service
  3. When receiving the response, it throws an exception with this message:

  Client found response content type of 'multipart/related; 
  type="application/xop+xml"; start="
  <>"; start-info="text/xml"', 
  but expected 'text/xml'.

  The request failed with the error message:

Content-Type: application/xop+xml; charset=utf-8; type="text/xml"
Content-Transfer-Encoding: binary
Content-ID: <>

<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv=""><soapenv:Body><ns:sendImageResponse xmlns:ns="http://org/company/ws/services/filetransfer/"><ns:return xmlns:ax213="" xmlns:xsi="" xmlns:ax215="" xsi:type="ax215:SendImageResponse"><ax215:errorCode>1060</ax215:errorCode><ax215:errorMessage>Error ejecutando el servicio</ax215:errorMessage><ax215:output>1060</ax215:output></ns:return></ns:sendImageResponse></soapenv:Body></soapenv:Envelope>

Or the question will be

┬┐How to set the the axis2 webservice's response to be non mimetype?


You need to use MTOM encoding in the configuration. See simple example from MSDN to use it with wsHttpBinding (should also be possible with basicHttpBinding). Check this article that describes consuming oracle web service using custom binding. If you want to try custom binding as given in example, you probably need to set messageVersion to Soap11 rather than Soap12.

Need Your Help

Why does my App crash after i set an array?

java android arrays crash

I used an array the whole time for my app. But i only set the values after the app was created, with:

HTML <a href> to open Excel docuemnt - Specific worksheet

javascript html excel-2010

I have a problem when trying to reference a Specific worksheet within an excel using a ref in HTML.