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

  • Home
  • SEARCH
  • 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 1003495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:59:23+00:00 2026-05-16T07:59:23+00:00

While creating a simple client for a REST service which I have stubbed out,

  • 0

While creating a simple client for a REST service which I have stubbed out, I noticed that smartGWT’s RestDataSource class is limited in the type of xml it can understand. All REST resources must respond with XML in the following format..

<response>
    <status>0</status>
    <startRow>0</startRow>
    <endRow>10</endRow>
    <totalRows>50</totalRows>
    <data>
        <record>
            <someField>value</someField>
            <someOtherField>value</someOtherField>
        </record>
        <record>
            <someField>value</someField>
            <someOtherField>value</someOtherField> 
        </record>
        ...
    </data>
</response>

.. where the only variant is the someField/someOtherField tags.

This structure, which is little more than name/value pairs, is not going to work for us.

I then saw this demo on the SmartGWT showcase…

http://www.smartclient.com/smartgwtee/showcase/#data_integration_server_rss

Which shows how to consume xml in an arbitrary format for display like so…

package com.smartgwt.sample.showcase.client.webservice;  

import com.smartgwt.client.data.DataSource;  
import com.smartgwt.client.data.fields.DataSourceTextField;  
import com.smartgwt.client.data.fields.DataSourceLinkField;  
import com.smartgwt.client.widgets.Canvas;  
import com.smartgwt.client.widgets.grid.ListGrid;  
import com.smartgwt.sample.showcase.client.PanelFactory;  
import com.smartgwt.sample.showcase.client.ShowcasePanel;  

public class RssSample implements EntryPoint {  

    public void onModuleLoad() {  
        DataSource dataSource = new DataSource();  
        dataSource.setDataURL("http://rss.slashdot.org/Slashdot/slashdot");  
        dataSource.setRecordXPath("//default:item");  

        DataSourceTextField titleField = new DataSourceTextField("title", "Title");  
        DataSourceLinkField linkField = new DataSourceLinkField("link", "Link");  

        dataSource.setFields(titleField, linkField);  

        ListGrid grid = new ListGrid();  
        grid.setAutoFetchData(true);  
        grid.setHeight(200);  
        grid.setWidth100();  
        grid.setDataSource(dataSource);  

        grid.draw();  
    }  

}  

This works well for GETs but how about PUTs, POSTs and DELETEs?

Can anyone share some code or point me to a resource which demonstrates how to do other RESTful operations from a SmartGWT client?

Thanks

  • 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-16T07:59:24+00:00Added an answer on May 16, 2026 at 7:59 am

    Use OperationBindings:

    http://www.smartclient.com/smartgwtee/javadoc/com/smartgwt/client/data/DataSource.html#setOperationBindings%28com.smartgwt.client.data.OperationBinding…%29

    You can control the url to contact, HTTP method, and many other things on a per-CRUD-operation basis.

    http://www.smartclient.com/smartgwtee/javadoc/com/smartgwt/client/data/DataSource.html#setDataURL(java.lang.String)

    http://www.smartclient.com/smartgwtee/javadoc/com/smartgwt/client/data/DataSource.html#setDataProtocol%28com.smartgwt.client.types.DSProtocol%29

    Note that to use those particular HTTP verbs (PUT and DELETE), you’d use setRequestProperties and setHTTPMethod:

    http://www.smartclient.com/smartgwtee/javadoc/com/smartgwt/client/data/DataSource.html#setRequestProperties%28com.smartgwt.client.data.DSRequest%29

    http://www.smartclient.com/smartgwtee/javadoc/com/smartgwt/client/rpc/RPCRequest.html#setHttpMethod%28java.lang.String%29

    But be aware, some older browsers do not support those verbs.

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

Sidebar

Related Questions

While creating JavaScript with ASP.NET MVC I noticed several scope warnings and realized that
I have a simple admin I'm creating for a client using PHP and Mysql.
I ran into some trouble while creating a C-Extension for ruby that got me
Im creating a simple WCF service for receiving crash reports. The service will run
I am creating a simple project that will allow me to upload and download
I have a simple server that looks something like this: void *run_thread(void *arg) {
While testing out a UDP multicast server that I've written on Windows 7 Ultimate
I have a relatively simple program where I try establish Client Server connection and
I have two simple programs that use named pipes, here is the first: int
I'm creating a WCF service which exposes an object graph which is expected to

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.