Hi,
I have SmartClientOperation based WSDL services exposing Person and Pet pojo classes.
In SmartGWT I created corresponding WS datasources:
Fetch operation on Pet datasource is working fine with the following server response:
However I am not able to get the same hierarchical Update request (required by server side) from SmartGWT.
Instead I got the following flat xml structure:
Am I missing somethig ?
Thanks,
MichalG
I have SmartClientOperation based WSDL services exposing Person and Pet pojo classes.
In SmartGWT I created corresponding WS datasources:
Code:
private static class PersonDS extends WSDataSource { private static PersonDS instance; public static PersonDS getInstance() { if (instance == null) instance = new PersonDS("Person"); return instance; } public PersonDS(String id) { setID(id); setServiceNamespace("urn:operations.smartclient.com"); setDataFormat(DSDataFormat.XML); setDataURL("/axis2/services/SmartClientOperations"); OperationBinding fetchBinding = new OperationBinding(); fetchBinding.setOperationType(DSOperationType.FETCH); fetchBinding.setWsOperation("fetch"); fetchBinding.setRecordXPath("//data/*"); fetchBinding.setRecordName("arg"); OperationBinding updateBinding = new OperationBinding(); updateBinding.setOperationType(DSOperationType.UPDATE); updateBinding.setWsOperation("update"); updateBinding.setRecordXPath("//data/*"); updateBinding.setRecordName("arg"); setOperationBindings(fetchBinding,updateBinding); DataSourceField idField = new DataSourceIntegerField("id", "ID", 5, false); idField.setPrimaryKey(true); DataSourceField nameField = new DataSourceTextField("name", "Name", 30, true); DataSourceField ageField = new DataSourceField("age", FieldType.INTEGER, "Age", 3); setFields(idField,nameField,ageField); } } private static class PetDS extends WSDataSource { private static PetDS instance; public static PetDS getInstance() { if (instance == null) instance = new PetDS("Pet"); return instance; } public PetDS(String id) { setID(id); setServiceNamespace("urn:operations.smartclient.com"); setDataFormat(DSDataFormat.XML); setDataURL("/axis2/services/SmartClientOperations"); OperationBinding fetchBinding = new OperationBinding(); fetchBinding.setOperationType(DSOperationType.FETCH); fetchBinding.setWsOperation("fetch"); fetchBinding.setRecordXPath("//data/*"); fetchBinding.setRecordName("arg"); OperationBinding updateBinding = new OperationBinding(); updateBinding.setOperationType(DSOperationType.UPDATE); updateBinding.setWsOperation("update"); updateBinding.setRecordXPath("//data/*"); updateBinding.setRecordName("arg"); setOperationBindings(fetchBinding,updateBinding); DataSourceField idField = new DataSourceIntegerField("id", "ID", 5, false); idField.setPrimaryKey(true); DataSourceField animalField = new DataSourceTextField("animal", "Animal", 30, true); DataSourceField colourField = new DataSourceTextField("colour", "Colour", 10, true); DataSourceField sexField = new DataSourceField("sex", FieldType.BOOLEAN, "Sex", 5); DataSourceField personField = new DataSourceIntegerField("person", "PresonID", 5, false); personField.setForeignKey("Person.id"); personField.setValueXPath("person/id"); setFields(idField,animalField,colourField,sexField,personField); } }
Code:
<data> <pet> <id>458752</id> <person> <id>491520</id> .. </person> .. </pet>
Instead I got the following flat xml structure:
Code:
<data> <pet> <id>458752</id> <person>491520</person> .. </pet>
Thanks,
MichalG
Comment