=head1 NAME

XML::Compile::SOAP11::Operation - defines a SOAP11 interaction

=head1 INHERITANCE

 XML::Compile::SOAP11::Operation
   is a XML::Compile::SOAP::Operation

=head1 SYNOPSIS

 # object created by XML::Compile::WSDL*
 my $op = $wsdl->operation('GetStockPrices');

=head1 DESCRIPTION

Objects of this type define one possible SOAP11 interaction, either
client side or server side.

=head1 METHODS

=head2 Constructors

XML::Compile::SOAP11::Operation-E<gt>B<new>(OPTIONS)

=over 4

C<input_def>, C<output_def> and C<fault_def> are HASHes which contain
the input and output message header, body and fault-header definitions
in WSDL1.1 style.

 Option    --Defined in     --Default
 action      XML::Compile::SOAP::Operation  undef
 endpoints   XML::Compile::SOAP::Operation  []
 fault_def                    <undef>
 input_def                    <undef>
 kin         XML::Compile::SOAP::Operation  <required>
 nam         XML::Compile::SOAP::Operation  <required>
 output_def                   <undef>
 schemas     XML::Compile::SOAP::Operation  <required>
 style                        'document'
 transport   XML::Compile::SOAP::Operation  'HTTP'

. action => STRING

. endpoints => ADDRESS|ARRAY

. fault_def => HASH

. input_def => HASH

. kin => d

. nam => e

. output_def => HASH

. schemas => XML::Compile::Cache

. style => 'document'|'rpc'

. transport => URI|'HTTP'

=back

=head2 Accessors

$obj-E<gt>B<bindingName>

=over 4

See L<XML::Compile::SOAP::Operation/"Accessors">

=back

$obj-E<gt>B<clientClass>

=over 4

See L<XML::Compile::SOAP::Operation/"Accessors">

=back

$obj-E<gt>B<endPoints>

=over 4

See L<XML::Compile::SOAP::Operation/"Accessors">

=back

$obj-E<gt>B<kind>

=over 4

See L<XML::Compile::SOAP::Operation/"Accessors">

=back

$obj-E<gt>B<name>

=over 4

See L<XML::Compile::SOAP::Operation/"Accessors">

=back

$obj-E<gt>B<portName>

=over 4

See L<XML::Compile::SOAP::Operation/"Accessors">

=back

$obj-E<gt>B<schemas>

=over 4

See L<XML::Compile::SOAP::Operation/"Accessors">

=back

$obj-E<gt>B<serverClass>

=over 4

See L<XML::Compile::SOAP::Operation/"Accessors">

=back

$obj-E<gt>B<serviceName>

=over 4

See L<XML::Compile::SOAP::Operation/"Accessors">

=back

$obj-E<gt>B<soapAction>

=over 4

See L<XML::Compile::SOAP::Operation/"Accessors">

=back

$obj-E<gt>B<style>

=over 4

=back

$obj-E<gt>B<version>

=over 4

See L<XML::Compile::SOAP::Operation/"Accessors">

=back

$obj-E<gt>B<wsaAction>('INPUT'|'OUTPUT')

=over 4

See L<XML::Compile::SOAP::Operation/"Accessors">

=back

=head2 Modify

Operations are often modified by SOAP extensions.
See L<XML::Compile::SOAP::WSA|XML::Compile::SOAP::WSA>, for instance. Also demonstrated in
the FAQ, XML::Compile::SOAP::FAQ.

$obj-E<gt>B<addHeader>(('INPUT'|'OUTPUT'|'FAULT'), LABEL, ELEM)

=over 4

=back

=head2 Handlers

$obj-E<gt>B<compileClient>(OPTIONS)

=over 4

Returns one CODE reference which handles the processing for this
operation. Options C<transporter>, C<transport_hook>, and
C<endpoint> are passed to L<compileTransporter()|XML::Compile::SOAP::Operation/"Handlers">.

You pass that CODE reference an input message of the correct
type, as pure Perl HASH structure.  An 'request-response' operation
will return then answer, or C<undef> in case of failure.  An 'one-way'
operation with return C<undef> in case of failure, and a true value
when successfull.

You B<cannot> pass options for L<XML::Compile::Schema::compile()|XML::Compile::Schema/"Compilers">, like
C<<sloppy_integers => 0>>, hooks or typemaps this way. Provide these to
the C<::WSDL> or other C<::Cache> object which defines the types, via
C<new> option C<opts_rw> and friends.

=back

$obj-E<gt>B<compileHandler>(OPTIONS)

=over 4

Prepare the routines which will decode the request and encode the answer,
as will be run on the server. The L<XML::Compile::SOAP::Server|XML::Compile::SOAP::Server> will
connect these. All OPTIONS will get passed to
L<XML::Compile::SOAP11::Server::compileHandler()|XML::Compile::SOAP::Server/"Actions">

 Option  --Default
 callback  <required>
 selector  <from input def>

. callback => CODE

. selector => CODE

=over 4

Determines whether the handler belongs to a received message.

=back

=back

$obj-E<gt>B<compileTransporter>(OPTIONS)

=over 4

See L<XML::Compile::SOAP::Operation/"Handlers">

=back

=head2 Helpers

$obj-E<gt>B<explain>(WSDL, FORMAT, DIRECTION, OPTIONS)

=over 4

[since 2.13]

Dump an annotated structure showing how the operation works, helping
developers to understand the schema. FORMAT is always C<PERL>: C<XML>
is not yet supported.

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.

All OPTIONS besides those described here are passed to
L<XML::Compile::Schema::template()|XML::Compile::Schema/"Compilers">, when C<recurse> is enabled.

 Option     --Default
 recurse      <false>
 skip_header  <false>

. recurse => BOOLEAN

=over 4

Append the templates of all the part structures.

=back

. skip_header => BOOLEAN

=back

XML::Compile::SOAP11::Operation-E<gt>B<register>(URI, ENVNS)

=over 4

See L<XML::Compile::SOAP::Operation/"Helpers">

=back

=head1 SEE ALSO

This module is part of XML-Compile-SOAP distribution version 2.21,
built on December 25, 2010. Website: F<http://perl.overmeer.net/xml-compile/>

Other distributions in this suite:
L<XML::Compile>,
L<XML::Compile::SOAP>,
L<XML::Compile::SOAP12>,
L<XML::Compile::SOAP::Daemon>,
L<XML::Compile::SOAP::WSA>,
L<XML::Compile::Tester>,
L<XML::Compile::Cache>,
L<XML::Compile::Dumper>,
L<XML::Compile::RPC>,
L<XML::Rewrite>,
L<XML::eXistDB>,
and
L<XML::LibXML::Simple>.

Please post questions or ideas to the mailinglist at
F<http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/xml-compile>
For live contact with other developers, visit the C<#xml-compile> channel
on C<irc.perl.org>.

=head1 LICENSE

Copyrights 2007-2010 by Mark Overmeer. 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://www.perl.com/perl/misc/Artistic.html>

