1SOAP::WSDL::Generator::UPsreerfiCxoRnetsroilbvuetre(d3S)POeArPl::DWoScDuLm:e:nGteanteiroantor::PrefixResolver(3)
2
3
4

NAME

6       SOAP::WSDL::Generator::PrefixResolver - prefixes for different classes
7

SYNOPSIS

9       If you want to create your custom prefix resolver:
10
11        package MyPrefixResolver;
12        use strict; use warnings;
13        use base qw(SOAP::WSDL::Generator::PrefixResolver);
14
15        sub resolve_prefix {
16            my ($self, $type, $namespace, $node) = @_;
17            # return something special
18            return $self->SUPER::resolve_prefix($type, $namespace, $node);
19        }
20
21       When generating code:
22
23        use MyPrefixResolver;
24        use SOAP::WSDL::Generator::XSD;
25        my $generator = SOAP::WSDL::Generator::Template::XSD->new({
26           prefix_resolver_class => 'MyPrefixResolver',
27        });
28

DESCRIPTION

30       Prefix resolver class for SOAP::WSDL's code generator. You may subclass
31       it to apply some custom prefix resolving logic.
32
33       Subclasses must implement the following methods:
34
35       ยท   resolve_prefix
36
37            sub resolve_prefix {
38               my ($self, $namespace, $node) = @_;
39               # ...
40            }
41
42           resolve_prefix is expected to return a (perl class) prefix. It is
43           called with the following parameters:
44
45            NAME       DESCRIPTION
46            -----------------------------------------------------------------------------
47            type       One of (server|interface|typemap|type|element|attribute)
48            namespace  The targetNamespace of the node to generate a prefix for.
49            node       The node to generate a prefix for
50
51           You usually just need type and namespace for prefix resolving. node
52           is provided for rather funky setups, where you have to choose
53           different prefixes based on type names or whatever.
54
55           Node may be of any of the following classes:
56
57            SOAP::WSDL::Service
58            SOAP::WSDL::XSD::Attribute
59            SOAP::WSDL::XSD::Element
60            SOAP::WSDL::XSD::Type
61
62           Note that both namespace and node may be undef - you should test
63           for definedness before doing anything fancy with them.
64
65           If you want your prefixes to represent perl class hierarchies, they
66           should end with '::'.
67
68           Example:
69
70           Imagine you're generating interfaces for the Acme Pet Shop. Acme
71           Corp. has set up their datatypes to be global across all interfaces
72           (and products), while elements are local to the product (the Pet
73           Shop in the example).  All elements are in the urn:Acme namespace.
74
75           In addition, there are types in the namespace urn:Acme:Goods, which
76           should go into the same namespace as types, but be prefixed with
77           'Goods_'
78
79           You may want prefixes (roughly) like this:
80
81            Interfaces:        Acme::Client::PetShop::
82            Server:            Acme::Server::PetShop::
83            Types:             Acme::Types::
84            Types (Goods):     Acme::Types::Goods_
85            Elements:          Acme::Elements::PetShop::
86            Typemaps:          Acme::Typemaps::PetShop::
87

BUGS AND LIMITATIONS

89       You cannot suffix your types by some rule yet...
90
92       Copyright 2008 Martin Kutter.
93
94       This file is part of SOAP-WSDL. You may distribute/modify it under the
95       same terms as perl itself
96

AUTHOR

98       Martin Kutter <martin.kutter fen-net.de>
99

REPOSITORY INFORMATION

101        $Rev: 583 $
102        $LastChangedBy: kutterma $
103        $Id: $
104        $HeadURL: $
105
106
107
108perl v5.30.1                      2020-S0O1A-P3:0:WSDL::Generator::PrefixResolver(3)
Impressum