webMethods, OneData, and Terracotta  10.2 | Managing Master Data with webMethods OneData | Developing for webMethods OneData | REST Web Services | XSD Samples by Object Type | Conceptual Objects
 
Conceptual Objects
Conceptual Object Inserts and Updates
The following scenario shows XML that inserts data into the conceptual object REST_BRAND using REST.
You do not need to provide data for the hierarchy relation in the REST_BRAND object. REST automatically identifies the hierarchy relationship. In the below example, the hierarchy relation is shown as <!--<RelatedBrandType>Fridge</RelatedBrandType>--> and <!--<RelatedBrand>Kelvinator</RelatedBrand>-->.
In an input XML to insert multiple records, if the data hierarchy is not complete for all records, OneData recommends that you provide the foreign key value so that the records connect correctly. For example, if in a three-level hierarchy each node has different number of levels, you must provide the foreign key value for each level.
<?xml version='1.0' encoding='utf-8'?>
<REST_BRAND_TYPE>
  <datarow>
   <BrandTypeName>Fridge</BrandTypeName>
   <BrandTypeCode>F0022</BrandTypeCode>
   <REST_BRAND>
    <datarow>
     <BrandName>Kelvinator</BrandName>
     <BrandCode>KVL2</BrandCode>
     <!--<RelatedBrandType>Fridge</RelatedBrandType>-->
     <REST_PRODUCT>
      <datarow>
       <ProductName>FreshMatic</ProductName>
       <ProductCode>FRS</ProductCode>
       <!--<RelatedBrand>Kelvinator</RelatedBrand>-->
      </datarow>
     </REST_PRODUCT>
    </datarow>
   </REST_BRAND>
  </datarow>
</REST_BRAND_TYPE>
If the primary key values are sequences, include alternateKey in the RESTful web service link as a request parameter.
 alternateKey= REST_BRAND_TYPE= BRAND_TYPE_NAME;
REST_BRAND=REST_BRAND_NAME;
REST_PRODUCT=REST_PROD_NM
For more information about the request parameters, see REST URL Parameters.
Conceptual Object Deletes, Restores, and Purges
The scenario explained here shows XML that deletes data from the conceptual object REST_BRAND using REST.
Construct XML for the root node alone according to the XSD. Because the delete operation will delete the hierarchy, you do not need to provide data for the complete hierarchy. XML is required to contain the primary key information only.
<?xml version='1.0' encoding='utf-8'?>
  <REST_BRAND_TYPE>
  <datarow>
   <BrandTypeName>Fridge</BrandTypeName>
  </datarow>
</REST_BRAND_TYPE>
If the primary key values are sequences, include alternateKey in the RESTful web service link as a request parameter.
alternateKey=REST_BRAND_TYPE=BRAND_TYPE_NAME;
Set the processingMode parameter in the RESTful web service URL as delete. You can set this parameter as either purge or restore. For more information about the request parameters, see REST URL Parameters.

Copyright © 2011-2018 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.
Innovation Release