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 9066233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T16:41:31+00:00 2026-06-16T16:41:31+00:00

I have some REST services on my server (Jetty, RESTeasy) and a GWT client.

  • 0

I have some REST services on my server (Jetty, RESTeasy) and a GWT client.
I choosed to use Restlet-GWT module on the front end.

I made a JSE client (RESTeasy client) and my service is well called (i see SQL trace in the log of Jetty server) and i get an xml response.

Then i tried from GWT with Restlet. The web service is called (Jetty log) but i have a null response.

Web service (Back end):

@GET
@Path("/getArt/{id}")
@Produces("application/xml")
public Art getArt(@PathParam("id")int id){
    Art art= artDAO.findById(id);
    return art;
}

Front-end GWT :

public class Front_End implements EntryPoint {

/**
 * This is the entry point method.
 */
public void onModuleLoad() {    
final Client client = new Client(Protocol.HTTP);
client.get("http://localhost:8080/rest/service/getArt/1", new Callback() {
    @Override
    public void onEvent(Request request, Response response) {

        System.out.println("Reponse : " + response.getEntity().getText());
    }
});
}

RESTeasy client working :

public Object test(int id){
    try {

        ClientRequest request = new ClientRequest("http://localhost:8080/rest/service/getArt/"+id);

        request.accept("application/xml");
        ClientResponse<String> response = request.get(String.class);

        if (response.getStatus() == 200) 
        {
            Unmarshaller un = jc.createUnmarshaller();
            Object o = un.unmarshal(new StringReader(response.getEntity()));
            return o;
        }
    } catch (Exception e) {
        e.printStackTrace();
    }
    return null;
}

Are RESTeasy and Restlet “compatible” ? Should i use Restlet in the back end instead of RESTeasy ? What am i missing ?

Thx in advance

  • 1 1 Answer
  • 0 Views
  • 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-06-16T16:41:32+00:00Added an answer on June 16, 2026 at 4:41 pm

    It was a SOP issue.
    My server was running on port 8080, and GWT on port 8888.

    I used a proxy (put it in your /war in the client side) :

    proxy.jsp

    <%@page import="javax.naming.Context"%>
    <%@page import="javax.naming.InitialContext"%><%@page session="false"%>
    <%@page import="java.net.*,java.io.*" %>
    
    <%
    try {
    String reqUrl = request.getQueryString();
    URL url = new URL(reqUrl.substring(4));
    
    HttpURLConnection con = (HttpURLConnection)url.openConnection();
    con.setDoOutput(true);
    con.setRequestMethod(request.getMethod());
    int clength = request.getContentLength();
    if (clength > 0) {
        con.setDoInput(true);
        byte[] idata = new byte[clength];
        request.getInputStream().read(idata,0,clength);
        con.getOutputStream().write(idata,0,clength);
    }
    response.setContentType(con.getContentType());
    BufferedReader rd = new BufferedReader(new InputStreamReader(con.getInputStream()));
    String line;
    while ((line = rd.readLine()) != null) {
        out.println(line);
    }
    rd.close();
    } catch (Exception e) {
        e.printStackTrace();
        response.setStatus(500);
    }
    %>
    

    then in your class where you make the call, your url becomes :

    String url ="proxy.jsp?url=" + URL.encode("http://localhost:8080/rest/service/getArt/1");
    

    There is another way to solve it, check https://developers.google.com/web-toolkit/doc/1.6/tutorial/Xsite

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

Sidebar

Related Questions

I have a REST Server running on Tomcat 5.5. Some of the services need
I have some REST web services implemented in WCF. I wish to make these
So i have a assignment to write some REST client calls to a REST
I am coding some Spring REST services using Spring MVC. I have a requirement
I have a Jetty server (8.1.3) where I want to expose some POJOs over
I have a Tomcat server running some Jersey RESTful services and I'm using Apache
I have a REST api which dumps some json data (user info, etc). Now
I have this 2D array (say double[10][10]) which contain some 1.0 and 10.0, rest
I have some tables roughly like so: Client: id name Employee id name Email
Possible Duplicate: difference between WCF Services and Web Services and REST Service I have

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.