GWT - Invoke the default 'greetServer' web service from a browser
I'm absolutely new to GWT, java and eclipse, but I'm an experienced MS programmer.
I installed eclipse and GWT and created a default project (called it test2) w开发者_如何学Cith pre-built sample gwt code. It comes with one java web service on the backend called 'GreetingService' which has a single web method called 'greetServer' that takes a single parameter called 'input'. I tried to invoke it in the web browser with many different combinations, but with no success (my project name is called 'test2):
http://127.0.0.1:8888/test2/greetServer?input=hello http://127.0.0.1:8888/greetServer?input=hello http://127.0.0.1:8888/test2/greetingService/greetServer?input=hello http://127.0.0.1:8888/test2/greetingService?input=hello etc
but I get http error 404 not found.
My question is, how can I invoke the web service from a browser and see the return data? I know this can be done easily with WCF or asmx web services but I'm not familiar with java web services.
Thanks a bunch!
The GWT Remote Service Servlet only uses HTTP Post. If you want to see the data (which will be encoded by gwt anyway) use could use firebug and take a look at the traffic.
The greeting service isn't intended to be a web service. It's a demo of GWT's remote procedure call (RPC) facility over AJAX. As with most RPC frameworks, the server side is only intended to be called from the generated client stub.
精彩评论