XML::Compile::SOAP11::Encoding(3pm) | User Contributed Perl Documentation | XML::Compile::SOAP11::Encoding(3pm) |
XML::Compile::SOAP11::Encoding - SOAP encoding
### This module may work for you... but may also ### not work. Progress has been made, but the ### implementation is not complete and not well tested. # Add this to load the logic use XML::Compile::SOAP11::Encoding simplify => 1; # The internals are used by the ::SOAP11 module, and # probably should not be called by yourself.
This module loads extra functionality into the XML::Compile::SOAP11 namespace: all kinds of methods which are used to SOAP-encode data.
SOAP defines encodings, especially for SOAP-RPC.
Encoding
The $name is the packed type of the array itself. When undef, the "{soap-enc-ns}Array" will be used (the action soap encoding namespace will be used).
The $item_type specifies the type of each element within the array. This type is used to create the "arrayType" attribute, however doesn't tell enough about the items themselves: they may be extensions to that type.
Each of the $elements (passed as ARRAY) must be an XML::LibXML::Node, either self-constructed, or produced by one of the builder methods in this class, like enc() or typed().
Returned is the XML::LibXML::Element which represents the array.
-Option --Default array_type <generated> id <undef> nested_array '' offset 0 slice <all remaining>
For instance: "nested_array => '[,]'", means that this array contains two-dimensional arrays.
When the $type does not contain a namespace indication, it is taken in the selected schema namespace. If the $value already is a XML::LibXML::Element, then that one is used (and the $name ignored).
example:
my $xml = $soap->enc('int', 43); my $xml = $soap->enc(int => 43); print $xml->toString; # <SOAP-ENC:int>43</SOAP-ENC:int> my $xml = $soap->enc('int', 42, id => 'me'); my $xml = $soap->enc(int => 42, id => 'me'); print $xml->toString; # <SOAP-ENC:int id="me">42</SOAP-ENC:int>
The table of $elements (ARRAY of ARRAYs) must be full: in each of the dimensions, the length of each row must be the same. On the other hand, it may be sparse (contain undefs). The size of each dimension is determined by the length of its first element.
-Option--Default id undef
If a $type is given, then an explicit type parameter is added.
-Option--Default doc <created internally with utf8>
When $value already is an XML::LibXML::Element, then no processing nor value checking will be performed. The $name will be ignored.
If the $type is not qualified, then it is interpreted as basic type, as defined by the selected schema. If you explicitly need a non-namespace typed item, then use an empty namespace. In any case, the type must be defined and the value is validated.
example:
my $xml = $soap->typed(int => count => 5); my $xml = $soap->typed(pack_type(SCHEMA1999, 'int'), count => 5); my $xml = $soap->typed(pack_type('', 'mine'), a => 1); my $xml = $soap->typed('{}mine'), a => 1); #same
Decoding
The decoded data is returned. When "simplify" is set, then the returned data is compact but may be sloppy. Otherwise, a HASH is returned containing as much info as could be extracted from the tree.
This module is part of XML-Compile-SOAP distribution version 3.28, built on August 01, 2022. Website: http://perl.overmeer.net/CPAN/
Copyrights 2007-2022 by [Mark Overmeer <markov@cpan.org>]. For other contributors see ChangeLog.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://dev.perl.org/licenses/
2022-08-04 | perl v5.34.0 |