mvantellingen / python-zeep

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

does it support multiple return values? #1396

Open jeffery9 opened 8 months ago

jeffery9 commented 8 months ago

Please keep the issues that real bug reports only. Please request help/support on a relevant channel like stackoverflow. This issue will most likely be closed.

Doese Zeep support soap web services return multiple values? Can add this feature into tests case?

thanks.

jeffery9 commented 8 months ago

great. have do a test, it support this features.

from zeep import Client

wsdl ='http://127.0.0.1:8000/?wsdl'

client = Client(wsdl=wsdl)

func = client.service.add_and_multiply
# add_and_multiply(num1: xsd:integer, num2: xsd:integer) -> add_and_multiplyResult0: xsd:integer, add_and_multiplyResult1: xsd:integer, add_and_multiplyResult2: xsd:string

repl = func(1,2)

print(repl.add_and_multiplyResult0)
print(repl.add_and_multiplyResult1)
print(repl.add_and_multiplyResult2)
print(repl)

# #
# 3
# 2
# The sum of 1 and 2 is 3, and the product is 2
# {
#     'add_and_multiplyResult0': 3,
#     'add_and_multiplyResult1': 2,
#     'add_and_multiplyResult2': 'The sum of 1 and 2 is 3, and the product is 2'
# }