# WS-Addressing

wsa:Action, wsa:MessageID and the other routing headers - added and parsed with one checkbox.

WS-Addressing puts the routing metadata of a SOAP exchange - what operation this is, which message it is, where it goes and where replies belong - into standard `wsa:*` header elements instead of leaving it to the transport. Document-exchange profiles in healthcare (IHE) and many government endpoints require these headers on every request.

In Zato it is one checkbox - **WS-Addressing** on the SOAP tab of an outgoing connection.

## What is sent {#what-is-sent}

With the checkbox on, every request includes:

- `wsa:Action` - the connection's SOAP action
- `wsa:MessageID` - a fresh unique identifier per request
- `wsa:To` - the connection's address
- `wsa:ReplyTo` - the anonymous reply endpoint, meaning replies come back on the same HTTP response

Your service does not build any of these - it assigns business fields to a `SOAPMessage` and the headers are added when `invoke` runs.

## What is read {#what-is-read}

The reply's addressing headers are parsed off the response and exposed as the reserved `addressing` attribute - a service can inspect them when it needs them and ignore them otherwise:

```python
response = self.soap['Document Registry'].invoke('DocumentQuery', request)

addressing = response.addressing

self.logger.info('Reply action: %s', addressing.action)
self.logger.info('Reply message id: %s', addressing.message_id)
self.logger.info('In reply to: %s', addressing.relates_to)
```

`relates_to` echoes the `wsa:MessageID` of the request that the reply answers, and correlation-aware endpoints use it to match each reply to its request.

## Learn more {#learn-more}

- [SOAP integrations](https://zato.io/docs/dev/soap/) - Envelopes, versions and Python objects instead of XML
- [SOAP as Python objects](https://zato.io/docs/dev/soap/python-objects/) - Build requests and read responses with dot access, no schemas
- [SOAP security](https://zato.io/docs/dev/soap/security/) - WS-Security, credentials in the body and client certificates
- [MTOM and SwA attachments](https://zato.io/docs/dev/soap/attachments/) - Binary content out of the envelope and into MIME parts
- [SOAP mandates](https://zato.io/docs/dev/soap/mandates/) - What each national and sector profile requires, and how to meet it
- [SOAP tutorial](https://zato.io/tutorials/soap/calling.html) - Call any SOAP service with Python objects, start to finish
