This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
I have implemented a webservice which does conversion of tiff to pdf on a fly. I want that as soon as a new tiff document is added the webservice is called and convert it to pdf.Is it possible to use AJAX in this scenario to call web service?Can AJAX be a client to a webservice? Does your book cover some examples of calling webservice using AJAX?
2. Also I will be using DHTML for generating dynamic tables,clicking and highlighting of rows, event handling etc.Will this book has some examples for this?
Yes, AJAX can be used as a client to a web service. The only issue you'll haev to deal with is you'll have to roll all your own protocols, i.e., if you want to retrieve WSDL and use it, you can do that via AJAX, but you'll have to write the code to parse the WSDL and use it. Likewise, to make a SOAP-based request, you can again do that with AJAX, but you'll have to write the code to generate the wrapper, set headers appropriately, etc.
I do cover calling web services in my book, but it's not the "full stack" web services most people mean these days, i.e., SOAP, WSDL, etc. It's the web services offered by companies like Google and Yahoo using things like JSON and the like.
One thing you won't be able to do with AJAX however is send the TIF... there's no way to upload files with AJAX at the present time. Likewise, while you could technically retrieve a PDF via AJAX, you wouldn't be able to do anything with it because what you get back with AJAX is text (or an XML DOM), but it won't understand a PDF, and you can't pass it along to another handler or something like that.
These issues I believe are addressed by the latest HTTP spec (or is it HTML spec? I forget)... but whichever it is, we all know how slowly that moves, so it'll be 4 years before we have a standardized XMLHttpRequest object that does all this stuff anyway By that time we'll probably have moved on to something bigger and better anyway!
Joined: Dec 22, 2006
Thank you for the wonderful information! I guess I wont use AJAX for this web service but I am on my way of implementing others. So I hope AJAX will be useful in that.