ZSI & Python newbie

Faser invalid at faser.net
Wed Nov 12 10:33:01 EST 2003


Sorry if this post is stupid, but I'm a python newbie. I would like to do
some experiments with webservices and I try to consume a web service that
return an italian fiscal code (a simple string). I have to send some
strings and a date (birth date). I'm using the ZSI module, but I don't
understand how I can convert a python date in a ZSI SOAP date. The
documentation doesn't help me much.
(http://pywebsvcs.sourceforge.net/zsi.html#SECTION007600000000000000000)
This is my code:

#wsdlURL = "http://www.pinellus.com/cfc/Cod_fiscale.cfc?wsdl";
import sys
import datetime

from ZSI import TC
from ZSI import ServiceProxy

cognome = 'Marco'
nome = 'Rossi'
sesso = 'M'
comune = 'Milano'
provincia = 'MI'
nascita = datetime.date(1950,12,22)
soapNascita = TC.gDate(nascita)

service = ServiceProxy('http://www.pinellus.com/cfc/Cod_fiscale.cfc?wsdl')
codice_fiscale =
service.makecod(cognome,nome,sesso,comune,provincia,soapNascita)
print codice_fiscale

The error is:
File "D:\MySoft\Python\codicefiscale\cf.py", line 16, in ?
soapNascita = TC.gDate(nascita)
File "C:\PROGRA~1\Python23\Lib\site-packages\ZSI\TC.py", line 65, in
__init__
i = self.pname.find(':')
AttributeError: 'datetime.date' object has no attribute 'find'

Could you point me in the right direction to solve this problem?
Thanks in advance.

Faser
-- 
FABIO SERRA
*Questo testo deve essere valutato secondo il senso della RFC-3*
Per rispondere in e-mail sostituire "invalid" con "faser"
--------------------




More information about the Python-list mailing list