SOAP::...ializer(3pm)
π NAME π
SOAP::WSDL::Factory::Deserializer β the factory bestie that hands you Deserializer objects β¨
π¦ SYNOPSIS π¦
okay so here's the whole vibe, copy-paste ready, no cap:
# from SOAP::WSDL::Client:
$deserializer = SOAP::WSDL::Factory::Deserializer->get_deserializer({
soap_version => $soap_version,
class_resolver => $class_resolver,
});
# in deserializer class:
package MyWickedDeserializer;
use SOAP::WSDL::Factory::Deserializer;
# register class as deserializer for SOAP1.2 messages
SOAP::WSDL::Factory::Deserializer->register( '1.2' , __PACKAGE__ );
π DESCRIPTION π
SOAP::WSDL::Factory::Deserializer is literally the factory that goes and fetches deserializer objects for SOAP::WSDL. It's giving matchmaker energy β it doesn't do the work itself, it just finds you the right one π
The actual work? That's done by the specific deserializer classes. They're the main characters, this one's the manager.
SOAP::WSDL::Deserializer tries to load one of these:
- The class registered for the scheme via
register()
And by default? SOAP::WSDL::Deserializer::XSD is registered for SOAP1.1 messages. That's the preset, the default fit, the one that's already in your closet π
β METHODS β
πΈ register πΈ
SOAP::WSDL::Deserializer->register('1.1', 'MyWickedDeserializer');
Globally registers a class for use as deserializer class. Like, for real globally β everybody, everywhere, all at once π
πΈ get_deserializer πΈ
Returns an object of the deserializer class for this endpoint. That's it, that's the whole job π«Ά
π§ WRITING YOUR OWN DESERIALIZER CLASS π§
Deserializer classes may register with SOAP::WSDL::Factory::Deserializer. Yes queen, build your own, I believe in you π
β¨ Registering a deserializer β¨
Registering a deserializer class with SOAP::WSDL::Factory::Deserializer is done by executing the following code where $version is the SOAP version the class should be used for, and $class is the class name.
SOAP::WSDL::Factory::Deserializer->register( $version, $class);
To auto-register your transport class on loading, execute register() in your transport class (peep the SYNOPSIS up above π).
π Deserializer package layout π
Deserializer modules must be named equal to the deserializer class they contain. And listen β there can only be one deserializer class per deserializer module. One. Mono. Solitary. It's giving exclusive π
π Methods to implement π
Deserializer classes must implement the following methods:
newβ Constructor. The birth of the object, the origin story β¨deserializeβ Deserialize data from XML to arbitrary formats.
deserialize() must return a fault indicating that deserializing failed if any error is encountered during the process of deserializing the XML message. So if it goes wrong, say it went wrong β don't ghost the caller π
The following positional parameters are passed to the deserialize method:
$content - the xml message
generate_faultβ Generate a fault in the supported format. The following named parameters are passed as a single hash ref:
code - The fault code, e.g. 'soap:Server' or the like
role - The fault role (actor in SOAP1.1)
message - The fault message (faultstring in SOAP1.1)
π LICENSE AND COPYRIGHT π
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: 176 $
$LastChangedBy: kutterma $
$Id: Serializer.pm 176 2007-08-31 15:28:29Z kutterma $
$HeadURL: https://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Factory/Serializer.pm $
and that's the whole page bestie, you ate it π β¨
perl v5.36.0 Β· 2022-10-14 Β· SOAP::...ializer(3pm) β mwah, go forth and deserialize, ily π«Άπ
π¦ 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