Library Link To Toggle Frames Print Feedback

Mapping Data into Logical Data Units

The interfaces used to implement a service define the data representing operation parameters as XML documents. If you are defining an interface for a service that is already implemented, you need to translate the data types of the implemented operations into discreet XML elements that can be assembled into messages. If you are starting from scratch, you need to determine the building blocks from which your messages are built in such a way as they make sense from an implementation standpoint.

Available type systems for defining service data units

According to the WSDL specification, you can use any type system you like to define data types in a WSDL contract. However, the W3C specification states that XML Schema is the preferred canonical type system for a WSDL document. Therefore, XML Schema is the intrinsic type system in Celtix Enterprise.

XML Schema as a type system

XML Schema is used to define how an XML document is structured. This done by defining the elements that make up the document. These elements can use native XML Schema types, like xsd:int, or they can use types that are defined by the user. User defined types are either built up using combinations of XML elements or they are defined by restricting existing types. By combining type definitions and element definitions you can create intricate XML documents that can contain complex data.

When used in WSDL XML Schema defines the structure of the XML document that will hold the data used to interact with a service. When defining the data units used by your service, you can define them as types that specify the structure of the message parts. You can also define your data units as elements that will make up the message parts.

Considerations for creating your data units

You may consider simply creating logical data units that map directly to the types you envision using when implementing the service. While this approach works and closely follows the model of building RPC-style applications, it is not neccesarlily ideal for building a piece of a service-oriented architecture.

The Web Services Interoperability Organization’s WS-I basic profile provides a number of guidelines for defining data units that can be accessed at http://www.ws-i.org/Profiles/BasicProfile-1.1-2004-08-24.html#WSDLTYPES. In addition, the W3C also provides guidelines on using XML Schema to represent data types in WSDL documents:

  • Use elements, not attributes.

  • Do not use protocol-specific types as base types.