簡體   English   中英

使用python的suds作為SOAP客戶端並且無法處理NoneType

[英]Using suds for python as a SOAP client and failing to handle NoneType

所以我為python3使用suds-jurko,而我的請求中有一個值,如下所示:

`Date = None`

日期不是必填字段。 我遇到的問題是在處理請求時,出現錯誤:

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.'

有什么線索可以傳遞有效的NoneType以便我的客戶端將其轉換為空字符串嗎?

如果Date字段是可選的,則應完全跳過它,並且不要嘗試傳遞任何值(即使將其設置為NoneType)。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM