Do I need web service, or Hessian, in this case?

I am a newer in java, and I want to write a bbs. For get a thread info, I design an interface like this:

client request:

server response:

xml data for this thread

But someone tell me that I should use web service or Hessian here. I don't know what advantage of these and if he is right, please tell me how should I do, thanks!

2 Answers

Depending on your needs, you can/should use one or the other. Web Services it's a wide and common technology, you can implement a webservice in PHP and consume it with a Java client, for example. Thus, if you plan to expose your api to the public and don't want to restrict the client's programming language, you should use web services. BUT web services are heavy and slow (due to SOAP enveloping).

In the other hand, which I think it's your case, if you are doing the whole application and you are developing both the server and the client and can choose a single language (Java) to program both of them, you should go with a Java's native solution. In fact, Hessian it's a lightweight binary HTTP-based protocol, which means it's faster than Web Services.

Let me give you a link, maybe it will help you to understand the topic:

4

if your are considering for the java then i suggest you to read about axis 2 web service they will work a lot for you . But as per your comment on the answer that you need to generate the web service specially for the mobile domain than you need to generate most of the data in to the json or xml response for that you can use java lib for generating source data int o the specific fornate data.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like