Using the ElementTree Module to Generate SOAP Messages

November 2003 | Fredrik Lundh

Note: A distribution kit containing the source code for this article is available from the downloads site (look for elementsoap).

The Simple Object Access Protocol (SOAP) is an XML-based protocol for “information exchange in distributed environments”. SOAP can be used in many different ways, but the most common approach is to use it for RPC requests over HTTP, where a client application sends a SOAP request message to a remote server, and the server returns a SOAP response message to the client.

In this article series, I’m going to use the ElementTree module to generate and process SOAP messages.


  1. Talking to a Stock Quote Server
  2. Talking to Google
  3. Dealing with Qualified Names
  4. Automatically Decoding Responses
  5. Parsing WSDL Descriptions (to be added)

A Django site. rendered by a django application. hosted by webfaction.