This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Web Services and the fly likes InputStream type in WSDL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "InputStream type in WSDL" Watch "InputStream type in WSDL" New topic
Author

InputStream type in WSDL

B pandoo
Ranch Hand

Joined: Nov 14, 2006
Posts: 37
Hi ,

I need to send the InputSream as Web service response.But WSDL is not supporting the type: InputStream.I tried to convert InputStream to byte array and tried sending it through WebService.Still the WSDL does not support the byte array type.So please let me know how can i send a inputstream as response through web service.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42374
    
  64
You can't send an InputStream object - it is not serializable. Sending the bytes that make up the stream also won't work - they need to be converted to ASCII. Youd could use base-64 encoding to obtain an ASCII representation of the byte array, and then send that as a string (which is one of the data types WSDL supports). The Jakarta Commons odec library has classes that can perform base-64 encoding/decoding.


Ping & DNS - my free Android networking tools app
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: InputStream type in WSDL