This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal


Jul 2, 2014, 3:05 PM
12 Posts

Web Service using MTOM

  • Category: Domino Server
  • Platform: Windows
  • Release: 9.0.1
  • Role: Developer
  • Tags: web service,mtom,provider
  • Replies: 0

Been trying get a web service provider working with mtom and am not getting far. 

 

I current have a provider in which I receive a file via a base64 encode string. We are reaching over 4mb files and want to convert the providers to use MTOM as we are expecting files up to 10mb big. We run our web services through datapower and therefore been instructed that cause of the large files we must utilise MTOM.  I can recieve Base64binary files easly enough in my service but as soon as I enable MTOM on SoapUI or SOAPSonar i get the following error -

 

 <faultstring>org.xml.sax.SAXParseException: Content is not allowed in prolog.</faultstring>
 

I am presuming its because the header has other information in the request sent to the web service.

Here is my sample code I am running in my provider:

 

import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.*;
import java.io.File;
import java.io.IOException;
 
import javax.activation.DataHandler;
import javax.imageio.ImageIO;
import javax.xml.ws.soap.MTOM;
import lotus.domino.types.Base64Binary;
import lotus.domino.axis.encoding.Base64;
 
//Service Implementation Bean
@MTOM
public class ImageServerImpl {
 
    public String uploadImage(Base64Binary data) {
        
        if(data!=null){
             
 
File someFile = new File("c:/Output_File.pdf");
try{
FileOutputStream fos = new FileOutputStream(someFile);
fos.write(data.getBytes());
fos.flush();
fos.close();
}catch(Exception e){
}
 
 
                          
              }
        
              return "Upload Successful";
              
  }
 
 
}
 
 

Any help will be much appreciated.

 

thanks


This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal