Python 带zeep的xsd:string[]字符串的SOAP列表

Python 带zeep的xsd:string[]字符串的SOAP列表,python,soap,zeep,Python,Soap,Zeep,我必须与WSDL交互。当我探索去WSDL时 $ python3 -mzeep "http://xxxxxxxxx/xxxxx/xxxx?wsdl" 它回来了 Prefixes: xsd: http://www.w3.org/2001/XMLSchema ns0: http://sina/ Global elements: ns0:recuperaAdmins(ns0:recuperaAdmins) ns0:recuperaAdminsResponse

我必须与WSDL交互。当我探索去WSDL时

$ python3 -mzeep "http://xxxxxxxxx/xxxxx/xxxx?wsdl" 
它回来了

Prefixes:
     xsd: http://www.w3.org/2001/XMLSchema
     ns0: http://sina/

Global elements:
     ns0:recuperaAdmins(ns0:recuperaAdmins)
     ns0:recuperaAdminsResponse(ns0:recuperaAdminsResponse)

Global types:
     xsd:anyType
     ns0:administracion(codUser: xsd:string, codigVia: xsd:string, descripVia: xsd:string, dia: xsd:dateTime, dosis: xsd:double, estadoAdmin: xsd:string, hora: xsd:string, id_administracion: xsd:int, prn: xsd:boolean, prnMotivo: xsd:string, unidades: xsd:string)
     ns0:episodio(codigoPrescripcion: xsd:int, episodio: xsd:string, listaTratamientos: ns0:tratamiento[])
     ns0:paciente(apellidos: xsd:string, listaEpisodios: ns0:episodio[], nhc: xsd:string, nombre: xsd:string)
     ns0:presentacion(codNacional: xsd:string, codNavision: xsd:string, nombre: xsd:string)
     ns0:recuperaAdmins(listaPac: xsd:string[], fechaHoraInicio: xsd:dateTime, fechaHoraFin: xsd:dateTime, estado: xsd:string)
     ns0:recuperaAdminsResponse(return: ns0:paciente[])
     ns0:tratamiento(codTrat: xsd:int, descripTrat: xsd:string, listaAdmin: ns0:administracion[], listaPresent: ns0:presentacion[])
     xsd:ENTITIES
     xsd:ENTITY
     xsd:ID
     xsd:IDREF
     xsd:IDREFS
     xsd:NCName
     xsd:NMTOKEN
     xsd:NMTOKENS
     xsd:NOTATION
     xsd:Name
     xsd:QName
     xsd:anySimpleType
     xsd:anyURI
     xsd:base64Binary
     xsd:boolean
     xsd:byte
     xsd:date
     xsd:dateTime
     xsd:decimal
     xsd:double
     xsd:duration
     xsd:float
     xsd:gDay
     xsd:gMonth
     xsd:gMonthDay
     xsd:gYear
     xsd:gYearMonth
     xsd:hexBinary
     xsd:int
     xsd:integer
     xsd:language
     xsd:long
     xsd:negativeInteger
     xsd:nonNegativeInteger
     xsd:nonPositiveInteger
     xsd:normalizedString
     xsd:positiveInteger
     xsd:short
     xsd:string
     xsd:time
     xsd:token
     xsd:unsignedByte
     xsd:unsignedInt
     xsd:unsignedLong
     xsd:unsignedShort

Bindings:
     Soap11Binding: {http://sina/}FarhosPortBinding

Service: Farhos
     Port: FarhosPort (Soap11Binding: {http://sina/}FarhosPortBinding)
         Operations:
            recuperaAdmins(listaPac: xsd:string[], fechaHoraInicio: xsd:dateTime, fechaHoraFin: xsd:dateTime, estado: xsd:string) -> return: ns0:paciente[]
我必须使用RecuroperaAdmins操作,该操作将listaPac:xsd:string[]作为第一个参数。那么,从字符串数组开始,如何将其转换为xsd:string[]

我试过了

stringArray_type = client.get_type('xsd:string[]')
但它不起作用

有什么想法吗


提前感谢。-

因为您使用的是
zeep
,所以它应该负责转换本身。 因此,您的用例如下所示:

from zeep import Client
client = Client("http://xxxxxxxxx/xxxxx/xxxx?wsdl")

listaPac = ['abc', 'def', 'ghi']

response = client.service.recuperaAdmins(listaPac=listaPac, fechaHoraInicio=dateTime, fechaHoraFin=dateTime, estado=string)

如果有错误,请务必让我们知道。
希望这有帮助。

因为您使用的是
zeep
,所以它应该负责转换本身。 因此,您的用例如下所示:

from zeep import Client
client = Client("http://xxxxxxxxx/xxxxx/xxxx?wsdl")

listaPac = ['abc', 'def', 'ghi']

response = client.service.recuperaAdmins(listaPac=listaPac, fechaHoraInicio=dateTime, fechaHoraFin=dateTime, estado=string)

如果有错误,请务必让我们知道。
希望这能有所帮助。

非常感谢你,塔里克!它就像一个符咒!我很欢迎你。感谢您接受答案。:)非常感谢你,塔里克!它就像一个符咒!我很欢迎你。感谢您接受答案。:)