axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Gainty" <>
Subject Re: large attachments in dime format
Date Wed, 03 Jan 2007 21:14:51 GMT
//create the service
   Service service = new Service();
//create the call
   Call call = (Call) service.createCall();

  call.setTargetEndpointAddress(new URL(WEB_SERVICE_URL)); //Set the target service host and
service location,
  call.setOperationName(new QName(WEB_SERVICE_NAME, operation)); //This is the target services
method to invoke.
  QName qnameAttachment = new QName(WEB_SERVICE_NAME, "DataHandler");

        DataHandler dhSource = new DataHandler(new FileDataSource(INPUT_XML));
        call.registerTypeMapping(dhSource.getClass(), //Add serializer for attachment. 

        call.addParameter("source", qnameAttachment, ParameterMode.IN); //Add the file.


        try {

         Object ret = call.invoke(new Object[]{dhSource}); //Add the attachment.
   "ret : " + ret);
         if(ret == null) {
"null response received.");
         } else if(ret instanceof String) { 
          String errorMsg = (String)ret;
"errorMsg : " + errorMsg);
         } else  if(ret instanceof DataHandler) 
              DataHandler dh = (DataHandler)ret;
    "dh.getName() : " + dh.getName());
              byte[] responseBytes = Utils.getBytesFromDataHandler(dh);
    "responseBytes length : " + responseBytes.length);
              String responseStr = new String(responseBytes, "UTF-8");
    "responseStr : " + responseStr);
        } catch(RemoteException  e) {
         log.error("AttachmentServiceException :" , e);

This e-mail message (including attachments, if any) is intended for the use of the individual
or entity to which it is addressed and may contain information that is privileged, proprietary
, confidential and exempt from disclosure. If you are not the intended recipient, you are
notified that any dissemination, distribution or copying of this communication is strictly
Le présent message électronique (y compris les pièces qui y sont annexées, le cas échéant)
s'adresse au destinataire indiqué et peut contenir des renseignements de caractère privé
ou confidentiel. Si vous n'êtes pas le destinataire de ce document, nous vous signalons qu'il
est strictement interdit de le diffuser, de le distribuer ou de le reproduire.
----- Original Message ----- 
From: "Peter" <>
To: <>
Sent: Wednesday, January 03, 2007 11:43 AM
Subject: large attachments in dime format

> hi list,
> i'm developing a webservice which should be able to handle multiple 
> soap-attatchment within one request with a maximum size of 3MB per 
> attachment.
> sending and receiving attachments with a size smaller then 20kB in dime-format 
> is no problem.
> but when i try to send attachments with a size greater then 20kB i can not 
> handle them. the files are stored in my attachment folder by via the 
> sourcecode i can't find a possibility to get access to these files.
> how can I get it to work ?
> thanks
> best regards peter
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:
View raw message