Mark,

As far as I know, WSDL does not have any sort of mechanism for describing
attachments... hence each vendors slightly different implementation of an
attachments interface. Your client (or server for that matter) will have to
be aware that an attachment is present and attempt to extract it from the
attachment parts.

BTW... I am assuming you are attempting to make your web service work with
multiple platforms? Are you attempting to use non-Java clients with axis at
any point?

-----Original Message-----
From: Mark Mueller [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 27, 2003 4:32 PM
To: [EMAIL PROTECTED]
Subject: RE: Interoperative attachments


Josh,

This was very helpful -- thanks a lot!  I've
implemented my service this way, and I return the URL
of the attachment content-id as the return-value of
the call.

I have another question.  The WSDL created by
Java2WSDL doesn't mention the file that I return as an
attachment.  Should I revise the WSDL by hand
so that the binding includes something like this:

<mime:multipartRelated>
  <mime:part>
     <soap:body parts="body" use="literal"/>
  </mime:part>
  <mime:part>
     <mime:content part="file" type="audio/x-wav"/>
  <mime:part>

Do I need some sort of mime stuff in the binding
section for my server to work with a variety of
clients?

   Mark

--- Josh Kropf <[EMAIL PROTECTED]> wrote:
> 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
>


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

Reply via email to