|
NAMESOAP::WSDL - SOAP with WSDL supportNOTICEThis module is not recommended for new application development. Please use XML::Compile::SOAP or SOAP::Lite instead if possible.This module has a large number of known bugs and is not being actively developed. This 3.0 release is intended to update the module to pass tests on newer Perls. This is a service to existing applications already dependent on this module. SYNOPSISmy $soap = SOAP::WSDL->new( wsdl => 'file://bla.wsdl', ); my $result = $soap->call('MyMethod', %data); DESCRIPTIONFor creating Perl classes instrumenting a web service with a WSDL definition, read SOAP::WSDL::Manual.For using an interpreting (thus slow and somewhat troublesome) WSDL based SOAP client, which mimics SOAP::Lite's API, read on. Creating Interface classes is the recommended usage. Did I say you should create interface classes following the steps in SOAP::WSDL::Manual? If you're migrating from earlier versions of SOAP::WSDL, you should read the MIGRATING documentation. The stuff below is for users of the 1.2x SOAP::WSDL series. All others, please refer to SOAP::WSDL::Manual SOAP::WSDL provides easy access to Web Services with WSDL descriptions. The WSDL is parsed and stored in memory. Your data is serialized according to the rules in the WSDL. The only transport mechanisms currently supported are http and https. METHODSnewConstructor. All parameters passed are passed to the corresponding methods.callPerforms a SOAP call. The result is either an object tree (with outputtree), a hash reference (with outputhash), plain XML (with outputxml) or a SOAP::SOM object (with neither of the above set).call() can be called in different ways:
wsdlinitReads the WSDL file and initializes SOAP::WSDL for working with it.Is called automatically from call() if not called directly before. servicename portname call You may set servicename and portname by passing them as attributes to wsdlinit: $soap->wsdlinit( servicename => 'MyService', portname => 'MyPort', ); CONFIGURATION METHODSoutputtreeWhen outputtree is set, SOAP::WSDL will return an object tree instead of a SOAP::SOM object.You have to specify a class_resolver for this to work. See class_resolver class_resolverSet the class resolver class (or object).Class resolvers must implement the method get_class which has to return the name of the class name for deserializing a XML node at the current XPath location. Class resolvers are typically generated by using the generate_typemap method of a SOAP::WSDL::Generator subclass. Example: XML structure (SOAP body content): <Person> <Name>Smith</Name> <FirstName>John</FirstName> </Person> Class resolver package MyResolver; my %typemap = ( 'Person' => 'MyPersonClass', 'Person/Name' => 'SOAP::WSDL::XSD::Typelib::Builtin::string', 'Person/FirstName' => 'SOAP::WSDL::XSD::Typelib::Builtin::string', ); sub get_class { return $typemap{ $_[1] } }; 1; You'll need a MyPersonClass module in your search path for this to work - see SOAP::WSDL::XSD::ComplexType on how to build / generate one. servicename$soap->servicename('Name'); Sets the service to operate on. If no service is set via servicename, the first service found is used. Returns the soap object, so you can chain calls like $soap->servicename->('Name')->portname('Port'); portname$soap->portname('Name'); Sets the port to operate on. If no port is set via portname, the first port found is used. Returns the soap object, so you can chain calls like $soap->portname('Port')->call('MyMethod', %data); no_dispatchWhen set, call() returns the plain request XML instead of dispatching the SOAP call to the SOAP service. Handy for testing/debugging.ACCESS TO SOAP::WSDL's internalsget_client / set_clientReturns the SOAP client implementation used (normally a SOAP::WSDL::Client object).EXAMPLESSee the examples/ directory.Differences to previous versions
Differences to previous versionsThe following functionality is no longer supported:Operation overloadingThe SOAP standard allows operation overloading - that is, you may specify SOAP operations with more than one message. The client/server than can choose which message to send. This SOAP feature is usually used similar to the use of methods with different argument lists in C++.Operation overloading is no longer supported. The WS-I Basic profile does not operation overloading. The same functionality as operation overloading can be obtained by using a choice declaration in the XML Schema. readableReadable has no effect any more. If you need readable debug output, copy the SOAP message to your favorite XML editor and run the source format command. Outputting readable XML requires lots of programming for little use: The resulting XMl is still quite unreadable.on_actionSetting on_action is not required any more, the appropriate value is automatically taken from the WSDL. on_action is a no-op, and is just here for compatibility issues.Differences to SOAP::Litereadablereadable is a no-op in SOAP::WSDL. Actually, the XML output from SOAP::Lite is hardly readable, either with readable switched on.If you need readable XML messages, I suggest using your favorite XML editor for displaying and formatting. Message style/encodingWhile SOAP::Lite supports rpc/encoded style/encoding only, SOAP::WSDL currently supports document/literal style/encoding.autotype / type informationSOAP::Lite defaults to transmitting XML type information by default, where SOAP::WSDL defaults to leaving it out.autotype(1) might even be broken in SOAP::WSDL - it's not well-tested, yet. Output formatsIn contrast to SOAP::Lite, SOAP::WSDL supports the following output formats:
outputxmlSOAP::Lite returns only the content of the SOAP body when outputxml is set to true. SOAP::WSDL returns the complete XML response.Auto-DispatchingSOAP::WSDL does does not support auto-dispatching.This is on purpose: You may easily create interface classes by using SOAP::WSDL::Client and implementing something like sub mySoapMethod { my $self = shift; $soap_wsdl_client->call( mySoapMethod, @_); } You may even do this in a class factory - see wsdl2perl.pl for creating such interfaces. Debugging / TracingWhile SOAP::Lite features a global tracing facility, SOAP::WSDL allows one to switch tracing on/of on a per-object base.This has to be done in the SOAP client used by SOAP::WSDL - see get_client for an example and SOAP::WSDL::Client for details. BUGS AND LIMITATIONSThe bug tracker is at <https://rt.cpan.org/Dist/Display.html?Queue=SOAP-WSDL>.This module is in legacy maintenance mode. Only show stopper bugs are being fixed, until/unless someone wishes to resume active development on it. Scott Walters, "scott@slowass.net" has obtained co-mainter from the CPAN admins for the purpose of applying existing fixes people have submit to the RT tracker, and to apply other fixes as needed to get the module to install and run on newer Perls. Non show-stopper bugs reports without fixes will be added to this list of limitations. Of course, fixes for these and other bugs are welcome. Scott does not get email from rt.cpan.org, so please drop an email to him at "scott@slowass.net" if you open a ticket there.
SEE ALSORelated projects
Sources of documentation
ACKNOWLEDGMENTSScott Walters wrote:This code incorporates fixes contributed by "NORDIC@cpan.org", "dam@cpan.org", "sven.schober@uni-ulm.de", myself, and others. Martin Kutter wrote: There are many people out there who fostered SOAP::WSDL's development. I would like to thank them all (and apologize to all those I have forgotten). Giovanni S. Fois wrote a improved version of SOAP::WSDL (which eventually became v1.23) David Bussenschutt, Damian A. Martinez Gelabert, Dennis S. Hennen, Dan Horne, Peter Orvos, Mark Overmeer, Jon Robens, Isidro Vila Verde and Glenn Wood (in alphabetical order) spotted bugs and/or suggested improvements in the 1.2x releases. JT Justman and Noah Robin provided early feedback and bug reports for the 2.xx pre-releases. Adam Kennedy checked and suggested improvements on metadata and dependencies in the 2.xx pre-releases. Andreas 'ac0v' Specht constantly asked for better performance. Matt S. Trout encouraged me "to get a non-dev-release out." CPAN Testers provided most valuable (automated) feedback. Thanks a lot. Numerous people sent me their real-world WSDL files and error reports for testing. Thank you. Noah Robin contributed lots of documentation fixes, and the mod_perl server, and eventually joined SOAP::WSDL's development. Thanks. Mark Overmeer wrote XML::Compile::SOAP - competition is good for business. Paul Kulchenko and Byrne Reese wrote and maintained SOAP::Lite and thus provided a base (and counterpart) for SOAP::WSDL. LICENSE AND COPYRIGHTCopyright 2004-2008 Martin Kutter.This file is part of SOAP-WSDL. You may distribute/modify it under the same terms as perl itself AUTHORScott Walters <scott@slowass.net<gt> 2014Martin Kutter <martin.kutter fen-net.de> 2004-2008 REPOSITORY INFORMATIONhttps://github.com/scrottie/SOAP-WSDL
Visit the GSP FreeBSD Man Page Interface. |