Excerpt: Ajax and Java Web Services

Discussions

News: Excerpt: Ajax and Java Web Services

  1. Excerpt: Ajax and Java Web Services (8 messages)

    This chapter from "SOA Using Java Web Services" examines how to build an Ajax front-end to an online shopping application. Through detailed code examples, it walks you through building an Ajax application that consumes RESTful Java Web services endpoints.
    Some of the more important takeaways from this chapter are as follows:
    • Ajax and Java EE support a nice separation of concerns, where server-side Java EE handles the hard-code SOA integration and deployment of Web service endpoints, and Ajax provides an attractive and user-friendly front-end.
    • The entire application, Ajax front-end, and Java EE back-end can be bundled as a single EAR for painless deployment to any Java EE application server.
    • Creating Ajax applications requires a mastery of JavaScript and HTML DOM that may not be familiar to most server-side Java EE programmers. However, as I illustrated in the SOAShopper search example presented here, it is not too difficult to pick up those skills.
    • When creating and deploying Java EE service endpoints, it is probably good practice, at least for the more complex services, to create a simple Ajax front-end to go along with the service. An Ajax frontend makes it easy for the consumers of a service you have written 480 Ajax and Java Web Services to visually experience the data your service returns. The ability to "play" with a Web service in such a manner can give a developer a much better intuitive sense for the service interface than a WSDL or XML schema.

    Threaded Messages (8)

  2. Use Google Web Toolkit[ Go to top ]

    You can write your Ajax client in Java using GWT and avoid the need to master JavaScript. You still need to understand the HTML DOM and be pretty good with CSS but thats a lot easier than having to be a JavaScript pro and deal with all the cross browser issues. Cheers David
  3. Yahoo UI Toolkit[ Go to top ]

    I found Yahoo UI Toolkit very useful. What I do not like about GWT is that it is based on the assumption that most of us Java Developers like Swing like development. In fact a vast majority of us do not even know how to do it well. Yahoo UI toolkit requires one to come up to speed with some basic Javascript but all the wicked cross browser issues and 508 compatibility are fully abstracted out. There is also a good api for making AJAX connections to the server. I believe DOJO is also the same but I have not used it. Sameer
  4. Re: Yahoo UI Toolkit[ Go to top ]

    Anyone that enjoys swing development is one sick puppy. =p
    .. What I do not like about GWT is that it is based on the assumption that most of us Java Developers like Swing like development...

    Sameer
  5. Tibco GI is pretty good too[ Go to top ]

    If we're talking about a rich palette of GUI components and ease of development, Tibco GI is doing a fantastic job there. Its free, has a great IDE and comes with a Apache License
  6. DWR[ Go to top ]

    GWT is very abstarct and not popular yet. So, I think DWR much better. Well, there U should know JavaScript. But what people will write AJAX-application without JS knowledge?
  7. Use soapUI[ Go to top ]

    You (and your service consumers) could also use soapUI for playing around with a web-service and getting a feeling for the data it returns, it's probably easier than creating a dedicated ajax client and has better support for ws-related standards.. (and a sleuth of other stuff..) cheers! /Ole eviware.com
  8. The Book Uses Dojo[ Go to top ]

    FYI ... the sample code in this chapter uses the Dojo JavaScript toolkit (http://dojotoolkit.org/). I found it pretty easy to work with. Rather than a "mastery" of JavaScript, I think developing an Ajax front-end requires a good toolkit plus "familiarity" with JavaScript :) Mark Hansen Author of "SOA Using Java Web Services" http://soabook.com
  9. If you want to do Ajax with your Web Services, I advice you to have a look at XINS ( http://xins.sourceforge.net/ ). The Web Services developed with it accept RESTful, SOAP, XML-RPC but also since version 2.0 "Yahoo! JSON" which is easy to use with Google Web Toolkit and JSON-RPC (1.0 and 1.1) which is easy to use with the DOJO toolkit. It also generates the SMD (Simple Method Description) that the DOJO toolkit understands. Click Here to see the code for an Ajax call to a Web Service using the DOJO toolkit. Anthony