Skip to main content

Overview

WSDL Specification: https://api.petstoreapi.com/v1/specs/modern-petstore.wsdl Protocol: SOAP (Simple Object Access Protocol) WSDL Version: WSDL 1.1 / WSDL 2.0 compatible Binding: SOAP 1.1 over HTTP WSDL is an XML-based interface description language for describing the functionality offered by a SOAP web service. It provides a machine-readable description of how the service can be called, what parameters it expects, and what data structures it returns.

What is WSDL?

WSDL (Web Services Description Language) is an XML format for describing network services as a set of endpoints operating on messages. It was designed for SOAP-based web services and provides a formal contract for service integration.

Key Features

  • Service Contract: Formal definition of service operations
  • Type System: Uses XML Schema for data types
  • Protocol Binding: Supports SOAP, HTTP, and other protocols
  • Enterprise Integration: Standard for enterprise service buses (ESB)
  • Tool Support: Wide tooling support across platforms
  • Strong Typing: Strict schema validation

When to Use WSDL/SOAP

WSDL is particularly useful when:
  • Integrating with enterprise systems (SAP, Oracle, Microsoft)
  • Requiring formal service contracts (SLA agreements)
  • Working with .NET or Java enterprise frameworks
  • Needing built-in security (WS-Security)
  • Supporting transactional operations (WS-AtomicTransaction)
  • Implementing complex messaging patterns

WSDL Structure

A WSDL document consists of these main elements:

Understanding WSDL Elements

Types

Defines data structures using XML Schema:

Messages

Defines input and output messages for operations:

Port Type

Defines abstract operations:

Binding

Specifies concrete protocol and data format:

Service

Defines endpoint location:

Using SOAP Services

SOAP Request Format

SOAP messages are XML envelopes containing headers and body:

SOAP Response Format

SOAP Fault (Error) Format


Client Code Examples

Java (JAX-WS)

C# (.NET)

Python (Zeep)

PHP (SoapClient)


Code Generation

Generate Java Client

Generate C# Client

Generate Python Client


Security (WS-Security)

SOAP services support WS-Security for authentication and encryption:

Username Token Authentication

Java WS-Security Example


Best Practices

1. Use Document/Literal Style

Reason: Document/literal style is WS-I compliant and provides better interoperability.

2. Design Coarse-Grained Operations

3. Use Meaningful Fault Messages

4. Version Your Services

Include version in namespace and endpoint:

SOAP vs REST

When to Use SOAP

✅ Choose SOAP when:
  • Working with enterprise systems (SAP, Oracle, etc.)
  • Need formal service contracts (WSDL)
  • Require built-in security (WS-Security)
  • Supporting transactional operations
  • Legacy system integration requirements

When to Use REST

✅ Choose REST when:
  • Building modern web/mobile APIs
  • Need high performance and scalability
  • Want simple, human-readable APIs
  • Targeting multiple platforms
  • Using microservices architecture

WSDL Tools

Validators

XMLSpy
  • Full WSDL validation
  • Schema validation
  • SOAP message testing
SoapUI
Postman
  • Import WSDL
  • Generate SOAP requests
  • Test SOAP services

Analyzers

WSDL Analyzer

Migration Guide

From SOAP to REST

Modern APIs are moving from SOAP to REST. Here’s the mapping: Example Conversion:

Additional Resources


Support

For questions or issues with the WSDL specification: