mvantellingen / python-zeep

A Python SOAP client
http://docs.python-zeep.org
Other
1.88k stars 586 forks source link

WSA plugin: allow custom prefix for MessageID. #1351

Open Merinorus opened 1 year ago

Merinorus commented 1 year ago

Fix #975

Description

When using the WSA plugin, the header's field MessageID is created as follows:

<MessageID>urn:uuid:cb4dd644-d178-433d-9ec5-799e13407867</MessageID>

Some endpoints require the urn: prefix to be absent:

<MessageID>uuid:cb4dd644-d178-433d-9ec5-799e13407867</MessageID>

This PR allows you to specify the prefix you want with the WSA plugin. For instance, this fixes the author's problem in issue #975:

client = Client(
'http://examples.python-zeep.org/basic.wsdl',
    plugins=[WsAddressingPlugin(message_id_prefix="uuid:")])
bartnv commented 1 month ago

Any chance of getting this merged? It would solve a problem for me as well (I'm also trying to use the KvK Dataservice with python-zeep, like other participants in issue https://github.com/mvantellingen/python-zeep/issues/975). Currently I need to keep a modified version of wsa.py around to make this work.