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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:59:12+00:00 2026-05-26T18:59:12+00:00

I am developing a GWT app for the Google Apps marketplace. I am using

  • 0

I am developing a GWT app for the Google Apps marketplace. I am using AppEngine with Restlet on the server side. Client side I use the GWT edition of Restlet. This is a great combination. I have my domain objects shared between client and server and as such no need for DTO’s or proxies and so on. On the client side I can simply call Restlet resources :

CustomerResourceProxy customerResource = GWT.create(CustomerResourceProxy.class);
customerResource.getClientResource().setReference("/customer");
customerResource.retrieve(new Result<Customer>() { .... }

No need to parse the underlying XML or use JSNI to interpret incoming JSON.

BUT… part of the app is a GMAIL contextual gadget, and I cannot simply use the above code because all communication between a Gadget and the server must pass through GadgetsIO makeRequest.

So… just for the gadget, I will have to make the effort of parsing the XML or using JSNI to interpret the incoming JSON.

Is it überhaupt possible to hack the Restlet GWT client to pass all communication via GadgetsIO and what would it take ? Any pointers very welcome !

K.

  • 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-05-26T18:59:13+00:00Added an answer on May 26, 2026 at 6:59 pm

    I managed to get Restlet resources to work within a Gadget using GWT by making some changes to the Restlet GWT edition :

    • In GwtClientCall I replaced the standard GWT requestbuilder by the GadgetRequestBuilder (which will IoProvider.makeRequest), like this :

      public GwtClientCall(GwtHttpClientHelper helper, String method, String requestUri, boolean hasEntity) {
        super(helper, method, requestUri);
        Reference requestRef = new Reference(requestUri);
        if (requestRef.isRelative() || requestRef.getScheme().startsWith("http")) {
         this.requestBuilder = new GadgetsRequestBuilder(method, requestUri);
         this.requestBuilder.setTimeoutMillis(getHelper().getSocketConnectTimeoutMs());
         this.responseHeadersAdded = false;
        } else {
         throw new IllegalArgumentException("Only HTTP or HTTPS resource URIs are allowed here");
        }
      }
      
    • In the gadgetsrequestbuilder, I had to make some changes so it would pass the headers in the request :

      private GadgetsRequest doSend(String requestData, final RequestCallback callback) throws RequestException {
      
      final RequestOptions options = RequestOptions.newInstance();
      options.setMethodType(methodType);
      if (requestData != null && requestData.length() > 0) {
          options.setPostData(requestData);
      }
      options.setAuthorizationType(AuthorizationType.SIGNED);
      options.setContentType(ContentType.DOM);
      setHeaders(options);
      
      final GadgetsRequest gadgetsRequest = new GadgetsRequest(getTimeoutMillis(), callback);
      gadgetsRequest.setPending(true);
      
      IoProvider.get().makeRequest(getUrl(), new ResponseReceivedHandler<Object>() {
          public void onResponseReceived(ResponseReceivedEvent<Object> event) {
              gadgetsRequest.fireOnResponseReceived(event, callback);
          }
      
      }, options);
      
      return gadgetsRequest;
      }
      
    • the gadget container by default strips the response headers, so i manually add the MediaType.APPLICATION_JAVA_OBJECT_GWT

      @Override
      public Series<org.restlet.client.engine.header.Header> getResponseHeaders() {
      final Series<org.restlet.client.engine.header.Header> result = super.getResponseHeaders();
      if (!this.responseHeadersAdded && (getResponse() != null)) {
          Header[] headers = getResponse().getHeaders();
          for (int i = 0; i < headers.length; i++) {
              if (headers[i] != null) {
                  result.add(headers[i].getName(), headers[i].getValue());
              }
          }
          result.add(HeaderConstants.HEADER_CONTENT_TYPE, MediaType.APPLICATION_JAVA_OBJECT_GWT.toString());
          this.responseHeadersAdded = true;
      }
      
      return result;
      }
      

    A lot of dialogboxes for debugging later, it works 🙂

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

Sidebar

Related Questions

I am developing an app using Grails and GWT for a client side. I
I am developing a website using GWT deployed in Google App Engine. With the
I am developing one application with GWT as client and my server side code
I'm developing a GWT app running on the Google App Engine and wondering if
I'm developing a GWT web app. I write the code in java in client
I am developing a GWT app (I'm fairly new to GWT so this is
I am developing a gwt project and am looking for an appropriate server side
I am developing a small scale app using smart gwt 2.4. I chose smart
I am developing a simple app using GWT, Hibernate, RPC in eclipse. I am
I'm developing an GWT + AppEngine app. All works well except when I run

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.