axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dorner Thomas <>
Subject SOAP with Attachments ?
Date Tue, 10 Aug 2004 15:06:35 GMT
Hello all,

I like to send an attachment from my Service to the client.
So there are several possible ways to go:

The first ist to place a attachment in the responseMessage:

String fileName = "C:\\WebService\\webapps\\PDMWebConnector\\arrow.gif";

//explicitly set format to DIME, default is MIME
Message rspmsg = AxisEngine.getCurrentMessageContext().getResponseMessage();

DataHandler dh = new DataHandler(new FileDataSource(fileName));
if (dh == null ) System.err.println("dhSource is null");
AttachmentPart ap = new AttachmentPart(dh);


The other way is to send back the datahandler itself

public Datahandler download(java.lang.String request) throws
java.rmi.RemoteException {

The difference is in the SOAP-Message. If I send a Datahandler back,
I got a SOAP-Message with a href in my SOAP-Body, referencing the 
Attachment behind my SOAP-Message.

In the other way, when I send back the added AttchmentPart, I got no
reference in my

Whats the right way to go???
Is there a solution to place Filename or addional information when I send a

Please help me!

I wanna send Data from a Java-Service to a gsoap Client!!!

Thanks Tomi

View raw message