SOAP::...::Hash(3pm)
π SOAP::...::Hash β like, the manual page, bestie π
okay so. welcome to SOAP::...::Hash(3pm), which is one of those user-contributed Perl documentation situations, and honestly? it's giving "unsung hero of the toolchain" and I'm obsessed. grab a boba, we're decoding SOAP messages into perl hash refs together π§β¨
π NAME π
SOAP::WSDL::Deserializer::Hash β a Deserializer that turns SOAP messages into perl hash refs. yes. that's the whole job. and it ate. π
β¨ SYNOPSIS β¨
use SOAP::WSDL;
use SOAP::WSDL::Deserializer::Hash;
two lines. that's it. main character energy fr fr π«Ά
π¦ DESCRIPTION π¦
It's a Deserializer for making perl hash refs as the result of a SOAP call. that's the vibe. no cap. πΈ
π Output structure
So the XML structure gets converted into a perl data structure made of hash and/or list references. List references are the ones holding your array data. π
And here's the little detail that matters, bestie: SOAP::WSDL::Deserializer::Hash creates list references always at the maximum depth possible. like, it goes all the way down. iconic behavior honestly. π
Examples, because visual learner gang rise up:
XML:
<MyDataArray>
<MyData>1</MyData>
<MyData>1</MyData>
</MyDataArray>
Perl:
{
MyDataArray => {
MyData => [ 1, 1 ]
}
}
and a deeper one:
XML:
<DeepArray>
<MyData><int>1<int>/MyData>
<MyData><int>1<int>/MyData>
</DeepArray>
Perl:
{
MyDataArray => {
MyData => [
{ int => 1 },
{ int => 1 }
]
}
}
Now the important mechanic: list reference creation is triggered by the second occurrence of an element. so XML Array types with only one element will not be represented as list references. one element = no list. it's giving "solo trip, no plus one" π
π USAGE π
All you need to do is to use SOAP::WSDL::Deserializer::Hash. literally that's it, bestie.
SOAP::WSDL::Deserializer::Hash autoregisters itself for SOAP1.1 messages π
And you may register SOAP::WSDLDeserializer::Hash for other SOAP Versions by calling:
SOAP::Factory::Deserializer->register('1.2',
SOAP::WSDL::Deserializer::Hash)
π Limitations
- Namespaces β all namespaces are ignored. don't even worry about them, they're not being tracked π
- XML attributes β all XML attributes are ignored. same deal, they simply do not exist to this module π
π Differences from other SOAP::WSDL::Deserializer classes
generate_faultβSOAP::WSDL::Deserializer::Hashwill die with aSOAP::WSDL::Fault11object when a parse error appears. like, full dramatic exit. it does not play about parse errors. π
β METHODS β
π₯ deserialize
Deserializes the message. short king of a method description, but it does exactly what it says π«Ά
πΈ generate_fault
Generates a SOAP::WSDL::SOAP::Typelib::Fault11 object and returns it. yes bestie, it hands you a whole object. very generous of it. π
π LICENSE AND COPYRIGHT π
Copyright 2004-2008 Martin Kutter.
This file is part of SOAP-WSDL. You may distribute/modify it under the same terms as perl itself. (perl terms, we respect them, periodt β¨)
π AUTHOR π
Martin Kutter <martin.kutter fen-net.de>
π REPOSITORY INFORMATION π
$Rev: 851 $
$LastChangedBy: kutterma $
$Id: Hash.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/Deserializer/Hash.pm $
and that's the whole page, bestie!! π¦ this one's running on perl v5.36.0, dated 2022-10-14, and it's filed under SOAP::...::Hash(3pm) β go forth and deserialize, you've got this, 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