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 < philippe.lafla...@gmail.com> 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 <jp.a...@gmail.com> 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 google-web-tool...@googlegroups.com. > To unsubscribe from this group, send email to > google-web-toolkit+unsubscr...@googlegroups.com<google-web-toolkit%2bunsubscr...@googlegroups.com> > . > 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 google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.