• 0 Points
  • Member since 2013

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
  • 0

Hi All,

I developed a file processing through a webservice. I am using Java in background. I developed a WSDL which handles MTOM internally. I implemented the server side code using CXF. I tested this feature using SOAP UI (Its a Client with this we can test webservices).


I thought why can't we develop a client using Salesforce APEX code. So I started to implement. In that First Step I generated a stub code using my WSDL and I wrote one sample client. When I run that sample code its processing the files and its working fine. But unfortunatly the SOAP request is not in the form of MTOM. How can I enable MTOM feature in Salesforce before sending a webservice request. Is there any route to use this feature in salesforce. I searched but I unabled to find the solution. Can any body help me on this. I am stuck over here. Please help me on this.


Here I am pasting the sample requests with and without MTOM feature.


Without MTOM feature:
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:Header />
<m:mtomFileRequest xmlns:m="http://ws.amar.com/dpaas/">


Without MTOM the content is going as inline.


With MTOM feature:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<ns3:mtomFileResponse xmlns:ns2="http://xmlns.amar.com/common/v1"
<xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include"
href="cid:cab662cb-4bfe-4aea-a9ce-f41b497a5394-5@cxf.apache.org" />

Content-Type: application/octet-stream
Content-Transfer-Encoding: binary
Content-ID: <cab662cb-4bfe-4aea-a9ce-f41b497a5394-5@cxf.apache.org>

* Please modify this class to meet your needs
* This class is not complete
package com.amar.ws.dpaas;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;


If you enable MTOM feature the content is going as a multipart request.


So how can I enable MTOM in salesforce. Can anyone help me on this please.

Thanks & Regards,

  • March 21, 2013
  • Like
  • 0