CoSerializerFactory CoClass

uuid(31d91001-a499-4b2d-81c3-01d6c1d807cc)
progid(pocketSOAP.SerializerFactory.1)

The serializer factory is responsible for maintaining the mapping data between COM types and SOAP types, the serializer factory exposes methods in the ISerializerFactory method to make finding the correct [de]serializers easy. You can configure the serializer factory through the ISerializerFactoryConfig interface.

 

Supported Interfaces

Name Description
ISerializerFactory  [default] This is the interface to the serializerFactory that the serializer engine uses, the serializer factory is used to find the correct serializer for particular types, its where most of the "knowledge" about XSD is coded.
ISerializerFactoryConfig   This interface is used to configure an instance of the serializerFactory
ISerializerFactoryConfig2   This allows you to setup local element type mappings.
ISerializerFactory2   Extends the type resolution to include local types support.
ISerializerFactoryPool   This allows access to the serializer pool maintained by the serializerFactory
ISerializerFactoryPool2   This interface is used to access the [de]serializer pool
ISerializerFactoryEx   Extended serializerFactory methods
ISerializerFactoryConfig3   allows for the configuration of understood SOAP Headers

 

How to Instantiate

You can create a stand alone instance of the serializer Factory with
set sf = CreateObject("pocketSOAP.SerializerFactory.1")

this is useful if you have extensive configuration changes to make, you can create a single instance of the serializer factory, make the calls to ISerializerFactoryConfig to get it configured as you need it, then tell each Envelope object to use this serializer factory rather than the default one by calling ISOAPEnvelope::putref_SerializerFactory(...). If you don't tell the Envelope to use a particular serializer factory, then it will create and use the default serializer factory [this is fine in many cases]

 

Sample Code

dim sf, e
set sf = CreateObject("pocketSOAP.SerializerFactory.1")

' we are talking to an old endpoint, and have to use the old 1999 schema version
sf.PrimarySchema = "http://www.w3.org/1999/XMLSchema"

' use the scripting friendly mode [all arrays are arrays of variants]
sf.SetConfig ( sfcScripting )

' if we receive an untyped element call memorysize, treat is as an xsd:int [a signed 32 bit number]
sf.ElementMapping "memorysize", "", "http://www.w3.org/1999/XMLSchema", "int"

set e = CreateObject("pocketSOAP.Envelope.2")
' tell this envelope to use our serializer factory config we just built, rather than the default
set e.SerializerFactory = sf

 

See Also

The PocketSOAP Library | 

 

 

Copyright

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