- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 604
Open
Labels
Description
Zeep 2.5.0
Python 3.6.0
WSDL: http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl
Running
client = Client(wsdl=self.BASE_URL)
response = client.service.checkVat(countryCode='NL', vatNumber='TESTVATNUMBER')
gives me a value of datetime.date(2018, 6, 6)
for requestDate
. I was a bit suspicious because the time zone is missing here, so I checked the 'raw' XML output:
client = Client(wsdl=self.BASE_URL)
with client.options(raw_response=True):
response = client.service.checkVat(countryCode='NL', vatNumber='TESTVATNUMBER')
which gives me <requestDate>2018-06-06+02:00</requestDate>
(I was expecting a time here too, but the wsdl clearly states that requestDate
is in xsd:date
format, so no time), so the time zone is actually provided by the service.
What could be the problem here? Any help would be appreciated.
Metadata
Metadata
Assignees
Labels
Projects
Milestone
Relationships
Development
Select code repository
Activity
mvantellingen commentedon Jun 16, 2018
The date is parsed using the isodate module, see https://github.com/mvantellingen/python-zeep/blob/master/src/zeep/xsd/types/builtins.py#L177
Python doesn't support timezones for times. So to support this properly we should always return a datetime object instead of a date object.