XML::C...le::XOP(3pm)
β¨ NAME β¨
okay so bestie, this is the manual page for XML::C...le::XOP(3pm) β User Contributed Perl Documentation, no cap. The module itself is XML::Compile::XOP - MTOM and XOP handler. It's literally giving binary transport optimization energy. π
π SYNOPSIS π
# by default, XML::Compile encodes binary data
my $answer = $call->(image => $binary_image);
# to enable use of MTOM
use XML::Compile::XOP;
my $xop = XML::Compile::XOP->new;
my $xop_image = $xop->bytes($binary_image);
my $answer = $call->(image => $xop_image);
# returned XOPs in SOAP
my ($answer, $trace, $xop) = $wsdl->call($operation)->(%data);
print $_->string for @$xop; # See XML::Compile::XOP::Include
π¦ DESCRIPTION π¦
So the SOAP Message Transmission Optimization Mechanism (MTOM) is designed for SOAP1.2, but it's also usable for SOAP1.1. It optimizes the transport of binary information (like images) which are part of the XML message: instead of base64 encoding them and adding 25% to the size of the data, these binaries are added as pure binary attachment to the SOAP message. Iconic, honestly.
In the official specification, the XML message will be created first with the base64 representation of the data in it. Only at transmission, a preprocessor XOP (XML-binary Optimized Packaging) extracts those components to be send separately. In Perl, we have to be more careful about performance. Therefore, the path via encoding to base64 and then decoding it back to binary in the sender (and the reverse process for the receiver) is avoided. The way that saves cycles? Obsessed. π₯
π METHODS π
π Constructors π
$obj->bytes( <STRING|SCALAR>, %options )β Create aXML::Compile::XOP::Includeobject which sources from a STRING (representing bytes) or a SCALAR reference to such a string. With the%options, you can overrule defaults generated for the"Include"object.
example: use of bytes()
my $data = $xop->bytes($string, type => 'text/html');
# $data is a XML::Compile::XOP::Include
$obj->file( <$filename|$fh>, %options )β Create aXML::Compile::XOP::Includeobject which sources from a FILE specified by NAME or HANDLE. With the%options, you can overrule defaults generated for the"Include"object.
example: use of file()
use MIME::Types;
my $mimetypes = MIME::Types->new;
my $type = $mimetypes->mimeTypeOf($fn);
my $data = $xop->file($fn, type => $fn);
# $data is a XML::Compile::XOP::Include
XML::Compile::XOP->new(%options)β constructor vibes, with these options and defaults:
-Option --Default
hostname 'localhost'
xmlmime_version XMIME11
xop_version XOP10
hostname=> STRING β This is used as part of generated Content-IDs, which have the form of a email address.xmlmime_version=> URIxop_version=> URI
π DETAILS π
(this section is empty in the original, bestie β it's giving minimalist)
πΈ SEE ALSO πΈ
- MTOM SOAP1.2: http://www.w3.org/TR/soap12-mtom/
- MTOM SOAP1.1: http://schemas.xmlsoap.org/soap/mtom/SOAP11MTOM10.pdf
- XOP: http://www.w3.org/TR/xop10/
- XMLMIME: http://www.w3.org/TR/xml-media-types
π SEE ALSO π
This module is part of XML-Compile-SOAP distribution version 3.28, built on August 01, 2022. Website: http://perl.overmeer.net/CPAN/ π
π LICENSE π
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/
k bye bestie! this was perl v5.34.0, 2022-08-04, XML::C...le::XOP(3pm). stay slay. π β¨π«Ά
π¦ where this page comes from
- debian bookworm: libxml-compile-soap-perl 3.28+ds-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libxml-compile-soap-perl 3.28+ds-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libxml-compile-soap-perl 3.28+ds-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libxml-compile-soap-perl 3.28+ds-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libxml-compile-soap-perl 3.28+ds-1 Β· 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