How toWeb Service Developer Guide

Web Service Developer Guide

Sana Commerce 9.0
Your connector

Data Types Usage

The Value property in the EqualCriterion, ContainsCriterion, GreaterCriterion and LessCriterion criterion types, as well as the HighValue and LowValue properties in the BetweenCriterion criterion type, can contain the values of any data type:

  • integer
  • decimal
  • string
  • boolean
  • date and time

The data type of the value is specified in the i:type attribute in the XML format. In JSON the data type is recognized automatically by the value itself.

The table below provides the examples of how the values of different data types should be passed in the filter in XML:

Data type of the Value property XML

Integer

<Value i:type="a:int" xmlns:a="http://www.w3.org/2001/XMLSchema">1</Value>

Decimal

<Value i:type="a:decimal" xmlns:a="http://www.w3.org/2001/XMLSchema">1.1</Value>

String

<Value i:type="a:string" xmlns:a="http://www.w3.org/2001/XMLSchema">some string</Value>

Boolean

<Value i:type="a:boolean" xmlns:a="http://www.w3.org/2001/XMLSchema">false</Value>

Date and time

<Value i:type="a:dateTime" xmlns:a="http://www.w3.org/2001/XMLSchema">2011-12-29T17:56:07</Value>

The table below provides the examples of how the values of different data types should be passed in the filter in JSON:

Data type of the Value property JSON

Integer

"Value":1

Decimal

"Value":1.1

String

"Value":"Some string"

Boolean

"Value":false

Date and time

"Value":"\/Date(1325181367000)\/"
How toWeb Service Developer Guide