1
我正在嘗試讓RPC調用與phonegap一起工作。我下面就http://blog.daniel-kurka.de/2012/04/gwt-rpc-with-phonegap-revisited.htmlPhonegap RPC安裝問題
PhonegapUtil.prepareService(service, "http://www.yourserver.com/", "greet");
說明當我看着這個方法我可以看到該服務的類型必須爲PhonegapRPCService的,否則將拋出一個錯誤的執行。實現具有下面的代碼
if (!(service instanceof PhonegapRPCService)) {
throw new IllegalStateException("the rpc service you are trying to use was not generated by Phonegap RPC Serivce Generator");
這裏是我到目前爲止的代碼
ContactsServiceAsync rpcService = GWT.create(ContactsService.class);
ServiceDefTarget endpoint = (ServiceDefTarget) rpcService;
PhonegapUtil.prepareService(endpoint, "https://myquizapp2.appspot.com/", "contactsService");
HandlerManager eventBus = new HandlerManager(null);
AppController appViewer = new AppController(rpcService, eventBus);
appViewer.go(RootPanel.get());
問題是我不知道如何創建一個PhonegapRPCService實例將調用我的contactsService服務我的服務器上。任何想法如何使用這個?