Skip to main content

Passing binary files in webservices

1 reply [Last post]
wakeup
Offline
Joined: 2005-07-19

I need send binary files in my webservice. And I need it can be used by non java clients. Can I do it? Do you have any example?
Thankss

___________________
http://www.hhdirecto.net
http://www.dechiste.com

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
sandoz
Offline
Joined: 2003-06-20

> I need send binary files in my webservice. And I need
> it can be used by non java clients. Can I do it? Do
> you have any example?

You can do this between Java-based JAX-WS services and non Java clients using MTOM. This allows one to send binary content (e.g. a GIF image) that would normally be base64 encoded in an XML document as a binary attachment.

See here [1] to enable MTOM in JAX-WS. Of course your non java clients (e.g. MS WCF clients) will need to support MTOM.

An alternative is to use Fast Infoset[1,2], however at the moment there are no non-Java-based Web services stacks that support Fast Infoset. So Fast Infoset is less interoperable than MTOM.

Stay tuned for non-Java implementations of Fast Infoset and it's use in non-Java Web services.

I would be interesting in hearing more about your requirements on the communication of binary data in Web services.

Thanks,
Paul.
[1] http://java.sun.com/webservices/docs/2.0/jaxws/mtom-swaref.html
[2] http://fi.dev.java.net
[3] http://blogs.sun.com/roller/page/sandoz?entry=how_to_enable_fast_infoset