0

I am trying to consume a web service with subs where I want to ignore the certificate checking since I am using a self signed certificate.

I found the way how to do this here: Bypass SSL when I'm using SUDS for consume web service

The CustomTransport class is copied exactly the same as in the answer.

But I am getting error: Exception: (415, u"Cannot process the message because the content type 'text/xml; charset=utf-8' was not the expected type 'application/soap+xml; charset=utf-8'.")

Even tho I am setting content type to soap in headers:

aHeader = {
    "Content-Type" : 'application/soap+xml; charset=UTF-8',
    "SOAPAction": "",
}

client = Client(wsdl, transport=CustomTransport(), headers=aHeader)

I can't find a reason why this is happening, can anyone help?

Community
  • 1
  • 1
Tadej Vengust
  • 1,351
  • 4
  • 18
  • 35

1 Answers1

0

It was Ignored because of the CustomTransport, so to make this work you need to put the headers inside customtransport like so:

client = Client(wsdl, transport=CustomTransport(headers=aHeader))
Tadej Vengust
  • 1,351
  • 4
  • 18
  • 35