Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
philber fang
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • 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.
 
Balaji Loganathan
author and deputy
Bartender
Posts: 3150
  • Mark post as helpful
  • send pies
  • 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
  • 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
Bartender
Posts: 3150
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
I got it, Thanks a lot, Balaji!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic