can't you just do:
doTaskCallBack {
onResponse(...) {
userService.doSynchronousTask(...);
}
}
Wouldn't that just give the synchronous effect?
On Mon, Aug 25, 2008 at 6: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
-~----------~----~----~----~------~----~------~--~---