Skip to content

WS-Addressing — Standardized Message Routing for SOAP Web Services

DodaTech Updated 2026-06-28 2 min read

In this tutorial, you will learn about WS. We cover key concepts, practical examples, and best practices to help you master this topic.

WS-Addressing is a SOAP standard that defines XML elements for routing messages, specifying source, destination, reply-to addresses, and message correlation IDs.

What You'll Learn

  • WS-Addressing headers and their purposes
  • Asynchronous message patterns
  • Routing through intermediaries

Why It Matters

WS-Addressing enables complex message exchange patterns beyond simple request-response, supporting asynchronous processing and multi-hop routing.

Code Examples

<!-- WS-Addressing headers in SOAP -->
<soap:Header>
  <wsa:MessageID xmlns:wsa="http://www.w3.org/2005/08/addressing">
    uuid:a1b2c3d4-e5f6-7890-abcd-ef1234567890
  </wsa:MessageID>
  <wsa:To xmlns:wsa="http://www.w3.org/2005/08/addressing">
    http://example.com/orders/processor
  </wsa:To>
  <wsa:Action xmlns:wsa="http://www.w3.org/2005/08/addressing">
    http://example.com/orders/PlaceOrder
  </wsa:Action>
  <wsa:ReplyTo xmlns:wsa="http://www.w3.org/2005/08/addressing">
    <wsa:Address>http://example.com/callback</wsa:Address>
  </wsa:ReplyTo>
  <wsa:From xmlns:wsa="http://www.w3.org/2005/08/addressing">
    <wsa:Address>http://client.example.com</wsa:Address>
  </wsa:From>
  <wsa:RelatesTo xmlns:wsa="http://www.w3.org/2005/08/addressing"
      RelationshipType="http://www.w3.org/2005/08/addressing/reply">
    uuid:original-message-id
  </wsa:RelatesTo>
</soap:Header>
# WS-Addressing headers in Python (using zeep)
from zeep import Client
from zeep.transports import Transport
from requests import Session

session = Session()
session.headers.update({
    'Content-Type': 'text/xml; charset=utf-8',
    'SOAPAction': 'PlaceOrder'
})
transport = Transport(session=session)
client = Client('http://example.com/orders?wsdl', transport=transport)

# WS-Addressing is handled automatically by the SOAP library
result = client.service.PlaceOrder(
    CustomerID='12345',
    ItemID='ABC-789'
)

Common Mistakes

1. Missing MessageID

Every message should have a unique ID for correlation and tracking.

2. Incorrect ReplyTo Address

The ReplyTo must be a valid endpoint that can receive the response.

3. Not Using RelatesTo for Correlation

Without RelatesTo, responses cannot be matched to their requests.

4. Confusing To with Endpoint URL

The To header and the HTTP endpoint can differ when routing through intermediaries.

5. Ignoring Action Header

The Action header identifies the intended operation, enabling content-based routing.

Practice Questions

  1. What is the purpose of WS-Addressing?
  2. What does the ReplyTo header specify?
  3. How does RelatesTo enable message correlation?
  4. What is the Action header used for?
  5. Why might To differ from the HTTP endpoint?

Answers:

  1. To provide transport-neutral addressing and routing for SOAP messages.
  2. The endpoint where the response should be sent.
  3. It links a response to its original request message.
  4. To identify the intended operation for content-based routing.
  5. When messages pass through intermediaries before reaching the final destination.

Challenge: Design a WS-Addressing flow for an order processing system where an initial request goes to a router, then to a processor, and the response returns to a callback endpoint.

FAQ

Is WS-Addressing required for SOAP?

: No, but it's required for asynchronous patterns and advanced routing.

Does WS-Addressing replace transport-level addressing?

: No. It complements it by providing application-level addressing.

Can WS-Addressing work with non-HTTP transports?

: Yes. It's transport-neutral and works with JMS, SMTP, etc.

What's Next

Learn about WS-Security for authentication and encryption, then compare REST vs SOAP.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro