Search code examples
c#javaweb-servicesapache-axismtom

Sending MTOM request to a AXIS2 Web Service from Dot Net application


I need to send MTOM request (having file to checked in to Documentum location), to a AXIS2 Web Service.

The service has identified, two types of transfer mode, 64bit encoding and MTOM. Even when I use the MTOM mode and do the changes to Web.Config (WSE 3.0) to send only MTOM request, base 64 is passed over the wire.

How do I ensure that the request is MTOM? I need to share the file as a byte array. The method to check in document expects it to be a byte array.


Solution

    1. Installed WSE3.0 on my laptop.
    2. Changed the Web.Config as suggested here - http://msdn.microsoft.com/en-us/library/aa528822.aspx
    3. Changed the inheritance of the class - public partial class DasStoreContentService_V1X0 from System.Web.Services.Protocols.SoapHttpClientProtocol to Microsoft.Web.Services3.WebServicesClientProtocol.
    4. Overridden the method as follows

    protected override System.Net.WebResponse GetWebResponse(System.Net.WebRequest request) { System.Net.WebResponse output = base.GetWebResponse(request); this.RequireMtom = false; return output; } 5. Before sending the MTOM request, change the type of request by : dscsService.RequireMtom = true;