Simon Fell > Its just code > xsd:long

Sunday, November 6, 2005

Since the early days PocketSOAP has supported the xsd:long data type (a 64 bit signed integer) by mapping it to the VT_I8 variant type, however lots of people have run into the issue that most COM languages don't support the VT_I8 type (c++ being the only one I'm aware of that does). This is an issue for web services that use the xsd:long datatype, which is popular with the Java & C# folks, both of which support a native 64 bit integer type.

The just released PocketSOAP 1.5.3 adds a wrapper object to handle xsd:long better, this allows you to both send & receive xsd:long types.

You need to register the new type with the serializer factory so that it overrides the default mapping to the COM VT_I8 type. The object itself has properties for a stringified version, as well as access to the hi & lo dwords.

here's a sample usage

Dim e As New CoEnvelope
Dim xsdl As New CoXsdLong
xsdl.Register e.SerializerFactory
' a value of 4294967328
xsdl.LoDWord = 32
xsdl.HiDWord = 1
' or just do
xsdl.string = "4294967328"

e.setMethod "echoLong" , "http://unititests.pocketsoap.com/"
e.parameters.create "x", xsdl
http.send "http://some.where/", e
e.parse http

set xsdl = e.parameters.item(0).value
msgbox xsdl.string