5

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; 
  boundary=MIMEBoundaryurn_uuid_6C47CADDECCCB90D951282776406454; 
  type="application/xop+xml"; start="
  <0.urn:uuid:6C47CADDECCCB90D951282776406455@apache.org>"; start-info="text/xml"', 
  but expected 'text/xml'.

  The request failed with the error message:


MIMEBoundaryurn_uuid_6C47CADDECCCB90D951282776406454
Content-Type: application/xop+xml; charset=utf-8; type="text/xml"
Content-Transfer-Encoding: binary
Content-ID: <0.urn:uuid:6C47CADDECCCB90D951282776406455@apache.org>

<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns:sendImageResponse xmlns:ns="http://org/company/ws/services/filetransfer/"><ns:return xmlns:ax213="http://filetransfer.objects.ws.company.com/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ax215="http://filetransfer.responses.objects.ws.company.com/xsd" 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>
MIMEBoundaryurn_uuid_6C47CADDECCCB90D951282776406454

Or the question will be

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

Garis M Suero
  • 7,974
  • 7
  • 45
  • 68

1 Answers1

4

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.

VinayC
  • 47,395
  • 5
  • 59
  • 72
  • Done that, and the problem persist... anyhow, i will try it again in few hours... – Garis M Suero Aug 26 '10 at 05:48
  • After some twekings on the elements on the properties of the response object (XMLElement) and a good help from you... it is working now. Thanks – Garis M Suero Aug 26 '10 at 16:25
  • @GarisMSuero - Can you post what you've done to get it working? I'm having the same issue (Axis2 webservice using mtom and I'm implementing a c# client) and your response is hopeful. – djbyter Oct 28 '13 at 01:41
  • sorry @djbyter I just saw this. But I don't work in that company anymore and/or with .net. But if you post a question here I might help. – Garis M Suero Nov 05 '13 at 15:53