WSDL Documents

|  | Search W3Schools : |

HOME | HTML | CSS | XML | JAVASCRIPT | ASP | PHP | SQL | MORE... |  | References | Examples | Forum | About

ADVERTISEMENTS XML Certification Download XML editor Custom Programming |  |

Table of contents

WSDL Tutorial
WSDL HOME
WSDL Intro
WSDL Documents
WSDL Ports
WSDL Binding
WSDL and UDDI
WSDL Syntax
WSDL Summary

Selected Reading

Web Statistics
Web Glossary
Web Hosting
Web Quality
W3Schools Tutorials
W3Schools Forum
Helping W3Schools

# WSDL Documents

A WSDL document is just a simple XML document.

It contains set of definitions to describe a web service.

## The WSDL Document Structure

A WSDL document describes a web service using these major elements:

Element | Defines
--- | ---
<portType> | The operations performed by the web service
<message> | The messages used by the web service
<types> | The data types used by the web service
<binding> | The communication protocols used by the web service

The main structure of a WSDL document looks like this:

    <definitions>

    <types>
       definition of types........
    </types>

    <message>
       definition of a message....
    </message>

    <portType>
       definition of a port.......
    </portType>

    <binding>
       definition of a binding....
    </binding>

    </definitions>

A WSDL document can also contain other elements, like extension elements and a service element that makes it possible to group together the definitions of several web services in one single WSDL document.

For a complete syntax overview go to the chapter WSDL Syntax.

## WSDL Ports

The <portType> element is the most important WSDL element.

It describes a web service, the operations that can be performed, and the messages that are involved.

The <portType> element can be compared to a function library (or a module, or a class) in a traditional programming language.

## WSDL Messages

The <message> element defines the data elements of an operation.

Each message can consist of one or more parts. The parts can be compared to the parameters of a function call in a traditional programming language.

## WSDL Types

The <types> element defines the data type that are used by the web service.

For maximum platform neutrality, WSDL uses XML Schema syntax to define data types.

## WSDL Bindings

The <binding> element defines the message format and protocol details for each port.

## WSDL Example

This is a simplified fraction of a WSDL document:

    <message name="getTermRequest">
       <part name="term" type="xs:string"/>
    </message>

    <message name="getTermResponse">
       <part name="value" type="xs:string"/>
    </message>

    <portType name="glossaryTerms">
      <operation name="getTerm">
          <input message="getTermRequest"/>
          <output message="getTermResponse"/>
      </operation>
    </portType>

In this example the <portType> element defines "glossaryTerms" as the name of a port, and "getTerm" as the name of an operation.

The "getTerm" operation has an input message called "getTermRequest" and an output message called "getTermResponse".

The <message> elements define the parts of each message and the associated data types.

Compared to traditional programming, glossaryTerms is a function library, "getTerm" is a function with "getTermRequest" as the input parameter and getTermResponse as the return parameter.

## Altova® XMLSpy® - The world's best-selling XML editor!

Whether you're new to XML or already an advanced user, the user-friendly views and powerful entry helpers, wizards, and debuggers in XMLSpy are designed to meet your XML and Web services development needs from start to finish.

- XML editor
- Graphical XML Schema / DTD editors
- XSLT 1.0/2.0 editor, debugger, profiler
- XQuery editor, debugger, profiler
- Support for Office Open XML (OOXML)
- Graphical WSDL editor & SOAP debugger
- Java, C#, C++ code generation
- And much more!

Download a fully functional free 30-day trial today!

WEB HOSTING
ASP.NET Web Hosting
$15 Domain Name Registration Save $20 / year!
Buy UK Domain Names Register Domain Names
Cheap Domain Names Cheap Web Hosting
Best Web Hosting
PHP MySQL Hosting
Top 10 Web Hosting
UK Reseller Hosting
Web Hosting
FREE Web Hosting

WEB BUILDING
Website Templates Flash Templates Website Builder Internet Business Opportunity
Custom Programming
FREE Trial or Demo Web Content Manager Forms,Web Alerts,RSS
Download XML editor
FREE Flash Website
FREE Web Templates

EDUCATION
US Web Design Schools
HTML Certification
JavaScript Certification
XML Certification
PHP Certification
ASP Certification

HOME or Top of Page |  | Printer Friendly
W3Schools is for training only. We do not warrant the correctness of its content. The risk from using it lies entirely with the user. While using this site, you agree to have read and accepted our terms of use and privacy policy. Copyright 1999-2009 by Refsnes Data. All Rights Reserved.