Saturday, April 14, 2012

Re: RPC - can't get to remote server

You start your GWT app and your Netbeans server app independently of each other? If so, you have run into the Same-Origin-Policy implemented by web browsers (http://en.wikipedia.org/wiki/Same_origin_policy). This means that your GWT application that is running on http://127.0.0.1:8888 can only make JavaScript Ajax requests to locations also available on http://127.0.0.1:8888. It can not access locations on a different protocol://host:port combination.

You can solve this using one of the following ways:
1.) Run your GWT frontend on the same protocol://host:port as your Netbeans server project (= deploy your GWT app to your Tomcat server and use GWT DevMode with the -noserver option).
2.) Let your GWT frontend have its own server part that communicates with your Netbeans server project on your Tomcat server.
2.) Implement CORS (http://en.wikipedia.org/wiki/Cross-origin_resource_sharing)
3.) Use a reverse proxy that transparently maps http://127.0.0.1:8888/<your GWT App Name>/GWTServlet to http://127.0.0.1:8084/MyApp/GWTServlet

And maybe:
4.) Use GWT's JsonpRequestBuilder along with JSON services on your server instead of GWT-RPC (http://en.wikipedia.org/wiki/JSONP).


Btw: Your server implementation of GWTServlet should implement the ArahantService interface.

-- J.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/eGN2WL84QU0J.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate