mvantellingen / python-zeep

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

How to Generate Complex Types #725

Closed ghost closed 6 years ago

ghost commented 6 years ago

I met some problems:

from zeep import Client client = Client("demo.wsdl")

//I want call the method,but it needs some parameters. // after i read the doc,but i still don't know how to create the complex types. // TokenCreateRQ(version,_soapheaders)

client.service.TokenCreateRQ()

I have try get_element or directly create it by json object, but not works.

is there any tool like java's "wsimport"?

thanks very much, I only know SOAP a little

ghost commented 6 years ago

more details

c = Client("xx.wsdl")

c.service.TokenCreateRQ(_soapheaders = {"Header":{"MessageHeader":{"From":"999999","To":"123123","CPAId":"xxx","ConversionId":"123123123","S ...: ervice":"xxx","Action":"xxx","MessageData":{"MessageId":"1000","Timestamp":"2001-02-15T11:15:12z","TimeToLive":"2001-02-15T11-1 ...: 5-12z"},"SecurityHeader":{}}}})

TypeError: ComplexType() got an unexpected keyword argument 'Header'. Signature: header: {http://www.ebxml.org/namespaces/messageHeader}MessageHeader, header2: {http://schemas.xmlsoap.org/ws/2002/12/secext}Security

I Don't Have any ideas about how to make xml format -> json format

mvantellingen commented 6 years ago

See https://docs.python-zeep.org/