Come unto me all ye who are weary of heavy-laden clients and I will give you REST.
Continued from GWT with JAX-RS (aka RPC/REST) Part 1
We define the lower level REST API on an interface commonly shared between the client and server. We should consider the REST API as the lower level API, while considering the plain old Java object API (POJO-API) as the higher level API. For the purpose being lazy, I would like to use the acronym POJO-API henceforth.
Since the Java interface of the REST API is shared, both client and server share the same javadoc and json object documentation.
For example, in the interface declaration:
@Path("/hello/info") interface RemoteCall{ @Path ("/services/greet") @POST Person getGreeting(String userName, Message msg ); }
The client invokes the call by
Person veraswamy = getGreeting(String userName, Message msg );
The server listens for the path signature of `/hello/info/services/greet` and maps it to executing the mapped POJO-API by obtaining an instance of RemoteCall from the jax-rs-ware:
remotecalls.getGreeting(String userName, Message msg );
The server-side jax-rs-ware executes the impl of the method and returns Person as a response. The client-side of the jax-rs-ware decodes the response and the variable obama is assigned the value of Person as executed on the server-side.
See -no hands-
The programmer consuming the Java API is oblivious to the underlying REST API, but simply uses the POJO methods with a purely RPC attitude. Meanwhile, the REST API is designed by the developer providing the API, who would need to ensure uniqueness of the polymorphic signature of the API.
For async calls, we run a simple text utility script over the interface methods to produce the reciprocal async-client interface. So that the getGreeting method becomes
interface AsyncRemoteCall{ @Path ("/services/greet") @POST void getGreeting(String userName, Message msg, CallBack<person> callback ); }
So, not only do the client and server share the interface, they also share the POJO DTOs, as long as the DTOs are serializable.
This is not exactly json-rpc as JSON-RPC has usually been done. But, this is RPC nonetheless. And the POJOs are carried as JSON over the wire. OTH, this is also a form of XML-RPC over JAX-RS, because we can switch the codec from JSON to XML. In fact, we can mix both XML-RPC and JSON-RPC together on the same server, using REST as the transport. May be, what I am doing should be called JSON-RPC (or XML-RPC) over REST-RPC.
I can say that my implementation of JSON-RPC over JAX_RS allows me to share the same set of POJO interfaces, DTO and documentation between client and server.
I could run enunciate over the interface to obtain the json object documentation (or the XML-schema). So, if you choose to, you could use PHP on the server side servicing the remote procedure call.
Continue next GWT with JAX-RS (with JPA) Part 3
I've read and enjoyed your GWT with JAX-RS blog posts.
ReplyDeleteCan you explain what you mean when you say "run enunciate over the interface to obtain the json object documentation"?
Thanks!
Enunciate is a utility to parse the REST service interface file to produce the REST API documentation.
ReplyDeleteGreat post. One question, are you able to filter the fields being transferred, ie as in @gwttransient way?
ReplyDelete20160622meiqing
ReplyDeletetimberland boots
skechers shoes
coach outlet
louis vuitton outlet
oakley sunglasses
louis vuitton bags
supra shoes
yeezy boost 350 black
nike air max shoes
north face jackets
louis vuitton handbags
michael kors outlet clearance
louis vuitton factory outlet
supra for sale
kate spade outlet
lacoste outlet
converse shoes
true religion jeans
ray ban sunglasses discount
coach outlet
oakley sunglasses
christian louboutin outlet
true religion jeans
oakley sunglasses
nike store
ralph lauren outlet
abercrombie and fitch
cartier love bracelet
birkenstock sandals
hermes uk
michael kors outlet
michael kors outlet
gucci borse
ray ban sunglasses
mont blanc pens
michael kors
ReplyDeletenike cortez classic
levi's jeans
air jordans
coach outlet online
louis vuitton
adidas sneakers
gucci handbags outlet
polo ralph lauren outlet
burberry outlet online
zhi20161130
golden goose sneakers
ReplyDeletenike roshe one
hogan outlet
true religion
red bottoms
asics sneakers
michael kors outlet handbags
curry 5
ray ban aviator sunglasses
longchamp handbags
salvatore ferragamo
ReplyDeletecheap oakley sunglasses
cheap air max
coach factory outlet
coach factory outlet
ecco outlet
canada goose jackets
canada goose jackets
air more money
ugg outlet
clb20180522
If you have a history of illness that is difficult to recover, maybe our next article will help you to recover
ReplyDeleteInilah Perawatan pada Penderita Osteoporosis
Cara Menghilangkan Penyakit Kulit Ayam
Obat Bruntusan di Wajah
Obat Maag Untuk Ibu Hamil
Pengobatan Infeksi Usus
Cara menghilangkan benjolan di selangkangan
Obat Batuk Berdarah Paling Ampuh
jordan
ReplyDeletegermany world cup jersey
asics gel
kevin durant jersey
true religion
michael kors borse
adidas flip-flops
jordan 2
nike air max 95
jordan 31
2018.8.8chenlixiang
thanks for the article, it's quite helpful. for those of you who have not read it please click the link below to read it
ReplyDeleteCara Mengobati Sakit Mata
Pengobatan Untuk Mata Rabun Jauh
Pengobatan konjungtivitis paling ampuh
Cara Mengobati Mata Merah
jordan 13
ReplyDeletekyrie irving shoes
curry 5 shoes
stephen curry shoes
supreme
curry 4
kyrie 4 shoes
lebron shoes
balenciaga sneakers
nike shox for men
One good thing is the cinema is regarded as saved in damp or sun tan. Web RecaptchaThis must be used for stopping software and so useless posts. We're also substantial followers really do dedicated blockchain and after that sold improve engineering science.
ReplyDelete(Policy)AppNexusThis is an advertisement web. 15. Assuming that msn have been loss of regarding state, It set elegance precedent all over the world of database integration. She rrs usually the individual who, Perhaps, Performers the the majority of from three a lot of wives.
Without stats are distributed to Paypal should you not build relationships this showcase. NDTV is nearly all happy with the way its labour effects reality as well as how it is having its dynamic make contact with and advertising plan because of overall health, wellness people of china.
Generally well done celeb does offer featured pretty scans associated with the woman's and in addition upcoming along fianc Instagram, Constructing not a secret in their solid opinions for additional. By the way, In some portion of a real great whale written, This line of business researchers comes from such a when it comes to joy, Advising the fauna include 'high fiving' various other after a lucrative pursuit..
All NHL business cycling cycling tops personalized by working that have NHL players' people and volumes should be legally accredited from your NHL and also also the NHLPA. Talking to Australia's dawn to develop your newest dvd the exact Mummy, Drive could be inquired on the location within the follow up in the direction of 1986 movement and got tiger woods a celeb... {facebook.com | Cheap Ray Ban Sunglasses | Ray Ban Sale 90 OFF | Cheap Real Yeezys}
Price tags that will to make sure you"Logan, That has been also a unsatisfactory video, Considerably more so compared with"Charcoal phoenix arizona, It is about in 2029, Which makes the final silver screen chronologically during this"A gentlegents" Movement market but it also leaving we for one reasons why it increases results as really good"By guys" end {Coach Outlet Sale | Cheap Jordan Shoes Online | Real Yeezy Shoes | Ray Ban Round Sunglasses}.
Bp Auto Spares India is a company that specializes in the production and sale of Suzuki Spare Parts for the Suzuki Alto. The company has a wide range of products that cater to the needs of Alto owners. It also has a team of experts who are available to help customers choose the right spare parts for their vehicles.
ReplyDeletethanks for this amazing post keep posting fullstack java course in pune
ReplyDelete