SOAP::...ault11(3pm)

✨ NAME ✨

SOAP::WSDL::SOAP::Typelib::Fault11 β€” the SOAP 1.1 Fault class, bestie πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so this class models a SOAP 1.1 Fault. That's it, that's the vibe.

Here's the fun part: SOAP::WSDL::SOAP::Typelib::Fault11 objects are false in boolean context, and they serialize to XML on stringification. So like, they're lying to your if statements AND turning into XML when you look at them weird. Main character behaviour fr fr πŸ‘‘

Which means you can do something like this:

 my $soap = SOAP::WSDL::Client->new();
 # ...
 my $result = $soap->call($method, $data);
 if (not $result) {
     die "Error calling SOAP method: ", $result->get_faultstring();
 }

No cap, that's the whole trick β€” the object being false is what lets if (not $result) catch your errors. Iconic. 🌸


πŸŽ€ METHODS πŸŽ€

πŸ’– get_faultcode / set_faultcode

Getter/setter for the object's faultcode property. That's it. Get it, set it, slay.

πŸ’– get_faultstring / set_faultstring

Getter/setter for the object's faultstring property. The little string that tells you what went wrong 😭

πŸ’– get_faultactor / set_faultactor

Getter/setter for the object's faultactor property.

πŸ’– get_detail / set_detail

Getter/setter for the detail object's detail property.

Heads up bestie, the detail element is a SOAP::WSDL::SOAP::Typelib::Fault11Detail object. This class gets automatically loaded when you use SOAP::WSDL::SOAP::Typelib::Fault11, so you literally can't use it separately. It comes as a package deal, iykyk 🫢

Any string β€” or any object that is not of this class β€” will be automatically wrapped into a detail object. So don't stress, it'll handle itself ✨

⚠️ Also note: passing a list of detail objects is currently not supported (even though the SOAP 1.1 note allows it). Not me being limited by my own implementation πŸ’€

Copyright 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: 851 $
 $LastChangedBy: kutterma $
 $Id: Fault11.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/SOAP/Typelib/Fault11.pm $

And that's the whole page, babe πŸŽ€ β€” this gem came to you via perl v5.36.0, dated 2022-10-14, straight out of the User Contributed Perl Documentation collection. Go forth and catch those faults, periodt πŸ’…βœ¨

πŸ“¦ where this page comes from