Announcement

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

    RestDataSource xml request data format

    Hi there,
    we are in the process of upgrading SmartGwt from version 2.5 to version 3.1 and our DataSources use the following design
    Code:
    public class ExampleDS extends RestDataSource {
    	    
    	public ExampleDS() {
            
    	   DataSourceIntegerField idField = new DataSourceIntegerField("id");
    	   idField.setPrimaryKey(true);
    	   DataSourceTextField dataField = new DataSourceTextField("some_data");
    	   OperationBinding add = new OperationBinding();
               add.setOperationType(DSOperationType.ADD);
               add.setDataProtocol(DSProtocol.POSTXML);
               DSRequest addRequest = new DSRequest();
               addRequest.setHttpMethod("PUT");
               add.setRequestProperties(addRequest);
               setOperationBindings(add);
               setDataFormat(DSDataFormat.XML);
               String url="example"   
               setAddDataURL(url);
               setTagName("example");				
    	}
    	    
    }
    The problem we are facing is the fact that add operation initiated with version 2.5 creates PUT request with request data specified bellow
    Code:
    <request> 
    	<data> 
    		<example> 
    			<some_data>Some data</some_data>
    		</example>
    	</data>
    	<dataSource>ExampleDataSource_10</dataSource>
    	<operationType>add</operationType>
    	<componentId>isc_ListGrid_11</componentId>
    	<oldValues></oldValues>
    </request>
    while with version 3.1 the following request data is sent to the server
    Code:
    <request> 
    	<data> 
    		<some_data>Some data</some_data>
    	</data>
    	<dataSource>ExampleDataSource_10</dataSource>
    	<operationType>add</operationType>
    	<componentId>isc_ListGrid_11</componentId>
    	<oldValues></oldValues>
    </request>
    Our question would be: is there an easy way to acheive the same xml request data format between versions 2.5 and 3.1?

    Thanks,

    Denis
Working...
X