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

前端 未结 1 1122
忘掉有多难
忘掉有多难 2021-02-14 09:29

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


  
    

        
1条回答
  •  迷失自我
    2021-02-14 10:10

    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)
提交回复
热议问题