• 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

is method return type needs to implement the Serializable interface in webservice?

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I know that all parameters in the service method needs to implements the Serializable, but not sure about the return data of the method?

I need to create a webservice method which would retruns a pdf file, there are a couple of different ways of doing this, one is that I'll open the pdf file and return an inputStream to the client, and the client can read from the stream. But the question is, the inputStream(or BufferInputStream) doesn't implement the Serialization, is it needed?

Or any other ways, return a byte array?

Thanks in advance.
 
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by philber fang:
return a byte array?


Inputstream is not serializable, and not interoperable.
bytearray is good choice.
 
philber fang
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Balaji Loganathan:

Inputstream is not serializable, and not interoperable.
bytearray is good choice.



Thanks a lot for your reply Balaji, so you mean the return type needs to implement the Serializable interface.

But I don't understand, what do you mean by "not interoperable"?

thanks
 
Balaji Loganathan
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by philber fang:


Thanks a lot for your reply Balaji, so you mean the return type needs to implement the Serializable interface.

But I don't understand, what do you mean by "not interoperable"?

thanks



Interopearability in the sense of communicating soap messages between various platform like php, java, .net etc.,

If you use the primitive data types(like int, byte, string, char) then most the serialization process is taken care by sofware solution provider itself(for example axis, .netframework). For other types you have explicitly configure your applicaiton in the deployment descriptor and so on.
 
philber fang
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I got it, Thanks a lot, Balaji!!
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic