• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Binary Data type in wsdl

 
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am using Document/Literal Style in J2EE 1.4 container. I want to send the binary data through webservices. I want to know what is the binary data type i need to use in java/wsdl. I used the data type java.sql.Blob but it failed. Any help is appreciated on this.
Thanks
Sudha
 
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sudha,

Logically HTTP is a text base protocol so you can't send the binary data,but this binary data is converted using base64 and treat is as string.It increase the size by 30%. You can send binary data using MTOM You need to define the base64 data type in your xsd file and underline binding will convert the binary data to string.

FYI - SOAP Messages with Attachments

Regards
Vijay
 
sudha swami
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Vijay,
In Webservice code, used the following

byte[] data;

and generated the wsdl. The following element is generated in wsdl:

<element name="data" type="xsd:base64Binary"/>

Is this correct?

Or do i need to use String data;

Thanks
Sudha
 
Vijay Kumar
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sudha,

It seems correct , you can create your web service according to last post

--Vijay
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic