users@glassfish.java.net

Re: Recipes for AJAXily talking to SLSB?

From: <glassfish_at_javadesktop.org>
Date: Wed, 07 Nov 2007 14:10:50 PST

It really depends on the complexity and richness of your interface. There's nothing wrong with using SOAP endpoints, you can readily construct and deconstruct SOAP envelopes and replies in your Ajax. It is, after all, just XML. And if you want a literal translation of the SLSB interface as your Dojo API, then that using the Web Services portion of the server will save you the trouble of having to write a facade to handle the translation between your requests and the SLSB API.

If you want a more "REST" like interface, then you'll need to create a facade to the SLSBs, and then you can choose either a hand coded servlet, or something like Restlets, or (I think) the latest WS packs have some kind of REST support.

But, SOAP isn't that bad, it doesn't dramatically change the XML you're sending back and forth (save that you're sending XML vs, say, JSON), and the packets are easily created by hand. Just sniff a few example messages and use them as templates.

Grab NetBeans and create some sample clients and endpoints.
[Message sent by forum member 'whartung' (whartung)]

http://forums.java.net/jive/thread.jspa?messageID=244393