function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Enable MTOM in salesforce while making a webservice call...

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=""
xmlns:xsd="" xmlns:xsi="">
<env:Header />
<m:mtomFileRequest xmlns:m="">


Without MTOM the content is going as inline.


With MTOM feature:

<soap:Envelope xmlns:soap="">
<ns3:mtomFileResponse xmlns:ns2=""
<xop:Include xmlns:xop=""
href="" />

Content-Type: application/octet-stream
Content-Transfer-Encoding: binary
Content-ID: <>

* Please modify this class to meet your needs
* This class is not complete
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,

Davide MolinariDavide Molinari
Did you find the solution for your issue?
did you find solution for your issue?