Book HomeJava and XSLTSearch this book

14.3. SOAP::Data

The SOAP::Data class allows you specify a value, name, type, URI, or other attributes for SOAP elements. For example, you can serialize the name/value pair of "Nate/31" with the following code:

SOAP::Data->name('Nate')->value(31);

This becomes <Nate>31</Nate>.

You can also import SOAP::Data methods with import( ). To import 'name':

SOAP::Data->import('name');

Once imported, 'name' can be used as follows:

name(Nate => 31);

SOAP::Data also provides an interface to get or set specific attributes, including actor( ), mustUnderstand( ), encodingStyle( ), and root( ). For example:

SOAP::Data
    ->name(Nate => 31)
    ->encodingStyle('http://www.some.site/soap/showmetheliteral');

This is serialized as follows:

<Nate SOAP-ENV:encodingStyle="http://www.some.site/soap/showmetheliteral"
   xsi:type="xsd:int">31</Nate>


Library Navigation Links

Copyright © 2002 O'Reilly & Associates. All rights reserved.