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..
.. 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.
From the RestDataSource javadoc....
"If you have a pre-existing REST or WSDL service which is difficult to change, consider adapting Smart GWT to the existing service instead, by starting with a normal{@link com.smartgwt.client.data.DataSource} and using the {@link com.smartgwt.client.docs.ClientDataIntegration 'client-side data integration'} facilities to create a mapping between Smart GWT's {@link com.smartgwt.client.data.DSRequest} and {@link com.smartgwt.client.data.DSResponse} objects and the message formats of your existing services."
Has anyone out there done this? I am wondering if this approach has been battle-tested or not. I would love to see someone's solution. It sounds like it would require quite a bit of boilerplate code.
Thanks!
Code:
<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>
This structure, which is little more than name/value pairs, is not going to work for us.
From the RestDataSource javadoc....
"If you have a pre-existing REST or WSDL service which is difficult to change, consider adapting Smart GWT to the existing service instead, by starting with a normal{@link com.smartgwt.client.data.DataSource} and using the {@link com.smartgwt.client.docs.ClientDataIntegration 'client-side data integration'} facilities to create a mapping between Smart GWT's {@link com.smartgwt.client.data.DSRequest} and {@link com.smartgwt.client.data.DSResponse} objects and the message formats of your existing services."
Has anyone out there done this? I am wondering if this approach has been battle-tested or not. I would love to see someone's solution. It sounds like it would require quite a bit of boilerplate code.
Thanks!
Comment