aspose file tools*
The moose likes Web Services and the fly likes is method return type needs to implement the Serializable interface in webservice? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "is method return type needs to implement the Serializable interface in webservice?" Watch "is method return type needs to implement the Serializable interface in webservice?" New topic
Author

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

philber fang
Greenhorn

Joined: Dec 30, 2004
Posts: 12
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

Joined: Jul 13, 2001
Posts: 3150
Originally posted by philber fang:
return a byte array?

Inputstream is not serializable, and not interoperable.
bytearray is good choice.
philber fang
Greenhorn

Joined: Dec 30, 2004
Posts: 12
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

Joined: Jul 13, 2001
Posts: 3150
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

Joined: Dec 30, 2004
Posts: 12
I got it, Thanks a lot, Balaji!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: is method return type needs to implement the Serializable interface in webservice?
 
Similar Threads
Threads within Struts framework
How to understand Passed by Reference or Copy of Value for Local or Remote Interface?
Disabling PDF's Navigation bar and Tool bar using stream in servlet.
sending pdf or any attachment from a java webservice to java client using JAX-WS and SAAJ
can we serialize InputStream and OutputStream object?