axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Davanum Srinivas <d...@yahoo.com>
Subject Re: Byte arrays in SOAP attachments.
Date Fri, 09 Apr 2004 14:37:01 GMT
does both foo() and bar() work with 1.2Beta? If either fails, please open a bug report. 

thanks,
dims

--- Stuart Barlow <sbarlow@peopledoc.com> wrote:
> Is there any news on this one?
> 
> Joshua Scott Emmons wrote:
> > This has been discussed here before, most completely at
> > http://www.mail-archive.com/axis-user@xml.apache.org/msg12463.html
> > but it seems we haven't been able to come to a resolve.
> > 
> > Can someone state definitively what the "proper" way to send byte arrays 
> > in a soap attachment via axis is?
> > 
> > Everyone seems to agree that a DataHandler should be used, but most 
> > differ on how that DataHandler should be created.  The two main schools 
> > of thought are:
> > 
> > public foo(byte[] bytes){
> >     new DataHandler(bytes, "application/octet-stream");
> > }
> > 
> > public bar(byte[] bytes){
> >     DataSource ds = new OctetStreamDataSource(null, new 
> > OctetStream(bytes));
> >     new DataHandler(ds);
> > }
> > 
> > foo() has the advantage of not requiring any axis-specific imports, 
> > which should help interop. However, in Axis1.1, foo() throws an 
> > exception whereas bar() does not.  There's been talk on the list that 
> > this may be a bug, but no one has said for sure one way or another.
> > 
> > Seriously, folks, how are we supposed to send byte arrays?
> > 
> > Cheers,
> > -Josh Emmons
> > 
> > 
> 


=====
Davanum Srinivas - http://webservices.apache.org/~dims/

Mime
View raw message