SOAP::WSDL::Manual - Accessing WSDL based web services


Back to Top


NAME

SOAP::WSDL::Manual - Accessing WSDL based web services

Back to Top


Accessing a WSDL-based web service

Quick walk-through for the unpatient

Instrumenting web services with interface classes

SOAP::WSDL (starting from 2.00) instruments WSDL based web services with interface classes. This means that SOAP::WSDL features a code generator which creates one class for every web service you want to access.

Moreover, the data types from the WSDL definitions are also wrapped into classes and returned to the user as objects.

To find out which class a particular XML node should be, SOAP::WSDL uses typemaps. For every Web service, there's also a typemap created.

Interface class creation

To create interface classes, follow the steps above from Quick walk-through for the unpatient.

If this works fine for you, skip the next paragraphs. If not, read on.

The steps to instrument a web service with SOAP::WSDL perl bindings (in detail) are as follows:

Adding missing information

Sometimes, WSDL definitions are incomplete. In most of these cases, proper fault definitions are missing. This means that though the specification sais nothing about it, Fault messages include extra elements in the <detail> section, or errors are even indicated by non-fault messages.

There are two steps you need to perform for adding additional information.

Back to Top


Accessing a web service without a WSDL definition

Accessing a web service without a WSDL definition is more cumbersome. There are two ways to go:

Back to Top


Troubleshooting

Accessing HTTPS webservices

You need Crypt::SSLeay installed to access HTTPS webservices.

Accessing protected web services

Passing a userndame and password, or a client certificate and key, to the transport layer is highly dependent on the transport backend.

Accessing HTTP(S) webservices with basic/digest authentication

When using SOAP::WSDL::Transport::HTTP (SOAP::Lite not installed), add a method called "get_basic_credentials" to SOAP::WSDL::Transport::HTTP:

 *SOAP::WSDL::Transport::HTTP::get_basic_credentials = sub {
        return ($user, $password);
 };

When using SOAP::Transport::HTTP (SOAP::Lite is installed), do the same to this backend:

 *SOAP::Transport::HTTP::get_basic_credentials = sub {
        return ($user, $password);
 };

Accessing HTTP(S) webservices protected by NTLM authentication

Besides passing user credentials as when accessing a web service protected by basic or digest authentication, you also need to enforce connection keep_alive on the transport backens.

To do so, pass a proxy argument to the new() method of the generated class. This unfortunately means that you have to set the endpoint URL, too:

 my $interface = MyInterfaces::SERVICE_NAME::PORT_NAME->new({
     proxy => [ $url, keep_alive => 1 ]
 });

You may, of course, decide to just hack the generated class. Be advised that subclassing might be a more appropriate solution - re-generating overwrites changes in interface classes.

Accessing HTTPS webservices protected by certificate authentication

You need Crypt::SSLeay installed to access HTTPS webservices.

See the Crypt::SSLeay manpage on how to configure client certificate authentication.

Back to Top


SEE ALSO

the SOAP::WSDL::Manual::Glossary manpage The meaning of all these words

the SOAP::WSDL::Client manpage Basic client for SOAP::WSDL based interfaces

the SOAP::WSDL manpage an interpreting WSDL based SOAP client

Back to Top


LICENSE

Copyright 2007 Martin Kutter.

This file is part of SOAP-WSDL. You may distribute/modify it under the same terms as perl itself

Back to Top


AUTHOR

Martin Kutter <martin.kutter fen-net.de>

Back to Top

 SOAP::WSDL::Manual - Accessing WSDL based web services