This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
340
|
Appendix B: SOAP::Lite Programming Reference
invalid Content-Type headers. While the “right” thing to do would be to reject
such messages, that isn’t always an option. Setting this parameter to
1 allows the
toolkit to skip the content-type test.
SOAP::Schema
This class provides an umbrella for the way in which SOAP::Lite manages service
description schemas. Currently, the only support present is for the Web Services
Description Language (WSDL) (see the next section). This is another of the classes
not generally designed to be directly instantiated by an application, though it can be
if so desired.
new(optional key/value pairs) $schema = SOAP::Schema->new(parse => $schema_uri);
This is the class constructor. With no arguments, it creates a blank object of the
class. Any arguments that are passed are treated as key/value pairs in which the
key represents one of the methods described here, and the value is what gets
passed when the method itself gets invoked.
parse(service description URI) $schema->parse('http://schemas.w3.org/soap.wsdl');
Parses the internal representation of the service description prior to the genera-
tion of stub routines to provide method-like access to the remote services.
access(service description URI) $schema->access('http://soap.org/service.wsdl');
Loads the specified service description from the given URL, using the current
value of the
schema accessor if none is provided. The full content of the URL is
returned on success, or an exception is thrown (via
die) on error.
load $schema->load;
Takes the internal representation of the service and generates code stubs for the
remote methods, allowing them to be called as local object methods. Stubs are
generated for all the functions declared in the WSDL description with this call
because it’s enough of a class framework to allow for basic object creation for
use as handles.
schema $current_schema = $schema->schema;
Gets (or sets) the current schema representation to be used by this object. The
value to be passed when setting this is just the URI of the schema. This gets
passed to other methods such as
access for loading the actual content.
services $hashref = $schema->services;
Gets or sets the services currently stored on the object. The services are kept as a
hash reference, whose keys and values are the list of returned values from the
WSDL parser. Keys represent the names of the services themselves (names have
been normalized into Perl-compatible identifiers), with values that are also hash
references to the internal representation of the service itself.

Get Programming Web Services with Perl now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.