【问题标题】:wso2 DSS Value type miss match, Expected value type - 'dateTime', but found - 'STRING'wso2 DSS 值类型未匹配,预期值类型 - 'dateTime',但找到 - 'STRING'
【发布时间】:2016-11-25 19:03:18
【问题描述】:

我想用 wso2 dss 将此对象保存到数据库中。但它显示日期格式有误。

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

示例帖子信息是这样的

{
"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>

请帮帮我!!!!

【问题讨论】:

    标签: json apache wso2 axis2 wso2dss


    【解决方案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 格式化程序。

    【讨论】:

      【解决方案2】:

      此问题已在 DSS 即将发布的版本 (3.5.1) 中修复。相关的 JIRA 是 DS-1190。作为一种解决方法,您可以按照建议切换到 org.apache.axis2.json.JSONMessageFormatter 和 org.apache.axis2.json.JSONOMBuilder。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-03-02
        • 1970-01-01
        • 2021-08-05
        • 2016-07-13
        相关资源
        最近更新 更多