Skip to content

Extending datatypes (ex xsd.DateTime) #242

Closed

Description

@last-partizan

Hello, this is not an issue but rather question.

I'm using soap service which expect me to use date format like this 2016-08-14T00:00:00.000+03:00

And does not accept format used by zeep. I found zeep.xsd.DateTime which converts values to strings, but not found a way to use it.

i subclassed zeep.xsd.DateTime, and tried this:

c = zeep.Client(wsdl)
c.client.SomeMethod(SomeMethodRequest={'DateTime': MyDateTime(dt)}

and this is not working

so, how do i tell zeep to use my custom DateTime class?

Activity

  1. mvantellingen commented on Oct 30, 2016

    @mvantellingen
    Owner

    For now the easiest way is to update the zeep.xsd.builtins.default_types dictionary. You can override the builtin instance for the xsd:dateTime handling there. Bit hacky and not really future proof :-)

  2. added this to the future milestone on Oct 30, 2016
  3. last-partizan commented on Oct 30, 2016

    @last-partizan
    Author

    Thanks, that's better than my current solution using Plugin and parsing/replacing variable :)

  4. Repository owner locked and limited conversation to collaborators on Oct 13, 2024
  5. converted this issue into a discussion #1436 on Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions