SOAP::...nsport(3pm)
π SOAP::WSDL::Factory::Transport π
Hiii bestie, welcome to the manual page for SOAP::WSDL::Factory::Transport β it ships with User Contributed Perl Documentation and it's literally the factory that hands you transport objects. Let's get into it, no cap. β¨
πΈ NAME
SOAP::WSDL::Factory::Transport β the Factory for retrieving transport objects. That's the whole job. She's a factory. She makes transports. Periodt. π
β¨ SYNOPSIS
Here's the vibe in code, verbatim, don't touch anything:
# from SOAP::WSDL::Client:
$transport = SOAP::WSDL::Factory::Transport->get_transport( $url, @opt );
# in transport class:
package MyWickedTransport;
use SOAP::WSDL::Factory::Transport;
# register class as transport module for httpr and https
# (httpr is "reliable http", a protocol developed by IBM).
SOAP::WSDL::Factory::Transport->register( 'httpr' , __PACKAGE__ );
SOAP::WSDL::Factory::Transport->register( 'https' , __PACKAGE__ );
Yes, httpr is real β it's "reliable http", a protocol IBM came up with. Not me making things up. π
π¦ DESCRIPTION
So SOAP::WSDL::Transport is the factory that fetches transport objects for SOAP::WSDL. That's her whole personality.
The actual work? Done by the specific transport classes. She's just the matchmaker, the classes do the dating. π
Here's the tea on how SOAP::WSDL::Transport picks a class to load β she tries these in order:
- the class you registered for the scheme via
register()π - the SOAP::Lite class that matches the scheme
- the SOAP::WSDL class that matches the scheme
π METHODS
π register
SOAP::WSDL::Transport->register('https', 'MyWickedTransport');
Globally registers a class so it can be used as a transport class. Global. Everyone sees it. She said "I'm taken". π
π proxy
$trans->proxy('http://soap-wsdl.sourceforge.net');
Sets the proxy β aka the endpoint.
And it returns the transport for this protocol. Giving both, because she can. π«Ά
π§ set_transport
Sets the current transport object.
β get_transport
Gets the current transport object.
π WRITING YOUR OWN TRANSPORT CLASS
π Registering a transport class
Transport classes must be registered with SOAP::WSDL::Factory::Transport. Non-negotiable, bestie.
You do it by running this code, where $scheme is the URL scheme the class should be used for, and $module is the class' module name:
SOAP::WSDL::Factory::Transport->register( $scheme, $module);
Wanna auto-register your transport class the moment it loads? Just run register() inside your transport class β see the SYNOPSIS above, it's all there. β¨
And yeah, you can register multiple protocols or multiple classes β just call register() multiple times. Stack 'em. π₯
π Transport plugin package layout
Lowkey important: you may only use transport classes whose name is either the module name, or the module name with ::Client appended. That's the rule, iykyk.
πΈ Methods to implement
Transport classes must implement the interface that SOAP::Lite transport classes require β check SOAP::Lite::Transport for the details, and SOAP::WSDL::Transport::HTTP for a real example. π
To provide that interface, transport modules must implement these methods:
newsend_receiveβ dispatches a request and returns the content of the response.codeβ returns the status code of the lastsend_receivecall (if any).messageβ returns the status message of the lastsend_receivecall (if any).statusβ returns the status of the lastsend_receivecall (if any).is_successβ returns true after asend_receivewas successful, false if it was not.
Now here's the SOAP::Lite lore: SOAP::Lite requires transport modules to pack client and server classes in one file, and to follow this naming scheme:
Module name:
"SOAP::Transport::" . uc($scheme)
Client class (additional package in module):
"SOAP::Transport::" . uc($scheme) . "::Client"
Server class (additional package in module):
"SOAP::Transport::" . uc($scheme) . "::Client"
SOAP::WSDL does not require you to follow these restrictions. Freedom, bestie. ποΈ
There is only one restriction in SOAP::WSDL:
You may only use transport classes whose name is either the module name or the module name with ::Client appended. (Yes, she repeats herself β she really means it.)
SOAP::WSDL will try to instantiate an object of your transport class with ::Client appended, so that you can use transport classes written for SOAP::Lite. Iconic of her, honestly.
β οΈ Heads up though: this may lead to errors when a different module with the name of your transport module suffixed with ::Client is also loaded. Be careful out there. π
π LICENSE AND COPYRIGHT
Copyright 2004-2007 Martin Kutter. All rights reserved.
This file is part of SOAP-WSDL. You may distribute/modify it under the same terms as perl itself. Slay, and legally so. π
π«Ά AUTHOR
Martin Kutter <martin.kutter fen-net.de> β the main character who wrote all of this. Respect. π
π REPOSITORY INFORMATION
$Rev: 851 $
$LastChangedBy: kutterma $
$Id: Transport.pm 851 2009-05-15 22:45:18Z kutterma $
$HeadURL: https://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Factory/Transport.pm $
And that's the whole page, bestie!! This one was generated for perl v5.36.0, dated 2022-10-14 β so if you're reading it, that's the era you're in. Go register some transports and be amazing. π¦β¨π mwah.
π¦ where this page comes from
- ubuntu noble: libsoap-wsdl-perl 3.004-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libsoap-wsdl-perl 3.004-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libsoap-wsdl-perl 3.004-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms