.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "SOAP::WSDL::Generator::PrefixResolver 3pm" .TH SOAP::WSDL::Generator::PrefixResolver 3pm "2022-10-14" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" SOAP::WSDL::Generator::PrefixResolver \- prefixes for different classes .SH "SYNOPSIS" .IX Header "SYNOPSIS" If you want to create your custom prefix resolver: .PP .Vb 3 \& 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); \& } .Ve .PP When generating code: .PP .Vb 5 \& use MyPrefixResolver; \& use SOAP::WSDL::Generator::XSD; \& my $generator = SOAP::WSDL::Generator::Template::XSD\->new({ \& prefix_resolver_class => \*(AqMyPrefixResolver\*(Aq, \& }); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Prefix resolver class for \s-1SOAP::WSDL\s0's code generator. You may subclass it to apply some custom prefix resolving logic. .PP Subclasses must implement the following methods: .IP "\(bu" 4 resolve_prefix .Sp .Vb 4 \& sub resolve_prefix { \& my ($self, $namespace, $node) = @_; \& # ... \& } .Ve .Sp resolve_prefix is expected to return a (perl class) prefix. It is called with the following parameters: .Sp .Vb 5 \& NAME DESCRIPTION \& \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \& type One of (server|interface|typemap|type|element|attribute) \& namespace The targetNamespace of the node to generate a prefix for. \& node The node to generate a prefix for .Ve .Sp You usually just need type and namespace for prefix resolving. node is provided for rather funky setups, where you have to choose different prefixes based on type names or whatever. .Sp Node may be of any of the following classes: .Sp .Vb 4 \& SOAP::WSDL::Service \& SOAP::WSDL::XSD::Attribute \& SOAP::WSDL::XSD::Element \& SOAP::WSDL::XSD::Type .Ve .Sp Note that both namespace and node may be undef \- you should test for definedness before doing anything fancy with them. .Sp If you want your prefixes to represent perl class hierarchies, they should end with '::'. .Sp Example: .Sp 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. .Sp 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_' .Sp You may want prefixes (roughly) like this: .Sp .Vb 6 \& Interfaces: Acme::Client::PetShop:: \& Server: Acme::Server::PetShop:: \& Types: Acme::Types:: \& Types (Goods): Acme::Types::Goods_ \& Elements: Acme::Elements::PetShop:: \& Typemaps: Acme::Typemaps::PetShop:: .Ve .SH "BUGS AND LIMITATIONS" .IX Header "BUGS AND LIMITATIONS" You cannot suffix your types by some rule yet... .SH "LICENSE AND COPYRIGHT" .IX Header "LICENSE AND COPYRIGHT" Copyright 2008 Martin Kutter. .PP This file is part of SOAP-WSDL. You may distribute/modify it under the same terms as perl itself .SH "AUTHOR" .IX Header "AUTHOR" Martin Kutter .SH "REPOSITORY INFORMATION" .IX Header "REPOSITORY INFORMATION" .Vb 4 \& $Rev: 583 $ \& $LastChangedBy: kutterma $ \& $Id: $ \& $HeadURL: $ .Ve