Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6022379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:51:00+00:00 2026-05-23T03:51:00+00:00

Oh hello there, fellow SO members, I have a web service that returns XML

  • 0

Oh hello there, fellow SO members,

I have a web service that returns XML data using a simple get request that goes like this :

http://my-service:8082/qc/getData?paramX=0169&paramY=2

the service returns raw xml in the page according to the parameters’ values.

I am trying to retrieve this data from a GET request in GWT using RequestBuilder, Request, etc.
However, the response gives me empty text, a Status code of ZERO (which doesn’t mean anything and isn’t supposed to happen), and so on.

Here’s the simplified code that doesn’t work.

public class SimpleXML implements EntryPoint {

public void onModuleLoad() {

    this.doGet("http://my-service:8082/qc/getData", "0169", "2");
}

public void doGet(String serviceURL, String paramX, String paramY) {
    final String getUrl = serviceURL + "?paramX=" + paramX + "&idTarification=" + paramY;

    RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, getUrl);

    try {
         Request response = builder.sendRequest(null, new RequestCallback() {

            @Override
            public void onResponseReceived(Request request, Response response) {
                response.getStatusCode(); // Gives me 0 (zero)  :(
            }

            @Override
            public void onError(Request request, Throwable exception) {
                // ... doesn't matter for this example
            }
        });
    } catch (RequestException e) {
        // ... doesn't matter for this example
    }
}

}

I don’t get why this wouldn’t work, since this is REALLY simple, I’ve seen tutorials and they all show me this way of doing things..

Thanks in advance

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T03:51:00+00:00Added an answer on May 23, 2026 at 3:51 am

    The reason is, that browsers do not allow cross-site requests with AJAX (see Same Origin Policy).

    This means, that you can only call a service on the same server, same port (using the same protocol) as your HTML page. If you want to perform cross-site requests, you can use JSONP, as explained in http://code.google.com/webtoolkit/doc/latest/tutorial/Xsite.html.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello fellow computer people :) I have a shell script that I will use
Hello is there a class that does a pretty conversion?
Hello there fellow Stackers! I wonder if anybody could tell me what the following
Hello Again my fellow programmers out there, I'm designing and programming from scratch a
Hello and thanks for any assistance. using .Net 3.5 C#; Say i have about
I'm using Ubuntu and have a directory called webchat, under this directory there are
Hello fellow programmers I have been searching the internet for a few days now
hello is there a way to import data from excel 2007 file? it is
i have in my visual studio 2007 implemented webpart Hello World. in project there
Hello fellow C++ programmers. I have, what I hope to be, a quick question

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.