Datatype Support

This topic describes mobile business object (MBO) attribute and parameter datatypes that map to data source datatypes.

You select the datatype of a given parameter or attribute from the datatype drop-down list, which maps to the data source's datatype. You define attribute and parameter datatypes in a number of Unwired WorkSpace locations, depending on the MBO development phase, including:
  • Creating MBOs – when creating MBO operations and attributes in these locations:
    • Attributes Mapping wizard
    • Operation Parameters page (when deferring binding to a data source)
    • Attributes page (when deferring binding to a data source)
  • Editing MBOs – when editing MBO attributes and parameters from the Properties view in these locations:
    • Attributes Mapping tab
    • Parameters tab
    • Operation tab
    • Attributes tab
  • Testing MBOs – use the Test Execute and Preview dialogs for testing mobile business object operations or previewing attributes.

Since attributes and parameters depend on the data source to which the MBO maps, not all attributes and parameters support all datatypes. Generally, if a datatype does not display in the drop-down list, it is not supported for that MBO.

Table 1. Datatype description
Datatype Description
Binary, Binary (%n) Select either:
  • Input manually – enter a base64 encoded string directly in the input field.
  • Import from file – browse to a file from which the input string is retrieved.
If you are choosing a binary datatype, you can set the length if you require something other than the default set in the Miscellaneous Preferences dialog. To set the length, click the cell you require in the datatype column and select binary(%n). Press enter and then type the size you require. For example, you could:
  1. Click the particular cell in the datatype column, and select BINARY(%n) from the list of datatypes.
  2. Enter the value for the binary length by highlighting %n with your cursor, and replacing it with the size you require.
  3. Press enter to set the binary length. For example, if you entered 10 as the binary length, you see binary(10) in the datatype cell.
Date Select the day in the provided calendar, and enter the local time zone in the Time zone field.
Datetime Select the day in the provided calendar, enter the time, and enter the local time zone in the Time zone field.
Time Enter the time, and enter the local time zone in the Time zone field.
String, String(%n) If you are choosing a string datatype, you can set the length of the string if you require something other than the default set in the Preferences dialog. To set the length, click the cell you require in the datatype column and select string(%n). Press enter and then type the size you require. For example, you could:
  1. Click the particular cell in the datatype column, and select STRING(%n) from the list of datatypes.
  2. Enter the value for the string length by highlighting %n with your cursor, and replacing it with the size you require.
  3. Press enter to set the string length. For example, if you entered 10 as the string length, you see STRING(10) in the datatype cell.
Enumerations (only supported for Web service MBOs derived from a WSDL file) When defining operation parameters for a Web Service MBO derived from a WSDL file, Unwired WorkSpace attempts to define those operations automatically. If successful the MBO developer need not manually define the parameter's enumeration value list. The list of values must be represented as fixed values. Use of wildcards, patterns, regular expressions, ranges, conditional statements, and any other means of specifying restrictions are not supported.

Setting enumeration values — in the Parameters page of the New Operation wizard, if the datatype of a parameter is enumeration, select it’s ‘Default Value’ cell, a drop-down list displays acceptable values from which you can choose a default value for the parameter.

Example — in this example the datatype of the parameter is String, and the Default Value drop-down list includes these values: New, Assigned, In Progress, Pending, Resolved, Closed. These enumeration values are retrieved by Unwired WorkSpace from the WSDL data source:
<xsd:element name="Status" type="s:StatusType"/>
			<xsd:simpleType name="StatusType">
				   <xsd:restriction base="xsd:string">
					     <xsd:enumeration value="New"/>
					     <xsd:enumeration value="Assigned"/>
					     <xsd:enumeration value="In Progress"/>
					     <xsd:enumeration value="Pending"/>
					     <xsd:enumeration value="Resolved"/>
					     <xsd:enumeration value="Closed"/>
				   </xsd:restriction>
	  </xsd:simpleType>
Note: Enumerations apply only to operation parameters, not directly to attributes. This may cause problems in scenarios where an operation parameter is selected as a “Fill from Attribute”. In these cases, the MBO developer must be aware of this restriction and use application logic to prevent this, otherwise expect the operation to fail when executed on the back-end data source. Since Unwired WorkSpace and Unwired Server ignores the fact that the invocation doesn't require all parameters, you must design the device application to always pass some value for each of these enumerated elements (which correspond to operation arguments in Unwired WorkSpace).
UNKNOWN Select this option if you are unsure of the datatype. UNKNOWN attributes and parameters are treated as string at runtime.
All others Enter the appropriate value in the Value field.
Related concepts
Previewing Mobile Business Objects
Avoiding Synchronization Conflicts
Related tasks
Creating Attributes for a Mobile Business Object
Creating Operations for a Mobile Business Object
Creating the Mobile Business Object using the Mobile Business Object Icon
Binding Data Sources to Mobile Business Objects


Created September 17, 2009. Send feedback on this help topic to Sybase Technical Publications: pubs@sybase.com