mvantellingen / python-zeep

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

Passing parameters to SOAP Zeep client #624

Open GiuseppePegasus opened 7 years ago

GiuseppePegasus commented 7 years ago

I'm using Zeep library to query a SOAP webservice wrote in Java. My piece of the wsdl file is: `

XXXX 11223344 prova CCIAA_MI 2 1 3 2 1 TA ` and I create a SOAP client in this manner: def soapclient(request): session = Session() session.auth = HTTPBasicAuth('user', 'password', transport=Transport(session=session)) client = Client('my_url_of_wsdl_file.wsdl') utenteApplicativo='XXXX' idCarrelloSorgente=11223344 itemCarrelloDtoList=('prova', 'Datatest', 2, 1, 3, 2, 1, 'TA') carrelloDto=(idCarrelloSorgente, itemCarrelloDtoList) var=(utenteApplicativo, carrelloDto) call=client.service.creaCarrello(var) var=(utenteApplicativo, carrelloDto) print('variabile del client: ', var) call1=client.service.creaCarrello(var) print(call1) but I receive the error: ValidationError at /soapclient/ Missing element utenteApplicativo (creaCarrello.GestioneCarrelliRequest) The problem it seems the manner of passing the parameters. With this other manner: call=client.service.creaCarrello(XXXX', {11223344, {'causale':'prova', 'codiceEnte':'CCIAA_MI', \ 'importo':2, 'importoImposta':1, 'importoTotale':3, 'importoUnitario':2, 'quantitaItem':1, 'tipoContabilizzazione':'TA'}, },) I receive the error: unhashable type: 'dict'. Can you help me to understand what is the correct manner to pass these parameters to the zeep client? There are a set of parameters inside another set..Is it supported by zeep? Thanks.
Flavio1998 commented 6 years ago

I have the same problem, do you got anything working by now?

GiuseppePegasus commented 6 years ago

No solution found, any suggestion..I migrated to Suds.

Flavio1998 commented 6 years ago

OK, thanks. I wil try Suds myself.

GiuseppePegasus commented 6 years ago

Suds is more documented and I found solution to my problem very well and very fast.