RequestFactory with JsonRpc

117 views
Skip to first unread message

Miroslav Genov

unread,
Mar 26, 2012, 2:27:08 PM3/26/12
to google-we...@googlegroups.com
Hello,

Was wondering where anyone is using RequestFactory with JsonRpc ?

I'm trying to get it working, due performance issue with the standart serialization of RF, but the RfValidator complains with:  "The type JsonRpcRequestContext must be annotated with Service, ServiceName, or JsonRpcService". The strange part is that my RequestContext already have it: 

public interface JsonRpcRequestFactory extends RequestFactory {

  @JsonRpcService
  public interface JsonRpcRequestContext extends RequestContext {

    @JsonRpcWireName(value = "findAll")
    Request<List<SimpleJsonRpcProxy>> findAll();
  }

  JsonRpcRequestContext simpleRequest();
}

Thomas Broyer

unread,
Mar 27, 2012, 4:57:48 AM3/27/12
to google-we...@googlegroups.com


On Monday, March 26, 2012 8:27:08 PM UTC+2, Miroslav Genov wrote:
Hello,

Was wondering where anyone is using RequestFactory with JsonRpc ?

I believe Google is using it, as there have been some fixes to it this winter.
 
I'm trying to get it working, due performance issue with the standart serialization of RF,

I'm not sure it'll change much things re. serialization performance, but it changes a few things in how you use the RequestFactory. For instance, there's no batching: only one method invocation can be made per RequestContext instance. Also, I'm not sure you can transport graphs of proxies (almost sure you can't). And you'll always send full objects, not diffs of changes as with the "standard" payload dialect.
And last but not least: GWT doesn't give you any server-side implementation (AFAIK, the JsonRpc dialect of RequestFactory has been designed for calling existing JSON-RPC services).
 
but the RfValidator complains with:  "The type JsonRpcRequestContext must be annotated with Service, ServiceName, or JsonRpcService". The strange part is that my RequestContext already have it: 

public interface JsonRpcRequestFactory extends RequestFactory {

  @JsonRpcService
  public interface JsonRpcRequestContext extends RequestContext {

    @JsonRpcWireName(value = "findAll")
    Request<List<SimpleJsonRpcProxy>> findAll();
  }

  JsonRpcRequestContext simpleRequest();
}

It looks like you should run the RfValidator in "clientOnly" mode when using the JSON-RPC dialect. Unfortunately, you can only do that with the command-line ValidationTool.

Eduardo Guardiola

unread,
May 6, 2012, 1:36:45 PM5/6/12
to Google Web Toolkit
Hi,

If it is working for you now. Please, post working code.

Many thanks.
Reply all
Reply to author
Forward
0 new messages