We ended up creating a RPC services factory class that would create a static instance of the service endpoint and also seed it with the right endpoint; something like this:
public class ServicesFactory
{
public static final RPCServiceAsync RPCService = GWT.create(RPCService.class);
static
{
((ServiceDefTarget) RPCService).setServiceEntryPoint(GWT.getHostPageBaseURL() + RPCService.END_POINT);
}
}
Note that END_POINT is defined in the service interface itself.
Thanks man. It was very helpful!
ReplyDelete