There is only one who knows how to make synchronous calls in GWT. He spends most of his time wandering in the desert, and usually kills anyone brave enough to approach him. You'll need a camel...
Just kidding. :-) Walden On Aug 25, 7:24 am, ping2ravi <[EMAIL PROTECTED]> wrote: > Hi All, > > Does any one know how to make Synchronous calls using GWT. > Currently i am using GWT to build services, creating files like > > com.app.client.MyService.java > //One function in this interface > doMyTask(ParamTpye myparams) throws ClientException; > > com.app.client.MyServiceAsync.java > //One function in this interface > doMyTask(ParamTpye myparams,AsyncCallback callback) throws > ClientException; > > com.app.server.MyServiceImpl.java > //One function in this class > doMyTask(ParamTpye myparams) throws ClientException; > > now i create the service and call > MyServiceAsync userService = (MyServiceAsync) > GWT.create(MyService.class); > ServiceDefTarget endpoint = (ServiceDefTarget) userService; > String moduleRelativeURL = GWT.getModuleBaseURL() + "MyService"; > endpoint.setServiceEntryPoint(moduleRelativeURL); > userService.doMyTask(MyParams,CallBackObject); > > This piece of code is working fine as a ASYNCHRONOUS call. > > Then i tried making is synchronous call using following code(i don't > know if its valid or not) > instead of using MyServiceAsync i am using MyService > > MyService userService = (MyService) GWT.create(MyService.class); > ServiceDefTarget endpoint = (ServiceDefTarget) userService; > String moduleRelativeURL = GWT.getModuleBaseURL() + "MyService"; > endpoint.setServiceEntryPoint(moduleRelativeURL); > userService.doMyTask(MyParams); > > But call to doMyTask throw following exception. > java.lang.ClassCastException in MyService_Proxy. > > So i guess this is not the way to make synchronous call in GWT > Can any one point me how to do that. Or its not possible at all in > GWT. > > Thanks in advance., > Ravi. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
