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/[EMAIL PROTECTED]/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





Reply via email to