Data Types

PocketSOAP supports most of the types from XML Schema, these are mapped to the nearest matching COM type. You can override these mappings via the SerializerFactory.
Schema Type COM Type Notes
string BSTR [VT_BSTR]  
byte char [VT_I1]  
short short [VT_I2]  
int long [VT_I4]  
long longlong [VT_I8] Note that many environments (including VB & VBScript) don't support the VT_I8 type, you'll need to register your own mapping for xsd:long to a type that is supported in your environment
unsignedByte byte [VT_UI1]  
unsignedShort unsigned short [VT_UI2]  
unsignedInt unsigned long [VT_UI4]  
unsignedLong unsigned longlong [VT_UI8]  
decimal VT_DECIMAL  
float single [VT_R4]  
double double [VT_R8]  
boolean VARIANT_BOOL [VT_BOOL]  
dateTime DATE [VT_DATE] As COM dates/times have no concept of timezone, pocketSOAP assumes date/times passed in are in UTC, and returns then in UTC.
date DATE [VT_DATE]
time DATE [VT_DATE]
anyType VARIANT [VT_VARIANT]  
anyURI BSTR [VT_BSTR]  
base64Binary Byte Array [VT_UI1 | VT_ARRAY]  
hexBinary Byte Array [VT_UI1 | VT_ARRAY] This is only registered for de-serialization for default. Call serializer to map VT_ARRAY | VT_UI1 to use this during serialization instead of the base64Binary type
QName pocketSOAP QName object  

In addition arrays [single or multidimension] of the above types are supported.

If the SerializerFactory is set to scripting mode, then the arrays are de-serialized into arrays of VARIANTs of the relevant type.

In normal mode, arrays are de-serialized into arrays of the specific type, e.g. if you de-serialize an array with arrayType="xsd:string[3]" then you'll get back an SAFEARRAY(BSTR) of the correct size.

The above Schema types are from the final recommendation for XML Schemas. In addition pocketSOAP supports the equivilent set of types from the 1999 Schmema working draft. [A number of servers only use the 1999 schema types, as that was the current version at the time the SOAP 1.1 specification was written]

During de-serialization any element containing a xsi:nil='1' attribute will be de-serialized to a Variant of type VT_NULL, except for strings, which will be de-serialized to a Variant of type VT_BSTR with a NULL value.


Copyright

Copyright © Simon Fell, 2000-2004. All rights reserved.