2016-04-07 35 views
1

我特林使用SOAP客戶端調用bluedart PIN碼主API,但傳遞的參數後,給出了錯誤無法解析的datetime類型

請求參數 -

$params = array(
      'lastSynchDate' => '06-04-2016', 
      'Profile' => 
       array(
        'Api_type' => 'S', 
        'LicenceKey'=>$licencekey, 
        'LoginID'=>$loginid, 
        'Version'=>'1.3' 
       ) 
     ); 

響應的錯誤 -

The formatter threw an exception while trying to deserialize the message: 

There was an error while trying to deserialize parameter http://tempuri.org/:lastSynchDate. 
The InnerException message was 'There was an error deserializing the object of type System.DateTime. 
The value '06-04-2016' cannot be parsed as the type 'DateTime' 

我該如何解決這個問題?

回答

1

雖然我從來沒有使用bluedart pincode master api但我確定這是因爲日期不是標準的YYYY-MM-DD格式。

而不是

06-04-2016

嘗試

2016-06-04