W3C::SOAP - Static and dynamic SOAP client generator from WSDL & XSD files


This documentation refers to W3C::SOAP version 0.14.


   # Dynamically created clients
   use W3C::SOAP qw/load_wsdl/;

   # load some wsdl file
   my $wsdl = load_wsdl("");

   # call a method exported by the WSDL
   $wsdl->some_method( HASH | HASH_REF );

   # A real world example
   my $wsdl = load_wsdl('');
   my $res = $wsdl->resolve_ip( ip_address => '', license_key => 0 );
   printf "lat: %.4f\n", $res->resolve_ipresult->latitude;

   # load some xsd file
   my $xsd = load_xsd("");

   # create a new object of of the XSD
   my $obj = $xsd->new( HASH | HASH_REF );

   # Statically created clients
   # on the command line build Client module (and included XSD modules)
   # see wsdl-parser --help for more details
   $ wsdl-parser -b ResolveIP ResolveIP ''

   # back in perl

   # the default directory modules are created into
   use lib 'lib';
   # load the ResolveIP client module
   use ResolveIP;
   # Create a client object
   my $client = ResolveIP->new();
   # call the WS
   my $res = $client->resolve_ip( ip_address => '', license_key => 0 );
   # show the results
   printf "lat: %.4f\n", $res->resolve_ipresult->latitude;


A perly SOAP client library. To see more details on how to generate a WSDL client see W3C::SOAP::WSDL::Parser, and for generating Moose objects from XSD files see W3C::SOAP::XSD::Parser.


Java style camel case names are converted to the more legible Perl style underscore separated names for everything that doesn't end up being a Perl package or Moose type. Eg in the Synopsis the operation defined in the IP 2 GEO WSDL is defined as ResolveIP this is translated to the perly name resolve_ip.


When something goes wrong there are two ways to see what XML is being sent and received.

  1. The $W3C_SOAP_DEBUG_CLIENT environment variable will cause the all request and response HTTP bodies to be dumped to STDOUT. The length of the content is limited to 1024 by default but this can be changed with the $W3C_SOAP_DEBUG_LENGTH environment variable.

  2. Supplying a log object. When a client is instantiated you can supply it a log object or after creation supply the log method with a log object, the only restriction is that it implements debug, info, warn, error and fatal methods. Log::Log4perl and Catalyst::Log are known working examples.

        my $client = ResolveIP->new(log => $log);

Both methods can be used together.


load_wsdl ($wsdl_location)

Loads a WSDL file, parses is and generates dynamic Moose objects that represent the WSDL file and any XML Schema xsd content that it refers to.

See W3C::SOAP::WSDL::Parser for more details.

load_xsd ($xsd_location)

Loads an XML Schema (.xsd) file, parses is and generates dynamic Moose objects that representing that schema and any other included/imported XML Schema content that it refers to.

See W3C::SOAP::XSD::Parser for more details.




If this environment variable is a true value it will turn on printing request and response HTTP messages bodies to STDOUT.


Alter the amount of data shown by $W3C_SOAP_DEBUG_CLIENT which defaults to 1024.



Perl 5.18 see below.


Currently the WSDL handling doesn't deal with more than one input or output on an operation or inputs/outputs that aren't specified by an XMLSchema. A;so operation fault objects aren't yet handled.

Currently there is an issue with Perl 5.18 (probably caused by Moose affecting XML::LibXML usage)

Please report problems to Ivan Wills (

Patches are welcome.


wsdl-parser, W3C::SOAP::Client, XML::LibXML, Moose, MooseX::Types::XMLSchema

Inspired by SOAP::WSDL & SOAP::Lite


Ivan Wills - (


Copyright (c) 2012 Ivan Wills (14 Mullion Close, Hornsby Heights, NSW 2077 Australia). All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.