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?
> 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  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.
Your use of this web site or any of its content or software indicates your agreement to be bound by these Terms of Participation.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.