Java Reference
In-Depth Information
<xsd:attribute name
"destPhysAttrName" type
"xsd:string" use
"required"/>
<xsd:attribute name
"category" type
"xsd:string" use
"optional"/>
</xsd:complexType>
This schema is used to generate the following XML string:
<categoryMap category
"1" content
"probability" destPhysAttrName
"Probability"/>'
This explains how we have proceeded to create lines 70 to 75 pre-
paring the argument to be provided to
saveObject
as an XML string.
14.1.3
Retrieving the List of Models
As noted earlier, for the sake of completeness, we use another mecha-
nism to provide an argument to a Web service using NuSoap. To
retrieve the models whose names begin with
Product
, we use PHP
arrays to call the service
listContents
as shown at line 79 below:
79. $params
array('objectFilter'
> array ('type'
> 'model'));
80. $modelList
$kjdmclient->call("listContents", $params, $namespace);
81. $filter
"Product";
NuSOAP uses the WSDL file representing Web services and the
XML documents associated with the service arguments. PHP has a
structure called array that can be used as a hash table, which is simi-
lar to the java.util.Map object in Java, where each field of the array
can be retrieved with its name. NuSOAP creates a PHP array struc-
ture to represent web services request and response messages. The
XML Schemas defined in the Web services are translated by NuSOAP
into recursive arrays representing the XML documents presented in
Chapters 10 and 11.
For example, the Web service
listContents
takes a single argument
of type ObjectFilter. An
ObjectFilter
is defined in XML as a
complex-
Type
with optional attributes
name, type, function, algorithm, creator-
Info, createdBefore, createdAfter, objectIdentifier,
or even
requestedContent
.
This allows the user to specify different filtering criteria to retrieve
objects contained in the MOR. This is seen by a PHP programmer as
arrays of arrays. For example, “array('type'
> 'model')” creates a
PHP array with the value
model
associated with the key
type
, and this,
in turn, is associated with a key called
objectFilter
into a generic array
Search WWH ::
Custom Search