SOAP::...esolver(3pm)
π SOAP::WSDL::Generator::PrefixResolver π
okay bestie, welcome to SOAP::...esolver β the perl-manpage vibe check you didn't know you needed. It's the User Contributed Perl Documentation entry for the class that hands out prefixes for different classes. sit down, grab a boba, let's get into it π§β¨
β¨ NAME β¨
SOAP::WSDL::Generator::PrefixResolver β prefixes for different classes. that's the whole name, she's serving exactly what it says on the tin π
πΈ SYNOPSIS πΈ
so if you wanna make your own custom prefix resolver, like a lil bespoke one, you go:
package MyPrefixResolver;
use strict; use warnings;
use base qw(SOAP::WSDL::Generator::PrefixResolver);
sub resolve_prefix {
my ($self, $type, $namespace, $node) = @_;
# return something special
return $self->SUPER::resolve_prefix($type, $namespace, $node);
}
and then when you're actually generating code, it's giving:
use MyPrefixResolver;
use SOAP::WSDL::Generator::XSD;
my $generator = SOAP::WSDL::Generator::Template::XSD->new({
prefix_resolver_class => 'MyPrefixResolver',
});
see how the prefix_resolver_class is set to 'MyPrefixResolver'? that's you plugging your own girlboss logic into the machine. iconic β¨
π¦ DESCRIPTION π¦
This is the prefix resolver class for SOAP::WSDL's code generator. You're absolutely allowed to subclass it so you can apply your own custom prefix resolving logic. do your thing, main character π«Ά
Subclasses must implement the following methods (no skipping, bestie):
resolve_prefix
sub resolve_prefix {
my ($self, $namespace, $node) = @_;
# ...
}
resolve_prefix is expected to return a (perl class) prefix. It gets called with the following parameters:
typeβ one of(server|interface|typemap|type|element|attribute)namespaceβ thetargetNamespaceof the node to generate a prefix for.nodeβ the node to generate a prefix for
lowkey, you usually just need type and namespace for prefix resolving. node is there for those rather funky setups where you have to pick different prefixes based on type names or whatever. nb, not judging, funky setups are valid π
node may be of any of the following classes:
SOAP::WSDL::ServiceSOAP::WSDL::XSD::AttributeSOAP::WSDL::XSD::ElementSOAP::WSDL::XSD::Type
β οΈ heads up bestie: bothnamespaceandnodemay beundefβ so please test for definedness before you do anything fancy with them. undefined behavior is not the vibe. π
If you want your prefixes to represent perl class hierarchies, they should end with '::'. periodt.
Example: β¨
Imagine you're generating interfaces for the Acme Pet Shop. Acme Corp. has set up their datatypes to be global across all interfaces (and products), while elements are local to the product (the Pet Shop in the example). All elements are in the urn:Acme namespace.
In addition, there are types in the namespace urn:Acme:Goods, which should go into the same namespace as types, but be prefixed with 'Goods_'.
You may want prefixes (roughly) like this:
Interfaces: Acme::Client::PetShop::
Server: Acme::Server::PetShop::
Types: Acme::Types::
Types (Goods): Acme::Types::Goods_
Elements: Acme::Elements::PetShop::
Typemaps: Acme::Typemaps::PetShop::
slay. that's the whole dream π
π BUGS AND LIMITATIONS π
You cannot suffix your types by some rule yet... π that's it, that's the limitation. we're waiting on it fr fr.
π LICENSE AND COPYRIGHT π
Copyright 2008 Martin Kutter.
This file is part of SOAP-WSDL. You may distribute/modify it under the same terms as perl itself. (perl itself said it's fine, so it's fine π«Ά)
π AUTHOR π
Martin Kutter <martin.kutter fen-net.de> β shoutout to the author, king behavior fr π«‘
π REPOSITORY INFORMATION π
$Rev: 583 $
$LastChangedBy: kutterma $
$Id: $
$HeadURL: $
and that's the whole page, bestie π this was perl v5.36.0, dated 2022-10-14, and it's the SOAP::...esolver page from the User Contributed Perl Documentation collection. go forth and resolve those prefixes β no cap, you're gonna ate this up ππ
π¦ 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