Using XML Schema validation

The interface for each service is defined by its WSDL contract, with the core structure of the data being exchanged defined by one or more XML Schemas. So XSD validation provides an excellent way to implement the initial level of validation.

When implementing schema-based validation, we have two basic approaches, that is, to either implement strongly-typed web services or loosely-typed services.

Strongly-typed services

With strongly-typed services, we use XML Schema to very precisely specify the exact structure of each element within our XML instance. For example, if we look at the definition of a credit card within the oBay canonical model, a strongly-typed version may be defined as the following code snippet:

<xsd:complexType ...

Get Oracle SOA Suite 11g R1 Developer's Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.