Simply put, you don´t, because the call itself won´t return anything.

The "return type" is defined inside the AsyncCallback.
If you have an interface like so:

public interface GreetingServiceAsync {
        void greetServer(String input, AsyncCallback<String> callback);
}

String will be your "return type".


Then you make a call to your service, and when it returns (hopefully
successful)
you can handle the String in the onSuccess event handler.

greetingService.greetServer(textToServer, new AsyncCallback<String>()
{
                                                        public void 
onFailure(Throwable caught) {
                                                                  //
Handle failure
                                                        }

                                                        public void 
onSuccess(String result) {
                                                              //Do
some stuff with result
                                                        }
                                                });

What you need to do is basically change AsyncCallback<String> to
AsyncCallback<Request>.
Also change the return type for your syncronous service to Request.



On 10 Juni, 19:29, Maddy <[email protected]> wrote:
> Hi,
>
> How can I change the return type of Asynccallback methods from void to
> 'Request'. Some where in the forums, I read that we can change the
> return type to 'Request' object. But When I tried, It is giving me
> compilation error. Please let me know, how this can be done.
>
> Thanks
> Maddy
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to