| Catalyst-Controller-SOAP documentation | Contained in the Catalyst-Controller-SOAP distribution. |
Catalyst::Action::SOAP::DocumentLiteral - Document Literal service
# not used directly.
This action implements a simple parse of the envelope and passing the body to the service as a xml object.
Almost all the SOAP protocol is unsupported, only the method dispatching and, optionally, the soap-decoding of the arguments are made.
Daniel Ruoso <daniel@ruoso.com>
Please submit all bugs regarding Catalyst::Controller::SOAP to
bug-catalyst-controller-soap@rt.cpan.org
This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
| Catalyst-Controller-SOAP documentation | Contained in the Catalyst-Controller-SOAP distribution. |
{ package Catalyst::Action::SOAP::DocumentLiteral; use base qw/Catalyst::Action::SOAP/; use constant NS_SOAP_ENV => "http://schemas.xmlsoap.org/soap/envelope/"; sub execute { my $self = shift; my ( $controller, $c ) = @_; $self->prepare_soap_helper($controller,$c); $self->prepare_soap_xml_post($controller,$c); unless ($c->stash->{soap}->fault) { my $envelope = $c->stash->{soap}->parsed_envelope; my $namespace = $c->stash->{soap}->namespace || NS_SOAP_ENV; my ($body) = $envelope->getElementsByTagNameNS($namespace, 'Body'); my $operation = $self->name; $c->stash->{soap}->operation_name($operation); eval { if ($controller->wsdlobj) { $body = $c->stash->{soap}->arguments ($controller->decoders->{$operation}->($body)); } }; if ($@) { $c->stash->{soap}->fault ({ code => 'SOAP-ENV:Client', reason => 'Bad Body', detail => 'Schema validation on the body failed: '.$@}); } else { $self->next::method($controller, $c, $body); } } } }; 1; __END__