Mark,

After working with Axis for a while then migrating to BEA Weblogic, I have
found that the best way to attach files is to do it through handlers.
However it's equaly as viable to do it in your Web Service for example:

Message message = MessageContext.getCurrentContext().getResponseMessage();
javax.xml.soap.AttachmentPart ap = message.createAttachmentPart();
ap.setContent(new FileInputStream("/home/jkropf/Calc.asmx"), "text/plain");
message.addAttachmentPart( ap );

However if you choose to do the above in a handler, a MessageContext object
will be passed through the invoke method (see sample 4 in axis for handler
implementation). You can then simply call msgContext.getCurrentMessage()
with this object to get the message and start adding AttachmentPart's to it.

Hope this helps

-----Original Message-----
From: Mark Mueller [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 23, 2003 1:27 PM
To: [EMAIL PROTECTED]
Subject: Interoperative attachments


I've been following this list for weeks now and
concepts are slowly sinking in.  I'm still a bit
puzzled by attachments, though.

I'm developing a service that returns a file to the
client.  In the server code I return a DataHandler
object which Axis nicely turns into an attachment. My
concern is the wsdl which describes the type as:
type="apachesoap:DataHandler".  Will non-Java clients
handle this type correctly, or should I be rewriting
my service is some more generic way that avoids using
the DataHandler?

   Mark

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

Reply via email to