AI Generate WSDL docs instantly

WSDL Cheat Sheet

Quick reference guide with copy-paste ready code snippets

Try DocuWriter Free

Getting Started

2 snippets

Basic WSDL structure

WSDL Document Structure

<?xml version="1.0" encoding="UTF-8"?>
<definitions name="HelloService"
             targetNamespace="http://example.com/hello"
             xmlns="http://schemas.xmlsoap.org/wsdl/"
             xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
             xmlns:tns="http://example.com/hello"
             xmlns:xsd="http://www.w3.org/2001/XMLSchema">

    <!-- Types, Messages, PortType, Binding, Service -->

</definitions>

Common Namespaces

xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://example.com/service"

Types

3 snippets

Defining data types

Simple Type Definition

<types>
    <xsd:schema targetNamespace="http://example.com/hello">
        <xsd:element name="SayHelloRequest">
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element name="name" type="xsd:string"/>
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>

        <xsd:element name="SayHelloResponse">
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element name="greeting" type="xsd:string"/>
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>
    </xsd:schema>
</types>

Complex Type

<xsd:complexType name="Person">
    <xsd:sequence>
        <xsd:element name="firstName" type="xsd:string"/>
        <xsd:element name="lastName" type="xsd:string"/>
        <xsd:element name="age" type="xsd:int"/>
    </xsd:sequence>
</xsd:complexType>

Array Type

<xsd:complexType name="PersonArray">
    <xsd:sequence>
        <xsd:element name="person" type="tns:Person"
                     minOccurs="0" maxOccurs="unbounded"/>
    </xsd:sequence>
</xsd:complexType>

Messages

3 snippets

Defining message structures

Request/Response Messages

<message name="SayHelloRequest">
    <part name="parameters" element="tns:SayHelloRequest"/>
</message>

<message name="SayHelloResponse">
    <part name="parameters" element="tns:SayHelloResponse"/>
</message>

Fault Message

<message name="ErrorMessage">
    <part name="fault" element="tns:Error"/>
</message>

Multi-Part Message

<message name="ComplexRequest">
    <part name="header" element="tns:Header"/>
    <part name="body" element="tns:Body"/>
</message>

Tired of looking up syntax?

DocuWriter.ai generates documentation and explains code using AI.

Try Free

Port Type

3 snippets

Defining operations

Basic Port Type

<portType name="HelloPortType">
    <operation name="SayHello">
        <input message="tns:SayHelloRequest"/>
        <output message="tns:SayHelloResponse"/>
    </operation>
</portType>

Operation with Fault

<portType name="CalculatorPortType">
    <operation name="Divide">
        <input message="tns:DivideRequest"/>
        <output message="tns:DivideResponse"/>
        <fault name="DivideByZeroFault" message="tns:ErrorMessage"/>
    </operation>
</portType>

One-Way Operation

<portType name="NotificationPortType">
    <operation name="Notify">
        <input message="tns:NotifyRequest"/>
        <!-- No output - one-way operation -->
    </operation>
</portType>

Binding

3 snippets

Protocol and data format specification

SOAP Binding

<binding name="HelloBinding" type="tns:HelloPortType">
    <soap:binding style="document"
                  transport="http://schemas.xmlsoap.org/soap/http"/>

    <operation name="SayHello">
        <soap:operation soapAction="http://example.com/SayHello"/>
        <input>
            <soap:body use="literal"/>
        </input>
        <output>
            <soap:body use="literal"/>
        </output>
    </operation>
</binding>

RPC Style Binding

<binding name="CalculatorBinding" type="tns:CalculatorPortType">
    <soap:binding style="rpc"
                  transport="http://schemas.xmlsoap.org/soap/http"/>

    <operation name="Add">
        <soap:operation soapAction=""/>
        <input>
            <soap:body use="literal"
                       namespace="http://example.com/calculator"/>
        </input>
        <output>
            <soap:body use="literal"
                       namespace="http://example.com/calculator"/>
        </output>
    </operation>
</binding>

HTTP Binding

<binding name="HttpGetBinding" type="tns:DataPortType">
    <http:binding verb="GET"/>

    <operation name="GetData">
        <http:operation location="/data"/>
        <input>
            <http:urlEncoded/>
        </input>
        <output>
            <mime:mimeXml part="body"/>
        </output>
    </operation>
