No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2021-12-09 16:59:16 +01:00
soap Add code and documentation for a production deployment 2021-12-09 16:59:16 +01:00
tests Update test_server.py 2021-12-09 14:26:27 +01:00
.flake8 Initial commit 2021-12-09 14:16:14 +01:00
.gitignore Initial commit 2021-12-09 14:16:14 +01:00
hello.wsdl Initial commit 2021-12-09 14:16:14 +01:00
poetry.lock Initial commit 2021-12-09 14:16:14 +01:00
pyproject.toml Initial commit 2021-12-09 14:16:14 +01:00
README.md Add code and documentation for a production deployment 2021-12-09 16:59:16 +01:00
tasks.py Initial commit 2021-12-09 14:16:14 +01:00

SOAP demo using Python

Setup

  • Install Python >= 3.9
  • Install poetry
  • Install required dependencies:
$ poetry install

Running the demo

# Start the server in a first shell
$ poetry run python soap/server.py

# Call the say_hello method from an other shell:
$ poetry run python soap/client.py

What's in the repo

In soap/client.py - a SOAP client, written using the zeep library.

In soap/server.py - a SOAP server, written using spyne.

In ./hello.wsdl, the definition of the methods exposed by the demo server

Running the linters and tests

$ poetry run invoke lint
$ poetry run pytest

Deployment

The Server class uses the server from the wsgiref.simple_server standard library module, which is not suitable for production (but fine for development and tests).

For the production environment, one may use gunicorn, like this:

$ gunicorn soap.wsgi:app -b 0.0.0.0:5678