|
|
|
|
|
Re: How to call Web Service form Rich Ajax Platform (RAP)? [message #732357 is a reply to message #732344] |
Tue, 04 October 2011 15:08 |
|
It is certainly possible to add another servlet to the RAP application since it is based on OSGi and uses HttpService to register it's own servlet. You can look up the HttpService via OSGi and register your own servelets, or you can use the extension points provided by org.eclipse.equinox.http.registry. Setting up CXF may be more complicated if it isn't designed to run under OSGi, but I think your approach to modifying the web.xml should work as long as the servlet-class you specify is available.
Why would you need to call a REST service from the browser in RAP? The point of RAP is that your code is run on the server side. The only reason I can think to do this is if you have a Browser widget within your RAP application that is displaying some HTML/javascript which calls back to the server. Be aware that these requests will not be associated with the UI thread in RAP, so extra work will be required to associate requests on the REST service with RAP sessions. For example, things like RWT.getRequest() and PlatformUI.getWorkbench() and Display.getDefault() will not work in your REST servlet.
Good luck,
Cole
|
|
|
Re: How to call Web Service form Rich Ajax Platform (RAP)? [message #733376 is a reply to message #732357] |
Tue, 04 October 2011 15:42 |
Edin Edin Messages: 101 Registered: January 2010 |
Senior Member |
|
|
Hi Cole,
well i have the following situation. My RAP applikation has some features that can be normally used over the GUI, sth like: user gives an adress in textfields and gets messagedialog whether this adress is correct or not. The Class checking the adress is running inside of my RAP application and its pretty complex. Right now i want to give an other application (not a RAP application) the possibility to call this method of my RAP application for adress checking. my RAP application then should give back a XML file containing only few tags, telling wheter the adress is right or wrong. so i thought the best way would be to write a RESTfull service that takes the adress as HTTP GET(consisting of some parameters:street, nr, city etc.) and returns an Integer in a xml file, that suggests if the adress is correct. With that xml File the other application can do than some other stuff.
I spoke about the browser because, if i integrate some REST service i would like to know, how to call that service from the firefox, just for testing if the service is working, i am not able to test it from the other application, but when i see the xml file on the firefox, i will know that it works.
|
|
|
Powered by
FUDForum. Page generated in 0.03264 seconds