How to use a complex type from a WSDL with zeep in Python

前端 未结 1 2082
一整个雨季
一整个雨季 2021-02-14 09:23

I have a WSDL that contains a complex type like so:


  
    

        
相关标签:
1条回答
  • 2021-02-14 10:09

    The client.get_type() method returns a 'type constructor' that you can later use to construct the value. You need to assign the constructed value to a separate variable and use that variable in the method invocation:

    wsdl = "https://wsdl.location.com/?wsdl"
    client = Client(wsdl=wsdl)
    string_array_type = client.get_type('tns:string_array')
    string_array = string_array_type(['some value'])
    client.service.method(string_array)
    
    0 讨论(0)
提交回复
热议问题