Comparison of Java RPC and WebServices

How do you compare Java RPC and Java Web Services. I have little experience with web services. Now I need to know how RPC compares with web services. How does RPC work?

Addition:. When will we move on to any of the options?

+7
java web-services rpc
source share
4 answers

As Duff says, Java RMI really only refers to Java-to_Java messages. In terms of ease of development these days, the degree of coding from the point of view of the service provider is pretty similar.

However, in addition to performance issues, when the gap between WebServices and RMI is quite variable (there may be a slight difference for some message sizes), there is one more aspect that should be considered: stability.

As a rule, RMI is easily configured when one client is talking to one server, and you do not mind the availability of a client connected to one server. Server down, client down, this is life.

In the case of a web service, you can easily deploy your service on a server cluster, and given that you are invoking the web service through HTTP, you can easily use all the usual network routing and atomization methods used in larger networks. No special encoding is required on the server or client.

Now you can get the same level of fault tolerance with RMI, but that requires a slightly better service delivery infrastructure, and exactly where the Java EE EJB programming model (or frameworks like Spring) are used. EJB uses RMI over IIOP, a protocol that allows failover access to server instances, transparently handling server failures. [It does a lot more, like secutiry and transactions, but then it could be Web Services. Interesting, but not part of this discussion.]

Bottom line: to ensure the quality of quality service, I usually start by creating a service facility. I use Java EE EJB 3, other people use Spring. You can open this service object as a web service or as an RMI / IIOP with a very simple configuration / annotation. It is very little effort to choose one or both. My world happens to be major on interop, so I tend to show web services. If you only have Java, this can lead to some performance improvements for using RMI / IIOP, but this is not guaranteed, you will need to measure performance to be sure.

+7
source share

I assume you mean RMI with Java RPC. The call to the remote method is very specific to Java, and therefore it is easy to handle in native Java programs (Java on both sides). It uses a binary format for data transfer and does not work over HTTP, so it is probably faster than the webservice solution.

Webservices, on the other hand, use a (generally) common format, such as XML or JSON, that can be requested and read by any other remote application. The overhead is greater (creating an HTTP request and serializing / deserializing the data), but the client using the web service does not care how the web service generates this data and does not rely on a specific programming language if it is in the specified format.

So, what technology you want to use depends on whether there can be non-Java clients who want to use your service.

+1
source share

If you look at the RPC vs Document web services, this question and answers may be what you are looking for.

http://www.coderanch.com/t/443021/Web-Services-Certification-SCDJWS/certification/Difference-between-RPC-Document-web#1971102

I could explain this, but when someone discusses with code examples to see, my answer will be pale in comparison.

Also, I'm not sure what you're asking, I think terminology can be a problem here.

0
source share

RPC is used only when the same EJB platform is used only for Java at both ends.

Q: What if some non-Java application wants to access my service?

A:. Where web services are presented Web services may also be non-Java. It is also used for synchronous as well as asynchronous communication.

0
source share

All Articles