How to share an RPC RemoteServiceServlet between apps?

90 views
Skip to first unread message

Rob

unread,
Mar 9, 2012, 10:10:52 PM3/9/12
to google-we...@googlegroups.com
Hi,
I want to have a service used by several modules. I put the implementation servlet in a root web app, and connected to it, from the client side, by specifying the endpoint like this...

  ServiceDefTarget t = (ServiceDefTarget)service;
  t.setServiceEntryPoint("/commonService");

So "/commonService" is url path that maps to the servlet.  But when it connects I get errors on the server side:

  ERROR: The serialization policy file '/forums/discussions/7B344C69AD493C1EC707EC98FE148AA0.gwt.rpc' was not found; 
  did you forget to include it in this deployment?

So it appears that on the server side, in the shared web app, it's looking for an rpc file with a path "forums/discussions" which is specific to the client module.  I can get things to work by copying these files to the shared web app, but that means I'll have to create copies of the .rpc files at different paths for every client that uses the shared service.  

Is there way way to avoid this by telling the servlet where to find the rpc files, or ... ?

thanks,
Rob


Alfredo Quiroga-Villamil

unread,
Mar 10, 2012, 12:54:08 AM3/10/12
to google-we...@googlegroups.com
Rob:

If I am not mistaken you can override in your ServiceImplementation a couple of methods (your choice which one). In RemoteServiceServlet, you will find:

getSerializationPolicy
doGetSerializationPolicy

Likely the latter will be easier to override. There, "moduleBaseURL" should help you do what you want. You'll have to set it to the same baseURL regardless of what the client sends.

Hope that helps.

Regards,

Alfredo

--
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/-/iIzZ0K7XhEgJ.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.



--
Alfredo Quiroga-Villamil

AOL/Yahoo/Gmail/MSN IM:  lawwton


Rob

unread,
Mar 17, 2012, 6:06:55 PM3/17/12
to google-we...@googlegroups.com


On Saturday, March 10, 2012 12:54:08 AM UTC-5, Alfredo Quiroga-Villamil wrote:

If I am not mistaken you can override in your ServiceImplementation a couple of methods (your choice which one). In RemoteServiceServlet, you will find:

getSerializationPolicy
doGetSerializationPolicy

Likely the latter will be easier to override. 

Overriding doGetSerializationPolicy worked, thanks.  The code in RemoteServiceServlet.loadSerializationPolicy shows you how to do it.

Rob
Reply all
Reply to author
Forward
0 new messages