Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    some question about REST data source

    I want to implement a REST data source for client-side data integration.
    I just study show case sample of REST http://www.smartclient.com/smartgwt/showcase/#featured_restfulds, but with some confusion.

    when I click "Add new Country" button, the http message is as below:
    <request> <data> <isc_RestfulDataSourceSample$1_0> <countryCode>US</countryCode> <countryName>Edited Value</countryName> <capital>Edited Value</capital> <continent>Edited Value</continent> </isc_RestfulDataSourceSample$1_0> </data> <dataSource>isc_RestfulDataSourceSample$1_0</dataSource> <operationType>update</operationType> <componentId>isc_ListGrid_0</componentId> <oldValues></oldValues> </request>

    Three question here:
    1. I want to add some extra control info into this xml, for example <feed>xxx</feed>, how?
    2. the xml sent by smartgwt client include a special character "$"(isc_RestfulDataSourceSample$1_0), so the xml become a not well-formed xml, anyone has idea about this.
    3. how to override transformRequest and transformResponse, anyone has such expirence can share some sample code?

    Thanks very much!

    #2
    after change some code, now the response look as below, which is well-formed xml now

    Code:
    <request>
    <data>
    <isc_RestDataSource_0>
    <countryCode>A1</countryCode>
    <countryName>New Value</countryName>
    <capital>New Value</capital>
    <continent>New Value</continent>
    </isc_RestDataSource_0>
    </data>
    <dataSource>isc_RestDataSource_0</dataSource>
    <operationType>add</operationType>
    <componentId>isc_ListGrid_0</componentId>
    <oldValues></oldValues>
    </request>
    Source
    <request> <data> <isc_RestDataSource_0> <countryCode>A1</countryCode> <countryName>New Value</countryName> <capital>New Value</capital> <continent>New Value</continent> </isc_RestDataSource_0> </data> <dataSource>isc_RestDataSource_0</dataSource> <operationType>add</operationType> <componentId>isc_ListGrid_0</componentId> <oldValues></oldValues> </request>
    and still look forward the answer for other two question, thanks!

    Comment


      #3
      Could anyone give some sample about how to override transformRequest and transformResponse, thanks!

      Comment

      Working...
      X