Thomas Nys
Thomas Nys

Reputation: 359

Python Zeep - di: precdix not showing on security headers

I'm trying to interact with a SOAP web service using Zeep. The security headers generated by Zeep seem similar to the documentation of the web service but I notice that several nodes (Signature for example) miss a di:-prefix compared to the documentation.

This is my code:

import xmlsec
from zeep import Client
from zeep.plugins import HistoryPlugin
from zeep.wsse import BinarySignature

import logging.config

logging.config.dictConfig({
    'version': 1,
    'formatters': {
        'verbose': {
            'format': '%(name)s: %(message)s'
        }
    },
    'handlers': {
        'console': {
            'level': 'DEBUG',
            'class': 'logging.StreamHandler',
            'formatter': 'verbose',
        },
    },
    'loggers': {
        'zeep.transports': {
            'level': 'DEBUG',
            'propagate': True,
            'handlers': ['console'],
        },
    }
})
history = HistoryPlugin()

client = Client("https://xxxxx/xxx.wsdl", plugins=[history],
                wsse=BinarySignature(
                    'key.pem', 'cert.pem',
                    'xxxxxx'))

client.set_ns_prefix("ns2", "http://www.xxxxx/webservice")

client.service.matcherTwo(ondernemingsNummer="xxxxx",
                         dog=dict(naam="xxx", cat="xxx", dateOfBirth="2012-09-10"),
                         referenceDate="2016-02-16+01:00")

It would be great if someone could give me a pointer of what I am doing wrong.

Upvotes: 1

Views: 259

Answers (0)

Related Questions