NAME

XML::Compile::WSDL - handle SOAP messages via WSDL

INHERITANCE

XML::Compile::WSDL
  is a XML::Compile

SYNOPSIS

# preparation
my $wsdl    = XML::Compile::WSDL->new($xml);
my $schemas = $wsdl->schemas;
my $op      = $wsdl->operation('GetStockPrice');

DESCRIPTION

### This module is UNDER CONSTRUCTION. It will only evolve with your help. Please contact the author when you have something to contribute. On the moment, the development is primarily targeted to support the CPAN6 development. You can change that with money or time. ###

An WSDL file defines a set of schemas and how to use the defined types using SOAP connections. The parsing is based on the WSDL schema. The WSDL definition can get constructed from multiple XML trees, each added with addWSDL().

WSDL defines object with QNAMES: name-space qualified names. When you specify such a name, you have to explicitly mention the name-space IRI, not the prefix as used in the WSDL file. This is because prefixes may change without notice.

The defined QNAMES are only unique within their CLASS. Defined CLASS types are: service, message, bindings, and portType.

METHODS

Constructors

XML::Compile::WSDL->new(XML, OPTIONS)

    The XML is the WSDL file, which is anything accepted by dataToXML(). All options are also passed to create an internal XML::Compile::Schema object. See XML::Compile::Schema::new()

    Option        --Defined in     --Default
    schema_dirs     XML::Compile     undef
    wsdl_namespace                   undef

    . schema_dirs => DIRECTORY|ARRAY-OF-DIRECTORIES

    . wsdl_namespace => IRI

      Force to accept only WSDL descriptions which are in this namespace. If not specified, the name-space is enforced which is found in the first WSDL document.

Accessors

$obj->addSchemaDirs(DIRECTORIES)

$obj->findSchemaFile(FILENAME)

$obj->knownNamespace(NAMESPACE)

XML::Compile::WSDL->knownNamespace(NAMESPACE)

$obj->schemas

$obj->wsdlNamespace([NAMESPACE])

    Returns (optionally after setting) the namespace used by the WSDL specification. This is the namespace in which the definition document root element is defined.

Read XML

$obj->dataToXML(NODE|REF-XML-STRING|XML-STRING|FILENAME|KNOWN)

Filters

$obj->walkTree(NODE, CODE)

Extension

$obj->addWSDL(XMLDATA)

    Some XMLDATA, accepted by dataToXML() is provided, which should represent the top-level of a (partial) WSDL document. The specification can be spread over multiple files, which each have a definition root element.

$obj->importDefinitions(XMLDATA, OPTIONS)

    Add schema information to the WSDL interface knowledge. This should not be needed, because WSDL definitions must be self-contained.

$obj->namesFor(CLASS)

    Returns the list of names available for a certain definition CLASS in the WSDL.

$obj->operation([NAME], OPTIONS)

    Collect all information for a certain operation. Returned is an XML::Compile::SOAP::Operation object.

    An operation is defined by a service name, a port, some bindings, and an operation name, which can be specified explicitly or sometimes left-out.

    When not specified explicitly via OPTIONS, each of the CLASSes are only permitted to have exactly one definition. Otherwise, you must make a choice explicitly. There is a very good reason to be not too flexible in this area: developers need to be aware when there are choices, where some flexibility is required.

    Option   --Default
    operation  <required>
    port       <required>
    service    <required>

    . operation => NAME

      Optional when the parameter list starts with a NAME (which is an alternative for this option). Also optional when there is only one operation defined within the portType.

    . port => NAME

      Optional when the selected service has only one port.

    . service => QNAME

      Optional when exactly one service is defined.

$obj->prepare([NAME], OPTIONS)

Inspection

All of the following methods are usually NOT meant for end-users. End-users should stick to the operation() and XML::Compile::WSDL subroutine call methods.

$obj->find(CLASS, [QNAME])

    With a QNAME, the HASH which contains the parsed XML information from the WSDL template for that CLASS-NAME combination is returned. When the NAME is not found, an error is produced.

    Without QNAME in SCALAR context, there may only be one such name defined otherwise an error is produced. In LIST context, all definitions in CLASS are returned.

$obj->index([CLASS, [QNAME]])

    With a CLASS and QNAME, it returns one WSDL definition HASH or undef. Returns the index for the CLASS group of names as HASH. When no CLASS is specified, a HASH of HASHes is returned with the CLASSes on the top-level.

DETAILS

DIAGNOSTICS

Error: cannot find pre-installed name-space files

    Use $ENV{SCHEMA_LOCATION} or new(schema_dirs) to express location of installed name-space files, which came with the XML::Compile distribution package.

Error: don't known how to interpret XML data

SEE ALSO

This module is part of XML-Compile distribution version 0.54, built on September 14, 2007. Website: http://perl.overmeer.net/xml-compile/

LICENSE

Copyrights 2006-2007 by Mark Overmeer. For other contributors see ChangeLog.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://www.perl.com/perl/misc/Artistic.html