1

So i'm using suds-jurko for python3 and I have a value in my request like this:

`Date = None`

Date is not a required field. The issue I'm running into is when it processes the request, I get the error:

WebFault: Server raised fault: 'The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://webservices.soapclient.com/v11:request. The InnerException message was 'There was an error deserializing the object of type WebServices.Posting.Request. The value '' cannot be parsed as the type 'DateTime'.'. Please see InnerException for more details.'

Any clue how I can pass a valid NoneType so that my client won't convert it to an empty string?

Rob
  • 3,333
  • 5
  • 28
  • 71

1 Answers1

0

If the Date field is optional, you should completely skip it and not try to pass any value at all (even if it's set to NoneType).

Cahit
  • 2,484
  • 19
  • 23
  • My suggestion is to use named parameters when calling `client.service.soap_method(arg1 = x, arg2 = y, arg3 = z)` and just not pass the optional parameter as an argument. – Cahit Jan 02 '16 at 06:51
  • If you're having this problem while using complex types, I also came across this related question that might be helpful: http://stackoverflow.com/questions/9388180/suds-generates-empty-elements-how-to-remove-them – Cahit Jan 02 '16 at 08:03