1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247
|
=encoding utf8
=head1 NAME
XML::Compile::SOAP::Operation - base-class for possible interactions
=head1 INHERITANCE
XML::Compile::SOAP::Operation is extended by
XML::Compile::SOAP11::Operation
XML::Compile::SOAP12::Operation
=head1 SYNOPSIS
# created by XML::Compile::WSDL11
my $op = $wsdl->operation('GetStockPrices');
=head1 DESCRIPTION
These objects are created by L<XML::Compile::WSDL11|XML::Compile::WSDL11>, grouping information
about a certain specific message interchange between a client and
a server.
=head1 METHODS
=head2 Constructors
=over 4
=item XML::Compile::SOAP::Operation-E<gt>B<new>(%options)
-Option --Default
action undef
endpoints []
kind <required>
name <required>
schemas <required>
server_type undef
transport 'HTTP'
=over 2
=item action => STRING
Some string which is referring to the action which is taken. For SOAP
protocols, this defines the soapAction header.
=item endpoints => ADDRESS|ARRAY
Where to contact the server.
=item kind => 'one-way'|...
This returns the type of operation this is. There are four kinds, which
are returned as strings C<one-way>, C<request-response>, C<sollicit-response>,
and C<notification>. The latter two are initiated by a server, the former
two by a client.
=item name => STRING
=item schemas => XML::Compile::Cache
=item server_type => NAME
Most server implementations show some problems. Also, servers may produce
responses using their own namespaces (like for error codes). When you know
which server you are talking to, the quirks of the specific server type can
be loaded. Read more in the L<XML::Compile::SOAP/"Supported servers">.
=item transport => URI|'HTTP'
C<HTTP> is short for C<http://schemas.xmlsoap.org/soap/http/>, which
is a constant to indicate that transport should use the HyperText
Transfer Protocol.
=back
=back
=head2 Accessors
=over 4
=item $obj-E<gt>B<bindingName>()
=item $obj-E<gt>B<clientClass>()
Returns the class name which implements the Client side for this protocol.
=item $obj-E<gt>B<endPoints>()
Returns the list of alternative URLs for the end-point, which should
be defined within the service's port declaration.
=item $obj-E<gt>B<kind>()
=item $obj-E<gt>B<longName>()
[3.06] prefix the service name before the operation name, to make it
really unique. A C<#> is used as separator.
=item $obj-E<gt>B<name>()
=item $obj-E<gt>B<portName>()
=item $obj-E<gt>B<schemas>()
=item $obj-E<gt>B<serverClass>()
Returns the class name which implements the Server side for this protocol.
=item $obj-E<gt>B<serviceName>()
=item $obj-E<gt>B<soapAction>()
Used for the C<soapAction> header in HTTP transport, for routing
messages through firewalls.
=item $obj-E<gt>B<version>()
=item $obj-E<gt>B<wsaAction>('INPUT'|'OUTPUT')
Only available when C<XML::Compile::SOAP::WSA> is loaded. It specifies
the name of the operation in the WSA header. With C<INPUT>, it is the
Action to be used with a message sent to the server (input to the
server). The C<OUTPUT> is used by the server in its message back.
=back
=head2 Handlers
=over 4
=item $obj-E<gt>B<compileClient>(%options)
Returns one CODE reference which handles the conversion from a perl
data-structure into a request message, the transmission of the
request, the receipt of the answer, and the decoding of that answer
into a Perl data-structure.
=item $obj-E<gt>B<compileHandler>(%options)
Returns a code reference which translates in incoming XML message
into Perl a data-structure, then calls the callback. The result of
the callback is encoded from Perl into XML and returned.
-Option --Default
callback <required>
=over 2
=item callback => CODE
=back
=item $obj-E<gt>B<compileTransporter>(%options)
Create the transporter code for a certain specific target.
-Option --Default
endpoint <from WSDL>
server undef
transport_hook undef
transporter <created>
=over 2
=item endpoint => URI|ARRAY-of-URI
Overrule the destination address(es).
=item server => URI-HOST
Overrule only the server part in the endpoint, not the whole endpoint.
This could be a string like C<username:password@myhost:4711>. Only
used when no explicit C<endpoint> is provided.
=item transport_hook => CODE
Passed to L<XML::Compile::Transport::compileClient(hook)|XML::Compile::Transport/"Handlers">. Can be
used to create off-line tests and last resort work-arounds. See the
DETAILs chapter in the L<XML::Compile::Transport|XML::Compile::Transport> manual page.
=item transporter => CODE|XML::Compile::Transport-object
The routine which will be used to exchange the data with the server.
This code is created by an L<XML::Compile::Transport::compileClient()|XML::Compile::Transport/"Handlers">
extension.
By default, a transporter compatible to the protocol is created. However,
in most cases you want to reuse one (HTTP1.1) connection to a server.
[3.14] You may provide a L<XML::Compile::Transport|XML::Compile::Transport> object as well. Its
compileClient() will be called for you.
=back
=back
=head2 Helpers
=over 4
=item $obj-E<gt>B<explain>($wsdl, $format, $direction, %options)
Dump an annotated structure showing how the operation works, helping
developers to understand the schema. $format is C<PERL> or C<XML>.
The $direction is C<INPUT>, it will return the message which the client
sends to the server (input for the server). The C<OUTPUT> message is
sent as response by the server.
=item $obj-E<gt>B<parsedWSDL>(%options)
[2.29] For some purposes, it is useful to get access to the parsed WSDL
structure.
B<Be aware> that the structure returned is consided "internal"
and strongly influenced by behavior of L<XML::Compile|XML::Compile>; backwards
compatibility will not be maintained at all cost.
You can use L<XML::Compile::Schema::template()|XML::Compile::Schema/"Compilers"> format C<TREE> to get
more details about the element types mentioned in this structure.
example:
use Data::Dumper;
$Data::Dumper::Indent = 1;
$Data::Dumper::Quotekeys = 0;
print Dumper $op->parsedWSDL;
=back
=head1 SEE ALSO
This module is part of XML-Compile-SOAP distribution version 3.26,
built on November 20, 2019. Website: F<http://perl.overmeer.net/CPAN/>
=head1 LICENSE
Copyrights 2007-2019 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 F<http://dev.perl.org/licenses/>
|