This week's giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Secure Financial Transactions with Ansible, Terraform, and OpenSCAP and have Lucian Maly on-line!
See this thread for details.
Win a copy of Secure Financial Transactions with Ansible, Terraform, and OpenSCAP this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

axis and attachments

Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am writing a webservice which gets an attachment as input and sends an attachment back. i am using tomcat 4.1.29 and axis 1.1. i tried to run an example, but it always throws an exception:
nested exception is: No support for attachments
mail.jar and activation.jar are in my classpath.
deploying is no problem.
i hope somebody can help me.
cu. regina

here the two example classes:
import java.util.StringTokenizer;
import javax.activation.DataHandler;
public class GreetingService2{
public DataHandler sayHello(DataHandler dh){
return dh;

import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;
import org.apache.axis.encoding.ser.*;
import javax.activation.*;
import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;
public class AxisAttachmentClient {
public static void main (String[] args){
try {
String fileName = "attachment.txt";
DataHandler dhandler = new DataHandler(new FileDataSource(fileName));

String endpointURL = "http://localhost:8080/axis/services/greetingService2";
String methodName = "sayHello";

Service service = new Service();

Call call = (Call)service.createCall();

QName qn = new QName("greetingService2", "DataHandler");

call.registerTypeMapping(dhandler.getClass(), qn, JAFDataHandlerSerializerFactory.class, JAFDataHandlerDeserializerFactory.class);
dhandler = (DataHandler) call.invoke(new Object[]{dhandler});

} catch(Exception e){

Won't you please? Please won't you be my neighbor? - Fred Rogers. Tiny ad:
SKIP - a book about connecting industrious people with elderly land owners
    Bookmark Topic Watch Topic
  • New Topic