From: Byron W. <byr...@sb...> - 2005-06-23 18:07:11
|
> I have a remote SOAP call that returns a moderately complex record. I have > the XSD for it, and it's an array of a complex-type. When I make the SOAP > call, how can I get this array of complex-types in a tcl variable. TclSoap converts the output of a remote call into nested list and key value pairs. So, the output of your faceplates is an array of key-value pairs. set facePlateResponse [remote_faceplate_call $params] foreach item $facePlateResponse { array set facePlate $item puts "Name: $facePlate(name)" puts "Type: $facePlate(type) " # you get the idea } If you are trying to create a service that will return the faceplate xml you specified, you should take a look at my SOAP-wsdl package. It makes creating web services in tclsoap much easier. http://www.geocities.com/blackboy9692002/tclsoap/ -Byron Whitlock ----- Original Message ----- From: "Markus Schmid" <markus.schmid@-nospam-syte.ch> To: <byr...@sb...> Sent: Wednesday, June 22, 2005 11:17 PM Subject: Tcl SOAP > Hello Byron > > I have already tried to contact Pat Thoyts but without success. > > I'm trying to get tclSOAP to work in our product (a proces control system > under Linux), and I'm a bit confused about how it returns values of > complex-types. > > I have a remote SOAP call that returns a moderately complex record. I have > the XSD for it, and it's an array of a complex-type. When I make the SOAP > call, how can I get this array of complex-types in a tcl variable. > > Here's an example, the returned *XML* is e.g.: > > <?xml version="1.0"?> > <faceplateFields> > <item> > <name>HI</name> > <type>Float</type> > <changeable>1</changeable> > <available>1</available> > <value>0.000000</value> > </item> > <item> > <name>LO</name> > <type>Float</type> > <changeable>1</changeable> > <available>1</available> > <value>0.000000</value> > </item> > </faceplateFields> > > Here's a snippet of XSD: > > ... > <xsd:complexType name="FaceplateField"> > <xsd:sequence> > <xsd:element name="name" type="xsd:string" minOccurs="0" \ > maxOccurs="1" nillable="true"/> > <xsd:element name="type" type="xsd:string" minOccurs="0" \ > maxOccurs="1" nillable="true"/> > <xsd:element name="changeable" type="xsd:unsignedByte" \ > minOccurs="1" maxOccurs="1"/> > <xsd:element name="available" type="xsd:unsignedByte" \ > minOccurs="1" maxOccurs="1"/> > <xsd:element name="value" type="xsd:string" minOccurs="0" \ > maxOccurs="1" nillable="true"/> > </xsd:sequence> > </xsd:complexType> > <xsd:complexType name="FaceplateFieldList"> > <xsd:sequence> > <xsd:element name="item" type="FaceplateField" minOccurs="0" \ > maxOccurs="unbounded" nillable="true"/> > </xsd:sequence> > </xsd:complexType> > ... > > Do you have an idea, how to get this result (of a remote call) in a > structured form? Is there a 'castor-like' framework (Java) in tcl? > > Thanks a lot in advance > Markus > -- > Markus Schmid | E-mail ma...@sy... > Syte GmbH - Industrial Software Engineering | Tel. +41 61 717 99 24 > Seewenweg 5 | Fax +41 61 717 99 20 > CH-4153 Reinach - Switzerland | http://www.syte.ch/ > > > -- > No virus found in this incoming message. > Checked by AVG Anti-Virus. > Version: 7.0.323 / Virus Database: 267.7.11/26 - Release Date: 6/22/2005 > > |