Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {"id": 2, "result": {"Planet": {"Earth": 1, "Mars": 2,....
- Map<String, Map<String, Integer>>
- {"id": 1, "result": ["Planet", "Stars"], "error": null}
- import com.google.gwtjsonrpc.common.AsyncCallback;
- import com.google.gwtjsonrpc.common.RemoteJsonService;
- import com.google.gwtjsonrpc.common.RpcImpl;
- @RpcImpl(version=RpcImpl.Version.V2_0,transport=RpcImpl.Transport.HTTP_POST)
- public interface ControlService extends RemoteJsonService
- {
- RegisterValues RegisterValues = new RegisterValues(); //Used in the Second Example
- public void connectedCNames( String [] Names, AsyncCallback<String[]> callback ); //FirstExample
- public void myRegisterValues( String [] Names, AsyncCallback<Map<String,RegisterValues>> callback); //Second Example
- //public void myRegisterValues( String [] Names, AsyncCallback<Map<String,Map<String, Integer>> callback); //version that doesn't work but should
- }
- import com.google.gwtjsonrpc.common.AsyncCallback;
- public class createPanel implements ChangeHandler{
- public mainPanel{
- //Some code setting up the panels
- service_ = GWT.create(ControlService.class);
- ((ServiceDefTarget) service_).setServiceEntryPoint("http://localhost:3900/services/ControlProxy.py");
- service_.connectedNames( new String[0], new AsyncCallback<String[]>() {
- public void onSuccess( String[] result)
- {
- //This works, it returns back a parsed JSON Object in the form of an array of strings as expected
- }
- public void onFailure(Throwable why)
- {
- myList_.addItem( "Server error!" );
- }
- });
- }
- }
- {"id": 2, "result": {"Planet": {"Earth": 1, "Mars": 2,....
- public void myRegisterValues( String [] Names, AsyncCallback<Map<String,Map<String, Integer>> callback);
- service_.myRegisterValues( names, new AsyncCallback<Map<String,Map<String, Integer>>();
- public void RegisterValues( String [] Names, AsyncCallback<Map<String,RegisterValues>> callback);
- public class RegisterValues
- {
- int Earth;
- int Mars;
- //etc.
- 02:18:48.395 [ERROR] Errors in 'generated://AF9BA58B045D92E7896CD657C9CC5FAF/example/client/GlibControlService_JsonProxy.java'
- 02:18:48.395 [ERROR] Line 18: INSTANCE cannot be resolved or is not a field
- 02:18:48.398 [ERROR] Failed to create an instance of 'example.client.ControlService' via deferred binding
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement