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::Hash will die with a SOAP::WSDL::Fault11 object 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. πŸ’–

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