I hope the sample helps.
manager := XMLObjectMarshalingManager
on: (XMLObjectBinding loadFrom:
'<?xml version ="1.0"?>
<xmlToSmalltalkBinding name="TestChoiceBinding"
targetNamespace="urn:test:TestChoiceBinding"
xmlns:xsd="
http://www.w3.org/2000/10/XMLSchema"
xmlns:tns="urn:test:TestChoiceBinding">
<object name="Parameter" smalltalkClass="Association">
<element name="key" ref="xsd:string" aspect="key"/>
<element name="value" ref="pStruct" minOccurs="0"
maxOccurs="*"/>
</object>
<struct name="pStruct" smalltalkClass="WebServices.Struct">
<choice>
<element name="string" ref="xsd:string"/>
<element name="int" ref="xsd:short"/>
</choice>
</struct>
</xmlToSmalltalkBinding>' readStream).
assoc := '1'-> (OrderedCollection
with: (WebServices.Struct new at:
#string put: 'string'; yourself)
with: (WebServices.Struct new at: #int
put: 123; yourself)).
manager useInlineType: false.
xml := manager marshal: assoc atNamespace: 'urn:test:TestChoiceBinding'.
obj := manager
unmarshal: xml printString readStream
atNamespace: 'urn:test:TestChoiceBinding'.
Tamara Kogan
Smalltalk Development
Cincom Systems
> -----Original Message-----
> From: sylvain.pralon [mailto:
[hidden email]]
> Sent: Wednesday, April 19, 2006 12:26 PM
> To: vwnc
> Subject: web services - complexType
>
> Hi,
>
> I have a complex object type to use in a web service. This object is a
> collection of dictionaries.
> the values in these dictionaries could be string, integer or
collection.
> It seems that we can not marshal this kind of object.
> Please help me to use this kind of object without turning them into
simple
> objects like a big string(xml).
>
> thanks
>
> sylvain pralon