Unique Problem: Returning SOAP+ Attachment using a class based webservice

Hi everyone,

Im trying to return a Soap+ attachment response back using the following:

attachDoc(byte[] bdoc, String sTransactionNumber,

String sRequestedType)

Where byte[] is the attachment and the 2 string parameters are soap message contents.

The attachment is attached successfully to the message and i can send a response back to the clients console using :

message.writeTo(System.out);

My problem is that i dont know how to return this soapmessage+attachment back to the client.

Ive tried using the return type of the method as :

public SOAPMessage attachDoc(byte[] bdoc, String sTransactionNumber,

String sRequestedType)

but i cant return a SOAPMessage return type in axis.

Does anyone have any clues how i should sort this out so that the client gets the SOAPMessage and attachment when the method is called ?

Please help :S

Thanks,

[933 byte] By [armaghan23a] at [2007-11-26 22:48:16]
# 1

I dunno if this is what you asked for....

Hope this helps a bit

You may want to check this link out

http://www-unix.globus.org/mail_archive/discuss/2007/02/msg00037.html

MessageContext msgContext = MessageContext.getCurrentContext();

File file = new File("filename.txt");

org.apache.axis.attachments.AttachmentPart replyPart=

new org.apache.axis.attachments.AttachmentPart(new DataHandler(new

FileDataSource(file)));

Message rspMsg= msgContext.getResponseMessage();

rspMsg.addAttachmentPart(replyPart);

so ur basically adding the file to the reply message.

The link i gave has a better description, it has the entire process of sending file to server and downloading file from server codes.

ABC_SUN_a at 2007-7-10 12:07:51 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...