</binding>

Service

2 snippets

Defining service endpoints

Basic Service

<service name="HelloService">
    <documentation>Simple Hello World Service</documentation>

    <port name="HelloPort" binding="tns:HelloBinding">
        <soap:address location="http://example.com/hello"/>
    </port>
</service>

Multiple Ports

<service name="MultiPortService">
    <port name="SoapPort" binding="tns:SoapBinding">
        <soap:address location="http://example.com/soap"/>
    </port>

    <port name="HttpPort" binding="tns:HttpBinding">
        <http:address location="http://example.com/http"/>
    </port>
</service>

Documentation

2 snippets

Adding documentation to WSDL

Service Documentation

<service name="HelloService">
    <documentation>
        This service provides greeting functionality.
        Version: 1.0
    </documentation>
    <!-- ports -->
</service>

Operation Documentation

<portType name="HelloPortType">
    <operation name="SayHello">
        <documentation>
            Returns a greeting message for the given name.
        </documentation>
        <input message="tns:SayHelloRequest"/>
        <output message="tns:SayHelloResponse"/>
    </operation>
</portType>

Complete Example

1 snippets

Full WSDL service definition

Complete WSDL

<?xml version="1.0" encoding="UTF-8"?>
<definitions name="HelloService"
             targetNamespace="http://example.com/hello"
             xmlns="http://schemas.xmlsoap.org/wsdl/"
             xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
             xmlns:tns="http://example.com/hello"
             xmlns:xsd="http://www.w3.org/2001/XMLSchema">

    <types>
        <xsd:schema targetNamespace="http://example.com/hello">
            <xsd:element name="SayHelloRequest">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="name" type="xsd:string"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>

            <xsd:element name="SayHelloResponse">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="greeting" type="xsd:string"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
        </xsd:schema>
    </types>

    <message name="SayHelloRequest">
        <part name="parameters" element="tns:SayHelloRequest"/>
    </message>

    <message name="SayHelloResponse">
        <part name="parameters" element="tns:SayHelloResponse"/>
    </message>

    <portType name="HelloPortType">
        <operation name="SayHello">
            <input message="tns:SayHelloRequest"/>
            <output message="tns:SayHelloResponse"/>
        </operation>
    </portType>

    <binding name="HelloBinding" type="tns:HelloPortType">
        <soap:binding style="document"
                      transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="SayHello">
            <soap:operation soapAction="http://example.com/SayHello"/>
            <input>
                <soap:body use="literal"/>
            </input>
            <output>
                <soap:body use="literal"/>
            </output>
        </operation>
    </binding>

    <service name="HelloService">
        <port name="HelloPort" binding="tns:HelloBinding">
            <soap:address location="http://example.com:8080/hello"/>
        </port>
    </service>
</definitions>

More Cheat Sheets

FAQ

Frequently asked questions

What is a WSDL cheat sheet?

A WSDL cheat sheet is a quick reference guide containing the most commonly used syntax, functions, and patterns in WSDL. It helps developers quickly look up syntax without searching through documentation.

How do I learn WSDL quickly?

Start with the basics: variables, control flow, and functions. Use this cheat sheet as a reference while practicing. For faster learning, try DocuWriter.ai to automatically explain code and generate documentation as you learn.

What are the most important WSDL concepts?

Key WSDL concepts include variables and data types, control flow (if/else, loops), functions, error handling, and working with data structures like arrays and objects/dictionaries.

How can I document my WSDL code?

Use inline comments for complex logic, docstrings for functions and classes, and README files for projects. DocuWriter.ai can automatically generate professional documentation from your WSDL code using AI.

Code Conversion Tools

Convert WSDL to Other Languages

Easily translate your WSDL code to other programming languages with our AI-powered converters

Related resources

Stop memorizing. Start shipping.

Generate WSDL Docs with AI

DocuWriter.ai automatically generates comments, docstrings, and README files for your code.

Auto-generate comments
Create README files
Explain complex code
API documentation
Start Free - No Credit Card

Join 33,700+ developers saving hours every week