DEFINING WEB SERVICES WITH WSDL One of the biggest changes to enterprises in the past year has been the effort to create new service-based systems. A service-based system isn't necessarily new technology, per se, but rather a new perspective on existing technology. As commerce and business processes have become more electronic, more enterprise applications than ever are being integrated. These applications are now viewed as providing particular services rather than as just applications. Using Web technologies, they can be delivered via the Internet. The Web Services Description Language (WSDL) is an XML grammar that allows you to describe the Web-based services that are provided by your applications. WHAT IS A WEB SERVICE? A Web service is usually a business process that can be automated using an application. A service is made up of various operations. For example, an organization might define a billing system Web service. This service is comprised of operations, such as creating an invoice or submitting a payment. The service is accessed using an HTTP gateway or Web server. The Web server uses the familiar request/response HTTP model. Each request is sent as an HTTP GET request and can be packaged as a Simple Object Access Protocol (SOAP) request. The SOAP protocol defines a way to access remote objects using the HTTP Web server protocol. Each message is itself an XML document that includes the request or response being sent to or from the Web service. DESCRIBING WEB SERVICES Now that we have a fundamental concept of a Web service as a collection of operations accessible via a Web server, we can examine how these services are defined and described. Each Web service is described in a WSDL document. The document is made up of component definitions that describe different aspects of the Web service. There are six elements contained by the definitions element that provide information about the Web service. These elements are types, message, portType, binding, port, and service. Each may contain a document element that provides documentation of the behavior defined by the element. The types element defines data types that may be used in the message being exchanged. Each type can be defined using existing XSD (XML Schema Definition) data types, such as string, date, and short. Each type may be defined in simple terms using primitive definitions (like string, date, and short) or they may be complex types, which are composed of multiple subtype definitions. For example, a name type might be defined as a string; however, an Account type may be defined as a combination of CustomerRecord, AddressRecord, AccountHistory, and AccountNumber. Each of these types may then be composed of more subtypes. The message element contains the abstract data that is exchanged in the electronic conversation. Each message is made up of part elements that describe individual segments of data that are defined by the types. While the types elements define the characteristic of various types that may be used in the exchange, the message element defines the actual parts that make up the particular Web service. The portType element defines the particular collection of operations provided by the Web service. Each portType element is composed of one or more operation elements. Each operation is a single transaction or process that can be performed by the Web service. These can be thought of as the methods that are exposed by the Web service. The input and output elements, which make up the operation elements, define which messages are input data to the operation and which messages are output data from the operation. The binding element describes how the various operation parameters (defined by the input and output elements) will be encoded for transport. Each operation and its associated input and output parameters must be individually bound to a particular protocol, such as SOAP. The service element describes the top-level view of the Web service defined by the WSDL document. Each service element is comprised of multiple port elements, which associate a particular binding with a physical address (such as a Web server or e-mail address). SUMMARY Exposing interfaces to enterprise business processes is a cornerstone for business-to-business electronic commerce. The WSDL is used to describe how businesses and organizations interface with one another's systems using Web services. Brian Schaffner is a senior consultant for DMR Consulting, a Fujitsu company. He provides architecture, design, and development support for DMR's Telcom360 group. ----------------------------------------