Deepak,

Simply "install" Jetty's Transparent proxy in your web.xml. Look at my
comment on Issue 3131, I explain how to set things up in DevMode, but
it would be identical in a production environment:

http://code.google.com/p/google-web-toolkit/issues/detail?id=3131#c46

Philippe

On Aug 12, 12:19 pm, Deepak Singh <[email protected]> wrote:
> Hi Philippe,
> I also have to use proxy servlet in my GWT 2.1 project.
> I have to make cross domain web services call and then the response xml has
> to be sent to client code.
> Can u pls suggest me how to modify this servlet to use for my project so
> that i should be able to make cross domain web service call.
>
> Thanks
> Deepak
>
> On Wed, Aug 11, 2010 at 7:22 PM, Philippe Laflamme <
>
> [email protected]> wrote:
> > Had the same issue. In my case, it was due to making cross-site
> > requests.
>
> > My server was at localhost:8080 and I was running in DevMode at
> > localhost:8888. Making a request from :8888 to :8080 is considered a
> > cross-site request (which is not per the same-origin policy).
>
> > The behaviour in Firefox was that it would return 0 as the status code
> > and prevent accessing the HTTP headers.
>
> > I solved this issue by running a transparent proxy on :8888 in
> > DevMode. The proxy forwards everything to :8080. I provided the
> > solution here:
> >http://code.google.com/p/google-web-toolkit/issues/detail?id=3131#c46
>
> > Hope it helps,
> > Philippe
>
> > On Aug 10, 5:11 pm, Jaya <[email protected]> wrote:
> > > Hi All,
> > > I have deployed the GWT web app ( only client code. no server code is
> > > present) on JBOSS. web client is accessing a URL ( Servlet of
> > > different application. not the GWT servlet)  on the same server  using
> > > POST. The servlet is getting the Request (xml string) from GWT client
> > > app and responding with a xml string ( appeared in the servlet logs).
> > > But the GWT client's  onResponseReceived () always return a status
> > > code 0 with response data null.
>
> > > here  the basic code i am using. no fancy of it.
>
> > >                 String eventParticipationReq="<Count id=\"1\"></Count>";
> > >                 String serverURL="http://myserver:8080/b1/MyServlet?";;
> > >                 Log.info(serverURL);
> > >                 Log.info(eventParticipationReq);
> > >                 RequestBuilder builder = new
> > RequestBuilder(RequestBuilder.GET,
> > > serverURL);
> > >                         try {
>
> > >                           Log.info("Request Data
> > :"+eventParticipationReq);
> > >                       Request response = builder.sendRequest("", new
> > > RequestCallback() {
> > >                             public void onError(Request request,
> > Throwable exception) {
> > >                                 // Couldn't connect to server (could be
> > timeout, SOP
> > > violation, etc.)
> > >                              }
>
> > >                              public void onResponseReceived(Request
> > request, Response
> > > response) {
> > >                                  Log.info(""+response.getStatusCode());
> > >                                  Log.info(""+request.isPending());
> > >                                  if (200 == response.getStatusCode()) {
> > >                                    Log.info(response.getText());
> > >                                } else {
> > >                                  // Handle the error.  Can get the status
> > text from
> > > response.getStatusText()
> > >                                }
> > >                              }
> > >                            });
> > >                       return null;
> > >                     } catch (RequestException e) {
> > >                       // Code omitted for clarity
> > >                         e.printStackTrace();
> > >                     }
>
> > > =====================================================
>
> > > Can some one please let me know what i should  change in the code?
>
> > --
> > 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]<google-web-toolkit%[email protected]>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-web-toolkit?hl=en.
>
>

-- 
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