Hey Reinier,

I am happy to hear that you agree with my approach so far (and even
use it yourself). Since I will only use GWT to communicate with the
app on the server I see no reason to adopt JSON, so were almost there.

Problem here is that I still need somewhere to add that sessionID into
the request from the client to the server. I have to admit that my
basic Java knowledge now seems to fail somehow here. I have attempted
to use the method suggested by Gregor earlier in this thread, however,
I can't figure it out.

>From what I can figure out about the code from Gregor one would
subclass (or subinterface I guess) the interface of the RemoteService
into the SecureRemoteService for instance. However, I do not
understand how to proceed from there.

I think I modified the example enough to show how far my knowledge
goes right now, but there are some issues with my idea: First the code
example:

--- Code, I hope this formats reasonably in the post. ---
public interface SecureRemoteService extends RemoteService {

        /**
         * Utility/Convenience class.
         * Use SecureRemoteService.Async.getInstance() to access static
instance of IpsvRmapServiceAsync
         */
        public static class Async {
                private static Async ourInstance = null;

                public static synchronized Async getInstance() {
                        if (ourInstance == null) {
                                ourInstance = (Async) 
GWT.create(SecureRemoteService.class);
                        }
                        return ourInstance;
                }

                public void setServiceEntryPoint(String entryPoint) {
                        // This is where the magic happens.
                        ((ServiceDefTarget) ourInstance).setServiceEntryPoint
(GWT.getModuleBaseURL() + entryPoint + "?sessionID=" + getSessionID
());
                }

                private String getSessionID() {
                        // Do stuff to get sessionID
                        return "SessionID";
                }
        }
}
--- End of code ---

>From what I can see, this should work if the interface extends the
SecureRemoteService instead of the normal one. However, to properly
create an instance of this class, the programmer now has to do
something different from the normal procedure. Instead of calling the
normal GWT.create(someService.class) and casting it to the Async
version, he has to call on GWT.create(someService.Async.class). This
means he has to modify all of his proxy creation statements as well.

Is there any way to get around this?

Thanks, Patrick

PS: Graag gedaan.
--~--~---------~--~----~------------~-------~--~----~
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