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
MTOMMTOM 

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="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 />
<env:Body>
<m:mtomFileRequest xmlns:m="http://ws.amar.com/dpaas/">
<mtomFileOption>
<data>Y29tLmNpcGhlcmNsb3VkLm1hZ2ljLmJ5dGVzLjAxLjAwMDAxNXNU0UnBG4ryk0xChsZSLgZunNW1Gac9cp1Fb8u0sm4XBAKKmOE/72j7RMJu+T23JTNFr7OZOVwBYG2BZxOBudOhm2Nbwy7u0km0Cz9cJ2nCFHq4wOc8EP207PVggilr1eHGY/EgvX/2NerDmdTtkJl1c9mHrxDmzJWyX5lAbxQ+ZuGWnxvl3EhmOM1yWFHfrhxRnwPvGirrJNm/lP6zCgO7J2qlvfHs8Ufl745BqjtMjijwD7N52Gi2AAqTgv41f4krGnC/hsssCvqdyE7XXlbvJI2vi8+LdOuRDdH8MyaZH2HwvwrzfZjBW8PPEoQGUqVMgS7L/G1dvGqFGTay9vl7ShzoQLj1g2s2p6q0F6fr+sDiCHKdLB0wd1JWAnbJb0CeTaFVBO5OsaFhRLdupifwmEpksRzxljfCl2E52J5ulC/KQK5LsHQN9AVFGfzDYim==
</data>
</mtomFileOption>
</m:mtomFileRequest>
</env:Body>
</env:Envelope>

 

Without MTOM the content is going as inline.

 

With MTOM feature:
-----------------------------

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

--uuid:06d4106c-35a0-43df-8725-5a8e4712b957
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;
--uuid:06d4106c-35a0-43df-8725-5a8e4712b957--

 

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,
Amar

Davide MolinariDavide Molinari
Hi,
Did you find the solution for your issue?
Thanks,
Davide
 
osf_teamosf_team
did you find solution for your issue?