2016-07-22 109 views
1

我想用wso2 dss將此對象保存到數據庫中。但它顯示日期格式中有錯誤。wso2 DSS值類型未命中匹配,預期值類型 - 'dateTime',但找到 - 'STRING'

Value type miss match, Expected value type - 'dateTime', but found - 'STRING' 

例如交messgae是這個

{ 
"insert_subscribe_merchant_operation": 
{ 
     "customerrefid": 1, 
     "merchantrefid": "1", 
     "datetime": "2012-03-14T00:00:00+05:30", 
     "registereddevice":"1234567890", 
     "latlongregistered": "xczv", 
     "totalpoints":1000, 
     "redeemablepoints":800, 
     "expirydate": "2012-03-14T00:00:00+05:30", 
     "qrcode": "xvc", 
     "currentoffercount":10, 
     "schemerefid":1 
     } 
} 

,但是當我使用XML試着鍵入它工作正常

<insert_subscribe_merchant_operation> 
     <customerrefid>1</customerrefid> 
     <merchantrefid>"1"</merchantrefid> 
     <datetime>2012-03-14T00:00:00+05:30</datetime> 
     <registereddevice>"1234567890"</registereddevice> 
     <latlongregistered>"234"</latlongregistered> 
     <totalpoints>876</totalpoints> 
     <redeemablepoints>345</redeemablepoints> 
     <expirydate>2012-03-14T00:00:00+05:30</expirydate> 
     <qrcode>"?"</qrcode> 
     <currentoffercount>20</currentoffercount> 
     <schemerefid>1</schemerefid> 
</insert_subscribe_merchant_operation> 

請幫我!!!!

回答

1

這在DSS即將發佈的版本(3.5.1)中得到修復。相關的JIRA是DS-1190。作爲解決方法,您可以按照建議切換到org.apache.axis2.json.JSONMessageFormatter和org.apache.axis2.json.JSONOMBuilder。

1

通過修改WSO2 DSS axis2.xml

<messageFormatter contentType="application/json" 
       class="org.apache.axis2.json.JSONMessageFormatter"/> 
<messageBuilder contentType="application/json" 
       class="org.apache.axis2.json.JSONOMBuilder"/> 

通過去除GSON格式化器解決了這個。

相關問題