This topic contains reference information to help you develop code to navigate the data graphs of the messages that your program mediates.
XML schemas might be embedded in the WSDL sections that describe the message parts and SOAP headers. However the SOAP header description is more likely to be available as a separate schema, in which case you should load it into the SDO repository where it can be used to process any message with a matching header at runtime.
Each XML schema complex type is mapped to an SDO type. This means that an element with a complex type will be represented by an instance of an SDO data object. The type has a property for each element, attribute, or wildcard that is contained in the schema type definition.
In turn, the instance will contain a value for each property that has been set. If the property is mapped from a schema complex type then the value will be another SDO data object. If the property is mapped from a schema simple type then the value will be an instance of a Java class, as shown in the following table.
Schema type | Java class | Notes |
anyURI | java.lang.String | |
base64Binary | byte[] | See note 2 |
boolean | java.lang.Boolean/ boolean | See note 1 |
byte | java.lang.Byte / byte | See note 1 |
date | java.lang.String | |
dateTime | java.lang.String | |
decimal | java.math.BigDecimal | |
double | java.lang.Double / double | See note 1 |
duration | java.lang.String | |
ENTITIES | java.util.List | |
ENTITY | java.lang.String | |
float | ava.lang.Float / float | See note 1 |
gDay | java.lang.String | |
gMonth | java.lang.String | |
gMonthDay | java.lang.String | |
gYear | java.lang.String | |
gYearMonth | java.lang.String | |
hexBinary | byte[] | See note 2 |
ID | java.lang.String | |
IDREF | java.lang.String | |
IDREFS | java.util.List | |
int | java.lang.Integer / int | See note 1 |
integer | java.math.BigInteger | |
language | java.lang.String | |
long | java.lang.Long / long | See note 1 |
Name | java.lang.String | |
NCName | java.lang.String | |
negativeInteger | java.math.BigInteger | |
NKTOKENS | java.util.List | |
NMTOKEN | java.lang.String | |
nonNegativeInteger | java.math.BigInteger | |
nonPositiveInteger | java.math.BigInteger | |
normalisedString | java.lang.String | |
NOTATION | javax.xml.namespace.QName | |
positiveInteger | java.math.BigInteger | |
QName | javax.xml.namespace.QName | |
short | java.lang.Short / short | See note 1 |
string | java.lang.String | |
time | java.lang.String | |
token | java.lang.String | |
insignedByte | java.lang.Short / short | See note 1 |
unsignedInt | java.lang.Long / long | See note 1 |
unsignedLong | java.math.BigInteger | |
unsignedShort | java.lang.Integer / int | See note 1 |
Note 1: SDO automatically converts primitives (int, long and so on) into objects as needed. This means that you can use a mixture of the specialized methods (getInt, setInt, getLong, setLong) as well as the generic get and set methods.
Note 2: As byte arrays are mutable, it is possible to update the value without setting it back onto the data object. However when this occurs the data object may not be aware of implicit update. When working with byte array values you should always use the setBytes() method to explicitly update the data object.
When a schema is mapped to SDO we also define a special SDO type, typically called ‘DocumentRoot’. This type is a container for all the global elements and attributes in the schema. Whenever you need to locate an SDO property for a global element or attribute you should locate the ‘DocumentRoot’ type and then locate the appropriate property within it.
The following schema defines the layout of Web services messages. By comparing this schema with the information in Mapping of SDO data graphs for Web services messagesyou can see the schema to SDO mapping in action.
<?xml version="1.0"?> <xsd:schema targetNamespace="http://www.ibm.com/ns/2004/05/webservices/messagemodel" xmlns:tns="http://www.ibm.com/ns/2004/05/webservices/messagemodel" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <xsd:import namespace="http://schemas.xmlsoap.org/soap/envelope/"/> <xsd:element name="Info"> <xsd:complexType> <xsd:sequence> <xsd:element name="operationName" nillable="true" type="xsd:string"/> <xsd:element name="messageName" nillable="true" type="xsd:string"/> <xsd:element name="messageType" nillable="true" type="xsd:string"/> <xsd:element name="headers" type="tns:HeaderEntryType" maxOccurs="unbounded"/> <xsd:element name="attachments" type="tns:AttachmentEntryType" maxOccurs="unbounded"/> <xsd:element name="body" type="tns:BodyType"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:complexType name="BodyType" abstract="true"/> <xsd:complexType name="HeaderEntryType" abstract="true"/> <xsd:complexType name="AttachmentEntryType" abstract="true"/> <xsd:complexType name="SOAPFaultBody"> <xsd:complexContent> <xsd:extension base="tns:BodyType"> <xsd:sequence> <xsd:element name="faultcode" type="xsd:QName"/> <xsd:element name="faultstring" type="xsd:string"/> <xsd:element name="faultactor" type="xsd:anyURI" minOccurs="0"/> <xsd:element name="detail" type="soap:detail" minOccurs="0"/> </xsd:sequence> </xsd:extension> </xsd:complexContent> </xsd:complexType> <xsd:complexType name="SOAP_1_1_HeaderEntryType"> <xsd:complexContent> <xsd:extension base="tns:HeaderEntryType"> <xsd:sequence> <xsd:element name="mustUnderstand" nillable="true" type="xsd:boolean"/> <xsd:element name="actor" nillable="true" type="xsd:anyURI"/> <xsd:any/> </xsd:sequence> </xsd:extension> </xsd:complexContent> </xsd:complexType> <xsd:complexType name="SOAP_1_1_BoundHeaderEntryType"> <xsd:complexContent> <xsd:extension base="tns:HeaderEntryType"> <xsd:sequence> <xsd:element name="mustUnderstand" nillable="true" type="xsd:boolean"/> <xsd:element name="actor" nillable="true" type="xsd:anyURI"/> <xsd:element name="messagePart" type="xsd:string"/> </xsd:sequence> </xsd:extension> </xsd:complexContent> </xsd:complexType> <xsd:complexType name="MIMEAttachmentEntryType"> <xsd:complexContent> <xsd:extension base="tns:AttachmentEntryType"> <xsd:sequence> <xsd:element name="contentType" type="xsd:string"/> <xsd:element name="contentTransferEncoding" type="xsd:string"/> <xsd:element name="contentId" type="xsd:string"/> <xsd:element name="data" type="xsd:base64Binary"/> </xsd:sequence> </xsd:extension> </xsd:complexContent> </xsd:complexType> <xsd:complexType name="BoundMIMEAttachmentEntryType"> <xsd:complexContent> <xsd:extension base="tns:AttachmentEntryType"> <xsd:sequence> <xsd:element name="contentType" type="xsd:string"/> <xsd:element name="contentTransferEncoding" type="xsd:string"/> <xsd:element name="contentId" type="xsd:string"/> <xsd:element name="messagePart" type="xsd:string"/> </xsd:sequence> </xsd:extension> </xsd:complexContent> </xsd:complexType> <xsd:complexType name="UnknownBodyType"> <xsd:complexContent> <xsd:extension base="tns:BodyType"> <xsd:sequence> <xsd:any/> </xsd:sequence> <xsd:attribute name="encodingStyle" type="xsd:string"/> </xsd:extension> </xsd:complexContent> </xsd:complexType> </xsd:schema>