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.
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: