Performing Actions on Data Objects at Run Time

Using HelperContext

SDO defines a HelperContext interface. You use it to access related SDO helper classes that let you perform common operations such as reading and writing XML documents, defining SDO types from XML Schema, and so on.

To obtain a default context, call the HelperProvidergetDefaultContext method.

Integrating SDO with JPA

Using SDO as a Web Service Binding Layer

You can easily invoke a Web service and obtain results in the form of data objects, as the following example shows:

DataObject resultEnvelope = WebService.invoke(po, "http://werbservices.org/purchaseOrder",
soap, "Envelope");
// Get the purchase order from the result envelope
DataObject resultPo = resultEnvelope.getDataObject("Body/purchaseOrder");

You can also build a Web services client around the XMLHelper. For example, in a simple Web service
client, you could post an input DataObject representing an XML document using the XMLHelper, and then have the returning XML document returned to the caller as a DataObject:

Note that properties are always matched by name independent of their XML representation.

The following example shows how to construct an XPath that you can use to access a DataObject contained in another DataObject is to specify the index of the contained DataObject within the appropriate property:

DataObject department = company.getDataObject("departments.0");

Another way to access a contained DataObject is to identify that object by specifying the
value of one of the attributes of that object. For example:

You can also use XPath expressions to set or unset values of properties, including multivalued properties.
Note that each step of the path before the last must return a single DataObject. When the property is a Sequence, the values returned are those of the getValue method.