SOAP::...t::Test(3pm)

πŸ’– SOAP::WSDL::Transport::Test β€” the test transport glow-up πŸ’–

okay bestie, so this is a page from the User Contributed Perl Documentation, and the module living here is SOAP::WSDL::Transport::Test β€” aka the Test transport class for SOAP::WSDL. yeah. it's giving "I fake the whole network so you can vibe in peace." 🧚✨


✨ SYNOPSIS ✨

use SOAP::WSDL::Client;
use SOAP::WSDL::Transport::Test;

my $soap = SOAP::WSDL::Client->new()
$soap->get_transport->set_base_dir('.');
$soap->call('method', \%body, \%header);

(no, we are not touching that missing semicolon, it's canon πŸ’… β€” it's literally exactly how it's written up top.)


🌸 DESCRIPTION 🌸

SOAP::WSDL::Transport::Test is a file-based test transport backend for SOAP::WSDL. like, a whole transport that doesn't do transport. iconic behavior honestly.

When you use SOAP::WSDL::Transport::Test as your transport backend, the response gets read from an XML file and the request message is just… discarded. thrown away. not even a little bit sent. πŸ—‘οΈβœ¨

This is particularly useful for testing SOAP::WSDL plugins. so if you're building a plugin and you don't wanna spin up a whole real service just to check your vibes β€” this is the one. periodt.

πŸŽ€ Filename resolution πŸŽ€

SOAP::WSDL::Transport makes up the response XML file name from the SOAPAction of the request. The following filename is used:

base_dir / soap_action .xml

The protocol scheme (like http:) and two heading slashes (//) get stripped from the soap_action. gone. deleted. not invited. πŸ’€

base_dir defaults to '.' β€” like, home is where the dot is, bestie.

Examples, because examples slay:

SOAPAction: http://somewhere.over.the.rainbow/webservice/webservice.asmx
Filename: ./somewhere.over.the.rainbow/webservice/webservice.asmx.xml

SOAPAction: uri:MyWickedService/test
Filename: ./MyWickedService/test.xml

see how the http: and the // just vanish into the void? yep. that's the whole trick. 🌈


🫢 METHODS 🫢

⭐ set_base_dir

Sets the base directory SOAP::WSDL::Transport::Test should look for response files in. that's it, that's the method. simple. elegant. ate. πŸ‘‘


Copyright (c) 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.


πŸ’œ AUTHOR πŸ’œ

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


πŸ¦‹ REPOSITORY INFORMATION πŸ¦‹

$Rev: 218 $
$LastChangedBy: kutterma $
$Id: HTTP.pm 218 2007-09-10 16:19:23Z kutterma $
$HeadURL: https://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Transport/HTTP.pm $

friendly reminder bestie: this is SOAP::...t::Test(3pm) from perl v5.36.0, dated 2022-10-14, and it lives in the User Contributed Perl Documentation. mwah, go forth and test your plugins without ever hitting a real server πŸ’–πŸŽ€βœ¨
πŸ“¦ where this page comes from