[Catalyst-commits] r7174 - in Catalyst-Controller-SOAP/1.0/tags: .
0.0.6 0.0.6/lib/Catalyst/Action
0.0.6/lib/Catalyst/Action/SOAP 0.0.6/lib/Catalyst/Controller
0.0.6/lib/Catalyst/Controller/SOAP 0.0.6/t 0.0.6/t/PostApp
0.0.6/t/PostApp/lib 0.0.6/t/PostApp/lib/PostApp/Controller
0.0.6/t/PostApp/root 0.0.6/t/PostApp/root/static/images
0.0.6/t/PostApp/script 0.0.6/t/PostApp/t
0.0.6/t/lib/TestApp/Controller
ruoso at dev.catalyst.perl.org
ruoso at dev.catalyst.perl.org
Tue Nov 27 11:02:11 GMT 2007
Author: ruoso
Date: 2007-11-27 11:02:11 +0000 (Tue, 27 Nov 2007)
New Revision: 7174
Added:
Catalyst-Controller-SOAP/1.0/tags/0.0.6/
Catalyst-Controller-SOAP/1.0/tags/0.0.6/Changes
Catalyst-Controller-SOAP/1.0/tags/0.0.6/MANIFEST
Catalyst-Controller-SOAP/1.0/tags/0.0.6/META.yml
Catalyst-Controller-SOAP/1.0/tags/0.0.6/Makefile.PL
Catalyst-Controller-SOAP/1.0/tags/0.0.6/README
Catalyst-Controller-SOAP/1.0/tags/0.0.6/lib/
Catalyst-Controller-SOAP/1.0/tags/0.0.6/lib/Catalyst/Action/SOAP.pm
Catalyst-Controller-SOAP/1.0/tags/0.0.6/lib/Catalyst/Action/SOAP/DocumentLiteral.pm
Catalyst-Controller-SOAP/1.0/tags/0.0.6/lib/Catalyst/Action/SOAP/HTTPGet.pm
Catalyst-Controller-SOAP/1.0/tags/0.0.6/lib/Catalyst/Action/SOAP/RPCEndpoint.pm
Catalyst-Controller-SOAP/1.0/tags/0.0.6/lib/Catalyst/Controller/SOAP.pm
Catalyst-Controller-SOAP/1.0/tags/0.0.6/lib/Catalyst/Controller/SOAP/RPC.pm
Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/
Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/Catalyst-Controller-SOAP.t
Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp.t
Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/
Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/lib/PostApp.pm
Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/lib/PostApp/Controller/Root.pm
Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/script/post.pl
Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/lib/
Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/lib/TestApp/Controller/Root.pm
Removed:
Catalyst-Controller-SOAP/1.0/tags/0.0.6/lib/Catalyst/Action/SOAP.pm
Catalyst-Controller-SOAP/1.0/tags/0.0.6/lib/Catalyst/Action/SOAP/DocumentLiteral.pm
Catalyst-Controller-SOAP/1.0/tags/0.0.6/lib/Catalyst/Action/SOAP/RPCEndpoint.pm
Catalyst-Controller-SOAP/1.0/tags/0.0.6/lib/Catalyst/Controller/SOAP.pm
Catalyst-Controller-SOAP/1.0/tags/0.0.6/lib/Catalyst/Controller/SOAP/RPC.pm
Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/Catalyst-Controller-SOAP.t
Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/Changes
Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/Makefile.PL
Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/README
Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/lib/PostApp.pm
Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/lib/PostApp/Controller/Root.pm
Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/root/favicon.ico
Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/root/static/images/btn_120x50_built.png
Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/root/static/images/btn_120x50_built_shadow.png
Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/root/static/images/btn_120x50_powered.png
Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/root/static/images/btn_120x50_powered_shadow.png
Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/root/static/images/btn_88x31_built.png
Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/root/static/images/btn_88x31_built_shadow.png
Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/root/static/images/btn_88x31_powered.png
Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/root/static/images/btn_88x31_powered_shadow.png
Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/root/static/images/catalyst_logo.png
Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/script/post.pl
Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/script/postapp_create.pl
Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/script/postapp_fastcgi.pl
Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/t/01app.t
Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/t/02pod.t
Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/t/03podcoverage.t
Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/t/controller_WS.t
Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/lib/TestApp/Controller/Root.pm
Log:
[C-C-SOAP] marking release 0.0.6
Copied: Catalyst-Controller-SOAP/1.0/tags/0.0.6 (from rev 7164, Catalyst-Controller-SOAP/1.0/trunk)
Copied: Catalyst-Controller-SOAP/1.0/tags/0.0.6/Changes (from rev 7173, Catalyst-Controller-SOAP/1.0/trunk/Changes)
===================================================================
--- Catalyst-Controller-SOAP/1.0/tags/0.0.6/Changes (rev 0)
+++ Catalyst-Controller-SOAP/1.0/tags/0.0.6/Changes 2007-11-27 11:02:11 UTC (rev 7174)
@@ -0,0 +1,95 @@
+Revision history for Perl extension Catalyst::Controller::SOAP.
+
+0.01 Tue Nov 6 10:23:19 2007
+ - original version; created by h2xs 1.23 with options
+ -n Catalyst::Controller::SOAP
+
+commit 865fcd5df2222b9034690fef7f4f6c800c9a75d4
+Author: Daniel Ruoso <daniel at ruoso.com>
+Date: Wed Nov 21 18:21:23 2007 +0000
+
+ The PostApp app is now used in a test...
+
+commit 16f12fb6cda352faa2e88dacf6e468c3778d3a52
+Author: Daniel Ruoso <ruoso at pitombeira.(none)>
+Date: Sun Nov 18 16:50:54 2007 +0000
+
+ now do not depend on renderview in the test. Also declare the versioned dependency on the Catalyst::Runtime
+
+commit dcdeecc9b1add94f68aa1905957cd9b9ae96c761
+Author: Daniel Ruoso <ruoso at pitombeira.(none)>
+Date: Thu Nov 15 09:59:28 2007 +0000
+
+ marking new release
+
+commit a201321dde6a2575d95b88fbf854caf424ca0ccf
+Author: Daniel Ruoso <ruoso at pitombeira.(none)>
+Date: Thu Nov 15 09:54:21 2007 +0000
+
+ fixing naming of modules in documentation...
+
+commit 7c2b71c1a19a521768c6debf07aaea149549195e
+Author: Daniel Ruoso <ruoso at pitombeira.(none)>
+Date: Wed Nov 14 19:13:24 2007 +0000
+
+ marking new release
+
+commit e9bd4bbe2c3d3e678b7fc1440b5f72766b3307a6
+Author: Daniel Ruoso <ruoso at pitombeira.(none)>
+Date: Wed Nov 14 19:12:53 2007 +0000
+
+ rpc endpoint now working
+
+commit 8baa49622fadce26d5e67ab3e1a215573b544b29
+Author: Daniel Ruoso <ruoso at pitombeira.(none)>
+Date: Wed Nov 14 18:49:51 2007 +0000
+
+ inserting an application inside it as to become more easily testeable
+
+commit cbb6c48df9344176d1b7a7ca913358762758216f
+Author: Daniel Ruoso <ruoso at pitombeira.(none)>
+Date: Wed Nov 14 17:44:53 2007 +0000
+
+ commenting out the post test, as I am not being able to actually test it.
+
+commit 255b3e5ecfd72b6ee80efd13352ec339bb8544b0
+Author: Daniel Ruoso <ruoso at pitombeira.(none)>
+Date: Wed Nov 14 15:19:25 2007 +0000
+
+ trying to make the test POST to work
+
+commit 05f68c21b35b7e935a1cbf69841550ef4a941726
+Author: Daniel Ruoso <ruoso at pitombeira.(none)>
+Date: Wed Nov 14 14:22:14 2007 +0000
+
+ fixing the attribute parsing method. HTTPGet working, POST test failing because the post data is not reaching the destination...
+
+commit ae3039a74cfe706bd3580a36f53a6221fbe7f39d
+Author: Daniel Ruoso <ruoso at pitombeira.(none)>
+Date: Wed Nov 14 12:56:34 2007 +0000
+
+ Implementing a test application
+
+commit 9df23a3e824051f9b53c372c423dd40407af9b23
+Author: Daniel Ruoso <ruoso at pitombeira.(none)>
+Date: Tue Nov 13 18:57:31 2007 +0000
+
+ HTTP Get implementation.
+
+commit fb83167aacbc590632158e8a4469c6d99d635887
+Author: Daniel Ruoso <ruoso at pitombeira.(none)>
+Date: Tue Nov 13 18:04:29 2007 +0000
+
+ Implements minimal response generation
+
+commit 8172902febdd3686d6be6ecbc4daad5a139d383b
+Author: Daniel Ruoso <ruoso at pitombeira.(none)>
+Date: Tue Nov 13 17:10:53 2007 +0000
+
+ XML::DOM doesn't support namespaces, let's move to XML::LibXML instead
+
+commit 4635f7dc730316da5952d3e533e439288508fb21
+Author: Daniel Ruoso <ruoso at pitombeira.(none)>
+Date: Tue Nov 13 15:17:41 2007 +0000
+
+ initial revision
Copied: Catalyst-Controller-SOAP/1.0/tags/0.0.6/MANIFEST (from rev 7173, Catalyst-Controller-SOAP/1.0/trunk/MANIFEST)
===================================================================
--- Catalyst-Controller-SOAP/1.0/tags/0.0.6/MANIFEST (rev 0)
+++ Catalyst-Controller-SOAP/1.0/tags/0.0.6/MANIFEST 2007-11-27 11:02:11 UTC (rev 7174)
@@ -0,0 +1,32 @@
+Changes
+Makefile.PL
+MANIFEST
+META.yml
+README
+t/Catalyst-Controller-SOAP.t
+t/PostApp.t
+t/lib/TestApp/Controller/WS.pm
+t/lib/TestApp/Controller/Root.pm
+t/lib/TestApp.pm
+t/PostApp
+t/PostApp/script
+t/PostApp/script/postapp_cgi.pl
+t/PostApp/script/postapp_test.pl
+t/PostApp/script/post.pl
+t/PostApp/script/postapp_server.pl
+t/PostApp/lib
+t/PostApp/lib/PostApp
+t/PostApp/lib/PostApp/Controller
+t/PostApp/lib/PostApp/Controller/WS.pm
+t/PostApp/lib/PostApp/Controller/Root.pm
+t/PostApp/lib/PostApp/Controller/WS2.pm
+t/PostApp/lib/PostApp.pm
+t/PostApp/postapp.yml
+lib/Catalyst/Action/SOAP.pm
+lib/Catalyst/Action/SOAP/DocumentLiteral.pm
+lib/Catalyst/Action/SOAP/HTTPGet.pm
+lib/Catalyst/Action/SOAP/RPCEndpoint.pm
+lib/Catalyst/Action/SOAP/RPCLiteral.pm
+lib/Catalyst/Action/SOAP/RPCEncoded.pm
+lib/Catalyst/Controller/SOAP.pm
+lib/Catalyst/Controller/SOAP/RPC.pm
Copied: Catalyst-Controller-SOAP/1.0/tags/0.0.6/META.yml (from rev 7168, Catalyst-Controller-SOAP/1.0/trunk/META.yml)
===================================================================
--- Catalyst-Controller-SOAP/1.0/tags/0.0.6/META.yml (rev 0)
+++ Catalyst-Controller-SOAP/1.0/tags/0.0.6/META.yml 2007-11-27 11:02:11 UTC (rev 7174)
@@ -0,0 +1,16 @@
+--- #YAML:1.0
+name: Catalyst-Controller-SOAP
+abstract: Add SOAP features to the Catalyst Framework
+version: 0.0.1
+author:
+ - Daniel Ruoso <daniel.ruoso at verticalone.pt>
+license: perl
+distribution_type: module
+requires:
+ XML::LibXML: 0
+ Catalyst::Controller: 5.7000
+meta-spec:
+ version: 1.3
+ url: http://module-build.sourceforge.net/META-spec-v1.3.html
+resources:
+ repository: http://people.debian.org/~ruoso/Catalyst-Controller-SOAP/
Copied: Catalyst-Controller-SOAP/1.0/tags/0.0.6/Makefile.PL (from rev 7173, Catalyst-Controller-SOAP/1.0/trunk/Makefile.PL)
===================================================================
--- Catalyst-Controller-SOAP/1.0/tags/0.0.6/Makefile.PL (rev 0)
+++ Catalyst-Controller-SOAP/1.0/tags/0.0.6/Makefile.PL 2007-11-27 11:02:11 UTC (rev 7174)
@@ -0,0 +1,12 @@
+use 5.008008;
+use ExtUtils::MakeMaker;
+# See lib/ExtUtils/MakeMaker.pm for details of how to influence
+# the contents of the Makefile that is written.
+WriteMakefile(
+ NAME => 'Catalyst::Controller::SOAP',
+ VERSION_FROM => 'lib/Catalyst/Controller/SOAP.pm', # finds $VERSION
+ PREREQ_PM => { Catalyst::Runtime => 5.7011, XML::LibXML => 0}, # e.g., Module::Name => 1.1
+ ($] >= 5.005 ? ## Add these new keywords supported since 5.005
+ (ABSTRACT_FROM => 'lib/Catalyst/Controller/SOAP.pm', # retrieve abstract from module
+ AUTHOR => 'Daniel Ruoso <daniel.ruoso at verticalone.pt>') : ()),
+);
Copied: Catalyst-Controller-SOAP/1.0/tags/0.0.6/README (from rev 7173, Catalyst-Controller-SOAP/1.0/trunk/README)
===================================================================
--- Catalyst-Controller-SOAP/1.0/tags/0.0.6/README (rev 0)
+++ Catalyst-Controller-SOAP/1.0/tags/0.0.6/README 2007-11-27 11:02:11 UTC (rev 7174)
@@ -0,0 +1,114 @@
+NAME
+ Catalyst::Controller::SOAP - Catalyst SOAP Controller
+
+SYNOPSIS
+ package MyApp::Controller::Example;
+ use base 'Catalyst::Controller::SOAP';
+
+ # available in "/example" as operation "echo"
+ # parsing the arguments as soap-encoded.
+ sub echo : SOAP('RPCEncoded') {
+ my ( $self, $c, @args ) = @_;
+ }
+
+ # available in "/example" as operation "ping". The arguments are
+ # treated as a literal document and passed to the method as a
+ # XML::LibXML object
+ sub ping : SOAP('RPCLiteral') {
+ my ( $self, $c, $xml) = @_;
+ my $name = $xml->findValue('some xpath expression');
+ }
+
+ # avaiable as "/example/world" in document context. The entire body
+ # is delivered to the method as a XML::LibXML object.
+ sub world : SOAP('DocumentLiteral') {
+ my ($self, $c, $doc) = @_;
+ }
+
+ # this is the endpoint from where the RPC operations will be
+ # dispatched. This code won't be executed at all.
+ sub index : SOAP('RPCEndpoint') {}
+
+ABSTACT
+ Implements SOAP serving support in Catalyst.
+
+DESCRIPTION
+ SOAP Controller for Catalyst which we tried to make compatible with the
+ way Catalyst works with URLS.It is important to notice that this
+ controller declares by default an index operation which will dispatch
+ the RPC operations under this class.
+
+ATTRIBUTES
+ This class implements the SOAP attribute wich is used to do the mapping
+ of that operation to the apropriate action class. The name of the class
+ used is formed as Catalyst::Action::SOAP::$value, unless the parameter
+ of the attribute starts with a '+', which implies complete namespace.
+
+ The implementation of SOAP Action classes helps delivering specific SOAP
+ scenarios, like HTTP GET, RPC Encoded, RPC Literal or Document Literal,
+ or even Document RDF or just about any required combination.
+
+ See Catalyst::Action::SOAP::DocumentLiteral for an example.
+
+ACCESSORS
+ Once you tagged one of the methods, you'll have an $c->stash->{soap}
+ accessor which will return an "Catalyst::Controller::SOAP::Helper"
+ object. It's important to notice that this is achieved by the fact that
+ all the SOAP Action classes are subclasses of Catalyst::Action::SOAP,
+ which implements most of that.
+
+ You can query this object as follows:
+
+ $c->stash->{soap}->envelope()
+ The original SOAP envelope as string.
+
+ $c->stash->{soap}->parsed_envelope()
+ The parsed envelope as an XML::LibXML object.
+
+ $c->stash->{soap}->arguments()
+ The arguments of a RPC call.
+
+ $c->stash->{soap}->fault({code => $code,reason => $reason, detail =>
+ $detail])
+ Allows you to set fault code and message. Optionally, you may define
+ the code itself as an arrayref where the first item will be this
+ code and the second will be the subcode, which recursively may be
+ another arrayref.
+
+ $c->stash->{soap}->encoded_return(\@data)
+ This method will prepare the return value to be a soap encoded data.
+
+ $c->stash->{soap}->literal_return($xml_node)
+ This method will prepare the return value to be a literal XML
+ document, in this case, you can pass just the node that will be the
+ root in the return message.
+
+ $c->stash->{soap}->literal_string_return($xml_text)
+ In this case, the argument is used literally inside the message. It
+ is supposed to already contain all namespace definitions in it.
+
+ $c->stash->{soap}->string_return($non_xml_text)
+ In this case, the given text is encoded as CDATA inside the SOAP
+ message.
+
+TODO
+ At this moment, this is a very early release. So almost everything is
+ still to be done. The only thing done right now is getting the body from
+ the message and dispatching the correct method.
+
+SEE ALSO
+ Catalyst::Action::SOAP, XML::LibXML,
+ Catalyst::Action::SOAP::DocumentLiteral,
+ Catalyst::Action::SOAP::RPCEncoded, Catalyst::Action::SOAP::HTTPGet
+
+AUTHORS
+ Daniel Ruoso "daniel.ruoso at verticalone.pt"
+
+BUG REPORTS
+ Please submit all bugs regarding "Catalyst::Controller::SOAP" to
+ "bug-catalyst-controller-soap at rt.cpan.org"
+
+LICENSE
+ This library is free software, you can redistribute it and/or modify it
+ under the same terms as Perl itself.
+
Copied: Catalyst-Controller-SOAP/1.0/tags/0.0.6/lib (from rev 7165, Catalyst-Controller-SOAP/1.0/trunk/lib)
Deleted: Catalyst-Controller-SOAP/1.0/tags/0.0.6/lib/Catalyst/Action/SOAP/DocumentLiteral.pm
===================================================================
--- Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst/Action/SOAP/DocumentLiteral.pm 2007-11-27 10:48:51 UTC (rev 7165)
+++ Catalyst-Controller-SOAP/1.0/tags/0.0.6/lib/Catalyst/Action/SOAP/DocumentLiteral.pm 2007-11-27 11:02:11 UTC (rev 7174)
@@ -1,56 +0,0 @@
-{ package Catalyst::Action::SOAP::DocumentLiteral;
-
- use base qw/Catalyst::Action::SOAP/;
-
- sub execute {
- my $self = shift;
- my ( $controller, $c ) = @_;
- $self->prepare_soap_helper($c);
- $self->prepare_soap_xml_post($c);
- unless ($c->stash->{soap}->fault) {
- my $envelope = $c->stash->{soap}->parsed_envelope;
- my ($body) = $envelope->getElementsByTagName('body',0);
- $self->NEXT::execute($controller, $c, $body);
- }
- }
-};
-
-1;
-
-__END__
-
-=head1 NAME
-
-Catalyst::Action::SOAP::DocumentLiteral - Document Literal service
-
-=head1 SYNOPSIS
-
- # not used directly.
-
-=head1 DESCRIPTION
-
-This action implements a simple parse of the envelope and passing the
-body to the service as a xml object.
-
-=head1 TODO
-
-Almost all the SOAP protocol is unsupported, only the method
-dispatching and, optionally, the soap-decoding of the arguments are
-made.
-
-=head1 AUTHORS
-
-Daniel Ruoso <daniel.ruoso at verticalone.pt>
-
-=head1 BUG REPORTS
-
-Please submit all bugs regarding C<Catalyst::Controller::SOAP> to
-C<bug-catalyst-controller-soap at rt.cpan.org>
-
-=head1 LICENSE
-
-This library is free software, you can redistribute it and/or modify
-it under the same terms as Perl itself.
-
-=cut
-
Copied: Catalyst-Controller-SOAP/1.0/tags/0.0.6/lib/Catalyst/Action/SOAP/DocumentLiteral.pm (from rev 7169, Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst/Action/SOAP/DocumentLiteral.pm)
===================================================================
--- Catalyst-Controller-SOAP/1.0/tags/0.0.6/lib/Catalyst/Action/SOAP/DocumentLiteral.pm (rev 0)
+++ Catalyst-Controller-SOAP/1.0/tags/0.0.6/lib/Catalyst/Action/SOAP/DocumentLiteral.pm 2007-11-27 11:02:11 UTC (rev 7174)
@@ -0,0 +1,56 @@
+{ package Catalyst::Action::SOAP::DocumentLiteral;
+
+ use base qw/Catalyst::Action::SOAP/;
+
+ sub execute {
+ my $self = shift;
+ my ( $controller, $c ) = @_;
+ $self->prepare_soap_helper($c);
+ $self->prepare_soap_xml_post($c);
+ unless ($c->stash->{soap}->fault) {
+ my $envelope = $c->stash->{soap}->parsed_envelope;
+ my ($body) = $envelope->getElementsByTagName('Body',0);
+ $self->NEXT::execute($controller, $c, $body);
+ }
+ }
+};
+
+1;
+
+__END__
+
+=head1 NAME
+
+Catalyst::Action::SOAP::DocumentLiteral - Document Literal service
+
+=head1 SYNOPSIS
+
+ # not used directly.
+
+=head1 DESCRIPTION
+
+This action implements a simple parse of the envelope and passing the
+body to the service as a xml object.
+
+=head1 TODO
+
+Almost all the SOAP protocol is unsupported, only the method
+dispatching and, optionally, the soap-decoding of the arguments are
+made.
+
+=head1 AUTHORS
+
+Daniel Ruoso <daniel.ruoso at verticalone.pt>
+
+=head1 BUG REPORTS
+
+Please submit all bugs regarding C<Catalyst::Controller::SOAP> to
+C<bug-catalyst-controller-soap at rt.cpan.org>
+
+=head1 LICENSE
+
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut
+
Copied: Catalyst-Controller-SOAP/1.0/tags/0.0.6/lib/Catalyst/Action/SOAP/HTTPGet.pm (from rev 7168, Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst/Action/SOAP/HTTPGet.pm)
===================================================================
--- Catalyst-Controller-SOAP/1.0/tags/0.0.6/lib/Catalyst/Action/SOAP/HTTPGet.pm (rev 0)
+++ Catalyst-Controller-SOAP/1.0/tags/0.0.6/lib/Catalyst/Action/SOAP/HTTPGet.pm 2007-11-27 11:02:11 UTC (rev 7174)
@@ -0,0 +1,51 @@
+{ package Catalyst::Action::SOAP::HTTPGet;
+
+ use base qw/Catalyst::Action::SOAP/;
+
+ sub execute {
+ my $self = shift;
+ my ( $controller, $c ) = @_;
+ $self->prepare_soap_helper($c);
+ $self->NEXT::execute(@_);
+ }
+};
+
+1;
+
+__END__
+
+=head1 NAME
+
+Catalyst::Action::SOAP::HTTPGet - HTTP Get service
+
+=head1 SYNOPSIS
+
+ # not used directly.
+
+=head1 DESCRIPTION
+
+This actually is here just to help delivering services that are
+invoked by simple http get requests, as defined in the SOAP spec. It
+won't do much, except for preparing the $c->stash->{soap} variable, so
+the returns can be implemented.
+
+=head1 TODO
+
+There is not much to be done here.
+
+=head1 AUTHORS
+
+Daniel Ruoso <daniel.ruoso at verticalone.pt>
+
+=head1 BUG REPORTS
+
+Please submit all bugs regarding C<Catalyst::Controller::SOAP> to
+C<bug-catalyst-controller-soap at rt.cpan.org>
+
+=head1 LICENSE
+
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut
+
Deleted: Catalyst-Controller-SOAP/1.0/tags/0.0.6/lib/Catalyst/Action/SOAP/RPCEndpoint.pm
===================================================================
--- Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst/Action/SOAP/RPCEndpoint.pm 2007-11-27 10:48:51 UTC (rev 7165)
+++ Catalyst-Controller-SOAP/1.0/tags/0.0.6/lib/Catalyst/Action/SOAP/RPCEndpoint.pm 2007-11-27 11:02:11 UTC (rev 7174)
@@ -1,80 +0,0 @@
-{ package Catalyst::Action::SOAP::RPCEndpoint;
-
- use base qw/Catalyst::Action::SOAP/;
-
- sub execute {
- my $self = shift;
- my ( $controller, $c ) = @_;
-
- $self->prepare_soap_helper($c);
- $self->prepare_soap_xml_post($c);
- unless ($c->stash->{soap}->fault) {
- my $envelope = $c->stash->{soap}->parsed_envelope;
- my ($body) = $envelope->getElementsByTagName('body',0)
- my @children = $body->getChildNodes();
- if (scalar @children != 1) {
- $c->stash->{soap}->fault
- ({ code => { 'env:Sender' => 'env:Body' },
- reason => 'Bad Body', detail =>
- 'RPC messages should contain only one element inside body'})
- } else {
- my $operation = $children[0]->getNodeName();
- my $arguments = $children[0]->getChildNodes();
- $c->stash->{soap}->arguments($arguments);
- if ($controller->action_for($operation)->attributes->{ActionClass} !~ /RPC(Encoded|Literal)/) {
- $c->stash->{soap}->fault
- ({ code => { env:Sender => 'env:Body' },
- reason => 'Bad Operation', detail =>
- 'Invalid Operation'})
- } else {
- # this is our RPC action
- $c->forward($operation);
- }
- }
- }
- }
-};
-
-1;
-
-__END__
-
-=head1 NAME
-
-Catalyst::Controller::SOAP::Action::RPCEndpoint - RPC Dispatcher
-
-=head1 SYNOPSIS
-
- # not used directly.
-
-=head1 DESCRIPTION
-
-This class is used by L<Catalyst::Controller::SOAP> to dispatch to the
-RPC operations inside a controller. These operations are quite
-different from the others, as they are seen by Catalyst as this single
-action. During the registering phase, the soap rpc operations are
-included in the hash that is sent to this object, so they can be
-invoked later.
-
-=head1 TODO
-
-Almost all the SOAP protocol is unsupported, only the method
-dispatching and, optionally, the soap-decoding of the arguments are
-made.
-
-=head1 AUTHORS
-
-Daniel Ruoso <daniel.ruoso at verticalone.pt>
-
-=head1 BUG REPORTS
-
-Please submit all bugs regarding C<Catalyst::Controller::SOAP> to
-C<bug-catalyst-controller-soap at rt.cpan.org>
-
-=head1 LICENSE
-
-This library is free software, you can redistribute it and/or modify
-it under the same terms as Perl itself.
-
-=cut
-
Copied: Catalyst-Controller-SOAP/1.0/tags/0.0.6/lib/Catalyst/Action/SOAP/RPCEndpoint.pm (from rev 7171, Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst/Action/SOAP/RPCEndpoint.pm)
===================================================================
--- Catalyst-Controller-SOAP/1.0/tags/0.0.6/lib/Catalyst/Action/SOAP/RPCEndpoint.pm (rev 0)
+++ Catalyst-Controller-SOAP/1.0/tags/0.0.6/lib/Catalyst/Action/SOAP/RPCEndpoint.pm 2007-11-27 11:02:11 UTC (rev 7174)
@@ -0,0 +1,80 @@
+{ package Catalyst::Action::SOAP::RPCEndpoint;
+
+ use base qw/Catalyst::Action::SOAP/;
+
+ sub execute {
+ my $self = shift;
+ my ( $controller, $c ) = @_;
+
+ $self->prepare_soap_helper($c);
+ $self->prepare_soap_xml_post($c);
+ unless ($c->stash->{soap}->fault) {
+ my $envelope = $c->stash->{soap}->parsed_envelope;
+ my ($body) = $envelope->getElementsByTagName('Body',0);
+ my @children = $body->getChildNodes();
+ if (scalar @children != 1) {
+ $c->stash->{soap}->fault
+ ({ code => { 'env:Sender' => 'env:Body' },
+ reason => 'Bad Body', detail =>
+ 'RPC messages should contain only one element inside body'})
+ } else {
+ my $operation = $children[0]->nodeName();
+ my $arguments = $children[0]->getChildNodes();
+ $c->stash->{soap}->arguments($arguments);
+ if (!grep { /RPC(Encoded|Literal)/ } @{$controller->action_for($operation)->attributes->{ActionClass}}) {
+ $c->stash->{soap}->fault
+ ({ code => { 'env:Sender' => 'env:Body' },
+ reason => 'Bad Operation', detail =>
+ 'Invalid Operation'})
+ } else {
+ # this is our RPC action
+ $c->forward($operation);
+ }
+ }
+ }
+ }
+};
+
+1;
+
+__END__
+
+=head1 NAME
+
+Catalyst::Action::SOAP::RPCEndpoint - RPC Dispatcher
+
+=head1 SYNOPSIS
+
+ # not used directly.
+
+=head1 DESCRIPTION
+
+This class is used by L<Catalyst::Controller::SOAP> to dispatch to the
+RPC operations inside a controller. These operations are quite
+different from the others, as they are seen by Catalyst as this single
+action. During the registering phase, the soap rpc operations are
+included in the hash that is sent to this object, so they can be
+invoked later.
+
+=head1 TODO
+
+Almost all the SOAP protocol is unsupported, only the method
+dispatching and, optionally, the soap-decoding of the arguments are
+made.
+
+=head1 AUTHORS
+
+Daniel Ruoso <daniel.ruoso at verticalone.pt>
+
+=head1 BUG REPORTS
+
+Please submit all bugs regarding C<Catalyst::Controller::SOAP> to
+C<bug-catalyst-controller-soap at rt.cpan.org>
+
+=head1 LICENSE
+
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut
+
Deleted: Catalyst-Controller-SOAP/1.0/tags/0.0.6/lib/Catalyst/Action/SOAP.pm
===================================================================
--- Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst/Action/SOAP.pm 2007-11-27 10:48:51 UTC (rev 7165)
+++ Catalyst-Controller-SOAP/1.0/tags/0.0.6/lib/Catalyst/Action/SOAP.pm 2007-11-27 11:02:11 UTC (rev 7174)
@@ -1,75 +0,0 @@
-{ package Catalyst::Action::SOAP;
-
- use base qw/Catalyst::Action/;
- use XML::DOM::XPath;
-
- __PACKAGE__->mk_accessors(qw/xml_parser/);
-
- sub new {
- my $class = shift;
- my $self = $class->SUPER::new(@_);
- $self->xml_parser(XML::DOM::Parser->new());
- return $self;
- }
-
- sub prepare_soap_helper {
- my ($self, $c) = @_;
- $c->stash->{soap} = Catalyst::Controller::SOAP::Helper->new();
- }
-
- sub prepare_soap_xml_post {
- my ($self, $c) = @_;
- if ($c->req->content_type =~ /application\/soap\+xml/ &&
- $c->req->method eq 'POST') {
- my $xml_str = $c->req->body;
- eval {
- $c->stash->{soap}->envelope($xml_str);
- $c->stash->{soap}->parsed_envelope($self->xml_parser->parse($xml_str));
- };
- if ($@) {
- $c->stash->{soap}->fault({ code => 'env:Sender', reason => 'Bad XML Message', detail => $@});
- }
- } else {
- $c->stash->{soap}->fault({ code => 'env:Sender', reason => 'Bad content-type/method'});
- }
- }
-};
-
-1;
-
-__END__
-
-=head1 NAME
-
-Catalyst::Controller::SOAP::Action - Action superclass
-
-=head1 SYNOPSIS
-
- # not used directly.
-
-=head1 DESCRIPTION
-
-This is the superclass used by the Document and the RPC actions.
-
-=head1 TODO
-
-Almost all the SOAP protocol is unsupported, only the method
-dispatching and, optionally, the soap-decoding of the arguments are
-made.
-
-=head1 AUTHORS
-
-Daniel Ruoso <daniel.ruoso at verticalone.pt>
-
-=head1 BUG REPORTS
-
-Please submit all bugs regarding C<Catalyst::Controller::SOAP> to
-C<bug-catalyst-controller-soap at rt.cpan.org>
-
-=head1 LICENSE
-
-This library is free software, you can redistribute it and/or modify
-it under the same terms as Perl itself.
-
-=cut
-
Copied: Catalyst-Controller-SOAP/1.0/tags/0.0.6/lib/Catalyst/Action/SOAP.pm (from rev 7171, Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst/Action/SOAP.pm)
===================================================================
--- Catalyst-Controller-SOAP/1.0/tags/0.0.6/lib/Catalyst/Action/SOAP.pm (rev 0)
+++ Catalyst-Controller-SOAP/1.0/tags/0.0.6/lib/Catalyst/Action/SOAP.pm 2007-11-27 11:02:11 UTC (rev 7174)
@@ -0,0 +1,76 @@
+{ package Catalyst::Action::SOAP;
+
+ use base qw/Catalyst::Action/;
+ use XML::LibXML;
+
+ __PACKAGE__->mk_accessors(qw/xml_parser/);
+
+ sub new {
+ my $class = shift;
+ my $self = $class->SUPER::new(@_);
+ $self->xml_parser(XML::LibXML->new());
+ return $self;
+ }
+
+ sub prepare_soap_helper {
+ my ($self, $c) = @_;
+ $c->stash->{soap} = Catalyst::Controller::SOAP::Helper->new();
+ }
+
+ sub prepare_soap_xml_post {
+ my ($self, $c) = @_;
+ if ($c->req->content_type =~ /application\/soap\+xml/ &&
+ $c->req->method eq 'POST') {
+ my $body = $c->req->body;
+ my $xml_str = join '', <$body>;
+ eval {
+ $c->stash->{soap}->envelope($xml_str);
+ $c->stash->{soap}->parsed_envelope($self->xml_parser->parse_string($xml_str));
+ };
+ if ($@) {
+ $c->stash->{soap}->fault({ code => 'env:Sender', reason => 'Bad XML Message', detail => $@});
+ }
+ } else {
+ $c->stash->{soap}->fault({ code => 'env:Sender', reason => 'Bad content-type/method'});
+ }
+ }
+};
+
+1;
+
+__END__
+
+=head1 NAME
+
+Catalyst::Action::SOAP - Action superclass
+
+=head1 SYNOPSIS
+
+ # not used directly.
+
+=head1 DESCRIPTION
+
+This is the superclass used by the Document and the RPC actions.
+
+=head1 TODO
+
+Almost all the SOAP protocol is unsupported, only the method
+dispatching and, optionally, the soap-decoding of the arguments are
+made.
+
+=head1 AUTHORS
+
+Daniel Ruoso <daniel.ruoso at verticalone.pt>
+
+=head1 BUG REPORTS
+
+Please submit all bugs regarding C<Catalyst::Controller::SOAP> to
+C<bug-catalyst-controller-soap at rt.cpan.org>
+
+=head1 LICENSE
+
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut
+
Deleted: Catalyst-Controller-SOAP/1.0/tags/0.0.6/lib/Catalyst/Controller/SOAP/RPC.pm
===================================================================
--- Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst/Controller/SOAP/RPC.pm 2007-11-27 10:48:51 UTC (rev 7165)
+++ Catalyst-Controller-SOAP/1.0/tags/0.0.6/lib/Catalyst/Controller/SOAP/RPC.pm 2007-11-27 11:02:11 UTC (rev 7174)
@@ -1,46 +0,0 @@
-{ package Catalyst::Controller::SOAP::RPC;
- use strict;
- use base qw(Catalyst::Controller::SOAP);
- sub rpc_endpoint :Path('') :SOAPRPCEndpoint { };
-};
-
-1;
-
-__END__
-
-=head1 NAME
-
-Catalyst::Controller::SOAP::RPC - Helper controller for SOAP
-
-=head1 SYNOPSIS
-
- use base qw(Catalyst::Controller::SOAP::RPC);
-
-=head1 DESCRIPTION
-
-This is a direct subclass of Catalyst::Controller::SOAP that
-predefines a rpc_endpoint method which is dispatched in the URI of the
-controller as the RPC endpoint. It's simply inteded to save you the
-job of defining that in each SOAP RPC controller you implement,
-considering that is the standard behaviour.
-
-=head1 TODO
-
-Well, here? nothing, all the work is done in the superclass.
-
-=head1 AUTHOR
-
-Daniel Ruoso <daniel.ruoso at verticalone.pt>
-
-=head1 BUG REPORTS
-
-Please submit all bugs regarding C<Catalyst::Controller::SOAP> to
-C<bug-catalyst-controller-soap at rt.cpan.org>
-
-=head1 LICENSE
-
-This library is free software, you can redistribute it and/or modify
-it under the same terms as Perl itself.
-
-=cut
-
Copied: Catalyst-Controller-SOAP/1.0/tags/0.0.6/lib/Catalyst/Controller/SOAP/RPC.pm (from rev 7169, Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst/Controller/SOAP/RPC.pm)
===================================================================
--- Catalyst-Controller-SOAP/1.0/tags/0.0.6/lib/Catalyst/Controller/SOAP/RPC.pm (rev 0)
+++ Catalyst-Controller-SOAP/1.0/tags/0.0.6/lib/Catalyst/Controller/SOAP/RPC.pm 2007-11-27 11:02:11 UTC (rev 7174)
@@ -0,0 +1,46 @@
+{ package Catalyst::Controller::SOAP::RPC;
+ use strict;
+ use base qw(Catalyst::Controller::SOAP);
+ sub rpc_endpoint :Path('') :SOAP('RPCEndpoint') { };
+};
+
+1;
+
+__END__
+
+=head1 NAME
+
+Catalyst::Controller::SOAP::RPC - Helper controller for SOAP
+
+=head1 SYNOPSIS
+
+ use base qw(Catalyst::Controller::SOAP::RPC);
+
+=head1 DESCRIPTION
+
+This is a direct subclass of Catalyst::Controller::SOAP that
+predefines a rpc_endpoint method which is dispatched in the URI of the
+controller as the RPC endpoint. It's simply inteded to save you the
+job of defining that in each SOAP RPC controller you implement,
+considering that is the standard behaviour.
+
+=head1 TODO
+
+Well, here? nothing, all the work is done in the superclass.
+
+=head1 AUTHOR
+
+Daniel Ruoso <daniel.ruoso at verticalone.pt>
+
+=head1 BUG REPORTS
+
+Please submit all bugs regarding C<Catalyst::Controller::SOAP> to
+C<bug-catalyst-controller-soap at rt.cpan.org>
+
+=head1 LICENSE
+
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut
+
Deleted: Catalyst-Controller-SOAP/1.0/tags/0.0.6/lib/Catalyst/Controller/SOAP.pm
===================================================================
--- Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst/Controller/SOAP.pm 2007-11-27 10:48:51 UTC (rev 7165)
+++ Catalyst-Controller-SOAP/1.0/tags/0.0.6/lib/Catalyst/Controller/SOAP.pm 2007-11-27 11:02:11 UTC (rev 7174)
@@ -1,168 +0,0 @@
-{ package Catalyst::Controller::SOAP;
-
- use strict;
- use base qw/Catalyst::Controller/;
-
- our $VERSION = '0.0.1';
-
- sub _parse_SOAP_Attr {
- my ($self, $c, $name, $value) = @_;
- my $actionclass = $value =~ /^+/ ? $value :
- 'SOAP::'.$value;
- (
- ActionClass => $actionclass,
- )
- }
-
-};
-
-{ package Catalyst::Controller::SOAP::Helper;
-
- use base qw(Class::Accessor::Fast);
-
- __PACKAGE__->mk_accessors(qw{envelope parsed_envelope arguments error
- encoded_return literal_return
- literal_string_return string_return});
-
-};
-
-1;
-
-__END__
-
-=head1 NAME
-
-Catalyst::Controller::SOAP -- Catalyst SOAP Controller
-
-=head1 SYNOPSIS
-
- package MyApp::Controller::Example;
- use base 'Catalyst::Controller::SOAP';
-
- # available in "/example" as operation "echo"
- # parsing the arguments as soap-encoded.
- sub echo : SOAP('RPCEncoded') {
- my ( $self, $c, @args ) = @_;
- }
-
- # available in "/example" as operation "ping". The arguments are
- # treated as a literal document and passed to the method as a
- # XML::DOM::XPath object
- sub ping : SOAP('RPCLiteral') {
- my ( $self, $c, $xml) = @_;
- my $name = $xml->findValue('some xpath expression');
- }
-
- # avaiable as "/example/world" in document context. The entire body
- # is delivered to the method as a XML::DOM::XPath object.
- sub world : SOAP('DocLiteral') {
- my ($self, $c, $doc) = @_;
- }
-
- # this is the endpoint from where the RPC operations will be
- # dispatched. This code won't be executed at all.
- sub index : SOAP('RPCEndpoint') {}
-
-=head1 DESCRIPTION
-
-SOAP Controller for Catalyst which we tried to make compatible with
-the way Catalyst works with URLS.
-
-It is important to notice that this controller declares by default an
-index operation which will dispatch the RPC operations under this
-class.
-
-=back
-
-=head1 ATTRIBUTES
-
-This class implements the SOAP attribute wich is used to do the
-mapping of that operation to the apropriate action class. The name of
-the class used is formed as Catalyst::Action::SOAP::$value, unless the
-parameter of the attribute starts with a '+', which implies complete
-namespace.
-
-The implementation of SOAP Action classes helps delivering specific
-SOAP scenarios, like HTTP GET, RPC Encoded, RPC Literal or Document
-Literal, or even Document RDF or just about any required combination.
-
-See L<Catalyst::Action::SOAP::DocLiteral> for an example.
-
-=head1 ACCESSORS
-
-Once you tagged one of the methods, you'll have an $c->stash->{soap}
-accessor which will return an C<Catalyst::Controller::SOAP::Helper>
-object. It's important to notice that this is achieved by the fact
-that all the SOAP Action classes are subclasses of
-Catalyst::Action::SOAP, which implements most of that.
-
-You can query this object as follows:
-
-=over 4
-
-=item $c->stash->{soap}->envelope()
-
-The original SOAP envelope as string.
-
-=item $c->stash->{soap}->parsed_envelope()
-
-The parsed envelope as an XML::DOM::XPath object.
-
-=item $c->stash->{soap}->arguments()
-
-The arguments of a RPC call.
-
-=item $c->stash->{soap}->error($c,[$code,$message])
-
-Allows you to set fault code and message
-
-=item $c->stash->{soap}->encoded_return(\@data)
-
-This method will prepare the return value to be a soap encoded data.
-
-=item $c->stash->{soap}->literal_return($xml_node)
-
-This method will prepare the return value to be a literal XML
-document, in this case, you can pass just the node that will be the
-root in the return message.
-
-=item $c->stash->{soap}->literal_string_return($xml_text)
-
-In this case, the argument is used literally inside the message. It is
-supposed to already contain all namespace definitions in it.
-
-=item $c->stash->{soap}->string_return($non_xml_text)
-
-In this case, the given text is encoded as CDATA inside the SOAP
-message.
-
-=back
-
-=head1 TODO
-
-At this moment, this is a very early release. So almost everything is
-still to be done. The only thing done right now is getting the body
-from the message and dispatching the correct method.
-
-=head1 SEE ALSO
-
-L<Catalyst::Action::SOAP>, L<XML::DOM::XPath>,
-L<Catalyst::Action::SOAP::DocLiteral>,
-L<Catalyst::Action::SOAP::RPCEncoded>,
-L<Catalyst::Action::SOAP::HTTPGet>
-
-=head1 AUTHORS
-
-Daniel Ruoso C<daniel.ruoso at verticalone.pt>
-
-=head1 BUG REPORTS
-
-Please submit all bugs regarding C<Catalyst::Controller::SOAP> to
-C<bug-catalyst-controller-soap at rt.cpan.org>
-
-=head1 LICENSE
-
-This library is free software, you can redistribute it and/or modify
-it under the same terms as Perl itself.
-
-=cut
Copied: Catalyst-Controller-SOAP/1.0/tags/0.0.6/lib/Catalyst/Controller/SOAP.pm (from rev 7173, Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst/Controller/SOAP.pm)
===================================================================
--- Catalyst-Controller-SOAP/1.0/tags/0.0.6/lib/Catalyst/Controller/SOAP.pm (rev 0)
+++ Catalyst-Controller-SOAP/1.0/tags/0.0.6/lib/Catalyst/Controller/SOAP.pm 2007-11-27 11:02:11 UTC (rev 7174)
@@ -0,0 +1,260 @@
+{ package Catalyst::Controller::SOAP;
+
+ use strict;
+ use base qw/Catalyst::Controller/;
+ use XML::LibXML;
+
+ use constant NS_SOAP_ENV => "http://www.w3.org/2003/05/soap-envelope";
+ our $VERSION = '0.0.6';
+
+ sub _parse_SOAP_attr {
+ my ($self, $c, $name, $value) = @_;
+ my $actionclass = ($value =~ /^\+/ ? $value :
+ 'Catalyst::Action::SOAP::'.$value);
+ (
+ ActionClass => $actionclass,
+ )
+ }
+
+ # this is implemented as to respond a SOAP message according to
+ # what has been sent to $c->stash->{soap}
+ sub end : Private {
+ my ($self, $c) = (shift, shift);
+ my $soap = $c->stash->{soap};
+
+ return $self->NEXT::end($c, @_) unless $soap;
+
+ my $response = XML::LibXML->createDocument();
+
+ my $envelope = $response->createElementNS
+ (NS_SOAP_ENV,"Envelope");
+
+ $response->setDocumentElement($envelope);
+
+ # TODO: we don't support header generation in response yet.
+
+ my $body = $response->createElementNS
+ (NS_SOAP_ENV,"Body");
+
+ $envelope->appendChild($body);
+
+ if ($soap->fault) {
+ my $fault = $response->createElementNS
+ (NS_SOAP_ENV, "Fault");
+ $body->appendChild($fault);
+
+ my $code = $response->createElementNS
+ (NS_SOAP_ENV, "Code");
+ $fault->appendChild($code);
+
+ $self->_generate_Fault_Code($response,$code,$soap->fault->{code});
+
+ if ($soap->fault->{reason}) {
+ my $reason = $response->createElementNS
+ (NS_SOAP_ENV, "Reason");
+ $fault->appendChild($reason);
+ # TODO: we don't support the xml:lang attribute yet.
+ my $text = $response->createElementNS
+ (NS_SOAP_ENV, "Text");
+ $reason->appendChild($text);
+ $text->appendText($soap->fault->{reason});
+ }
+ if ($soap->fault->{detail}) {
+ my $detail = $response->createElementNS
+ (NS_SOAP_ENV, "Detail");
+ $fault->appendChild($detail);
+ # TODO: we don't support the xml:lang attribute yet.
+ my $text = $response->createElementNS
+ (NS_SOAP_ENV, "Text");
+ $detail->appendChild($text);
+ $text->appendText($soap->fault->{detail});
+ }
+ } else {
+ # TODO: Generate the body.
+ # At this moment, for the sake of getting something ready,
+ # let's implement the string return.
+ if ($soap->string_return) {
+ $body->appendText($soap->string_return);
+ }
+ }
+
+ $c->res->body($envelope->toString());
+ }
+
+ sub _generate_Fault_Code {
+ my ($self, $document, $codenode, $codeValue) = @_;
+
+ my $value = $document->createElementNS
+ (NS_SOAP_ENV, "Value");
+ if (ref $codeValue eq 'ARRAY') {
+ $value->appendText($codeValue->[0]);
+ my $subcode = $document->createElementNS
+ (NS_SOAP_ENV, 'SubCode');
+ $codenode->appendChild($value);
+ $codenode->appendChild($subcode);
+ $self->_generate_Fault_Code($document, $subcode, $codeValue->[1]);
+ } else {
+ $value->appendText($codeValue);
+ $codenode->appendChild($value);
+ }
+ }
+
+
+};
+
+{ package Catalyst::Controller::SOAP::Helper;
+
+ use base qw(Class::Accessor::Fast);
+
+ __PACKAGE__->mk_accessors(qw{envelope parsed_envelope arguments fault
+ encoded_return literal_return
+ literal_string_return string_return});
+
+
+};
+
+1;
+
+__END__
+
+=head1 NAME
+
+Catalyst::Controller::SOAP - Catalyst SOAP Controller
+
+=head1 SYNOPSIS
+
+ package MyApp::Controller::Example;
+ use base 'Catalyst::Controller::SOAP';
+
+ # available in "/example" as operation "echo"
+ # parsing the arguments as soap-encoded.
+ sub echo : SOAP('RPCEncoded') {
+ my ( $self, $c, @args ) = @_;
+ }
+
+ # available in "/example" as operation "ping". The arguments are
+ # treated as a literal document and passed to the method as a
+ # XML::LibXML object
+ sub ping : SOAP('RPCLiteral') {
+ my ( $self, $c, $xml) = @_;
+ my $name = $xml->findValue('some xpath expression');
+ }
+
+ # avaiable as "/example/world" in document context. The entire body
+ # is delivered to the method as a XML::LibXML object.
+ sub world : SOAP('DocumentLiteral') {
+ my ($self, $c, $doc) = @_;
+ }
+
+ # this is the endpoint from where the RPC operations will be
+ # dispatched. This code won't be executed at all.
+ sub index : SOAP('RPCEndpoint') {}
+
+=head1 ABSTACT
+
+Implements SOAP serving support in Catalyst.
+
+=head1 DESCRIPTION
+
+SOAP Controller for Catalyst which we tried to make compatible with
+the way Catalyst works with URLS.It is important to notice that this
+controller declares by default an index operation which will dispatch
+the RPC operations under this class.
+
+=back
+
+=head1 ATTRIBUTES
+
+This class implements the SOAP attribute wich is used to do the
+mapping of that operation to the apropriate action class. The name of
+the class used is formed as Catalyst::Action::SOAP::$value, unless the
+parameter of the attribute starts with a '+', which implies complete
+namespace.
+
+The implementation of SOAP Action classes helps delivering specific
+SOAP scenarios, like HTTP GET, RPC Encoded, RPC Literal or Document
+Literal, or even Document RDF or just about any required combination.
+
+See L<Catalyst::Action::SOAP::DocumentLiteral> for an example.
+
+=head1 ACCESSORS
+
+Once you tagged one of the methods, you'll have an $c->stash->{soap}
+accessor which will return an C<Catalyst::Controller::SOAP::Helper>
+object. It's important to notice that this is achieved by the fact
+that all the SOAP Action classes are subclasses of
+Catalyst::Action::SOAP, which implements most of that.
+
+You can query this object as follows:
+
+=over 4
+
+=item $c->stash->{soap}->envelope()
+
+The original SOAP envelope as string.
+
+=item $c->stash->{soap}->parsed_envelope()
+
+The parsed envelope as an XML::LibXML object.
+
+=item $c->stash->{soap}->arguments()
+
+The arguments of a RPC call.
+
+=item $c->stash->{soap}->fault({code => $code,reason => $reason, detail => $detail])
+
+Allows you to set fault code and message. Optionally, you may define
+the code itself as an arrayref where the first item will be this code
+and the second will be the subcode, which recursively may be another
+arrayref.
+
+=item $c->stash->{soap}->encoded_return(\@data)
+
+This method will prepare the return value to be a soap encoded data.
+
+=item $c->stash->{soap}->literal_return($xml_node)
+
+This method will prepare the return value to be a literal XML
+document, in this case, you can pass just the node that will be the
+root in the return message.
+
+=item $c->stash->{soap}->literal_string_return($xml_text)
+
+In this case, the argument is used literally inside the message. It is
+supposed to already contain all namespace definitions in it.
+
+=item $c->stash->{soap}->string_return($non_xml_text)
+
+In this case, the given text is encoded as CDATA inside the SOAP
+message.
+
+=back
+
+=head1 TODO
+
+At this moment, this is a very early release. So almost everything is
+still to be done. The only thing done right now is getting the body
+from the message and dispatching the correct method.
+
+=head1 SEE ALSO
+
+L<Catalyst::Action::SOAP>, L<XML::LibXML>,
+L<Catalyst::Action::SOAP::DocumentLiteral>,
+L<Catalyst::Action::SOAP::RPCEncoded>,
+L<Catalyst::Action::SOAP::HTTPGet>
+
+=head1 AUTHORS
+
+Daniel Ruoso C<daniel.ruoso at verticalone.pt>
+
+=head1 BUG REPORTS
+
+Please submit all bugs regarding C<Catalyst::Controller::SOAP> to
+C<bug-catalyst-controller-soap at rt.cpan.org>
+
+=head1 LICENSE
+
+This library is free software, you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut
Copied: Catalyst-Controller-SOAP/1.0/tags/0.0.6/t (from rev 7165, Catalyst-Controller-SOAP/1.0/trunk/t)
Deleted: Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/Catalyst-Controller-SOAP.t
===================================================================
--- Catalyst-Controller-SOAP/1.0/trunk/t/Catalyst-Controller-SOAP.t 2007-11-27 10:48:51 UTC (rev 7165)
+++ Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/Catalyst-Controller-SOAP.t 2007-11-27 11:02:11 UTC (rev 7174)
@@ -1,15 +0,0 @@
-# Before `make install' is performed this script should be runnable with
-# `make test'. After `make install' it should work as `perl Catalyst-Controller-SOAP.t'
-
-#########################
-
-# change 'tests => 1' to 'tests => last_test_to_print';
-
-use Test::More tests => 1;
-BEGIN { use_ok('Catalyst::Controller::SOAP') };
-
-#########################
-
-# Insert your test code below, the Test::More module is use()ed here so read
-# its man page ( perldoc Test::More ) for help writing this test script.
-
Copied: Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/Catalyst-Controller-SOAP.t (from rev 7173, Catalyst-Controller-SOAP/1.0/trunk/t/Catalyst-Controller-SOAP.t)
===================================================================
--- Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/Catalyst-Controller-SOAP.t (rev 0)
+++ Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/Catalyst-Controller-SOAP.t 2007-11-27 11:02:11 UTC (rev 7174)
@@ -0,0 +1,10 @@
+use Test::More tests => 2;
+BEGIN { use_ok('Catalyst::Controller::SOAP') };
+use Catalyst::Action::SOAP::DocumentLiteral;
+use lib qw(t/lib);
+use Catalyst::Test 'TestApp';
+use Encode;
+
+my $response_content = get('/ws/foo?who=World');
+ok($response_content =~ /Hello World/, 'Hello World!');
+
Copied: Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp (from rev 7169, Catalyst-Controller-SOAP/1.0/trunk/t/PostApp)
Deleted: Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/Changes
===================================================================
--- Catalyst-Controller-SOAP/1.0/trunk/t/PostApp/Changes 2007-11-27 10:55:47 UTC (rev 7169)
+++ Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/Changes 2007-11-27 11:02:11 UTC (rev 7174)
@@ -1,4 +0,0 @@
-This file documents the revision history for Perl extension PostApp.
-
-0.01 2007-11-14 18:25:49
- - initial revision, generated by Catalyst
Deleted: Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/Makefile.PL
===================================================================
--- Catalyst-Controller-SOAP/1.0/trunk/t/PostApp/Makefile.PL 2007-11-27 10:55:47 UTC (rev 7169)
+++ Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/Makefile.PL 2007-11-27 11:02:11 UTC (rev 7174)
@@ -1,16 +0,0 @@
-use inc::Module::Install;
-
-name 'PostApp';
-all_from 'lib/PostApp.pm';
-
-requires 'Catalyst::Runtime' => '5.7011';
-requires 'Catalyst::Plugin::ConfigLoader';
-requires 'Catalyst::Plugin::Static::Simple';
-requires 'Catalyst::Action::RenderView';
-requires 'YAML'; # This should reflect the config file format you've chosen
- # See Catalyst::Plugin::ConfigLoader for supported formats
-catalyst;
-
-install_script glob('script/*.pl');
-auto_install;
-WriteAll;
Deleted: Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/README
===================================================================
--- Catalyst-Controller-SOAP/1.0/trunk/t/PostApp/README 2007-11-27 10:55:47 UTC (rev 7169)
+++ Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/README 2007-11-27 11:02:11 UTC (rev 7174)
@@ -1 +0,0 @@
-Run script/postapp_server.pl to test the application.
Deleted: Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/lib/PostApp/Controller/Root.pm
===================================================================
--- Catalyst-Controller-SOAP/1.0/trunk/t/PostApp/lib/PostApp/Controller/Root.pm 2007-11-27 10:55:47 UTC (rev 7169)
+++ Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/lib/PostApp/Controller/Root.pm 2007-11-27 11:02:11 UTC (rev 7174)
@@ -1,55 +0,0 @@
-package PostApp::Controller::Root;
-
-use strict;
-use warnings;
-use base 'Catalyst::Controller';
-
-#
-# Sets the actions in this controller to be registered with no prefix
-# so they function identically to actions created in MyApp.pm
-#
-__PACKAGE__->config->{namespace} = '';
-
-=head1 NAME
-
-PostApp::Controller::Root - Root Controller for PostApp
-
-=head1 DESCRIPTION
-
-[enter your description here]
-
-=head1 METHODS
-
-=cut
-
-=head2 default
-
-=cut
-
-sub default : Private {
- my ( $self, $c ) = @_;
-
- # Hello World
- $c->response->body( $c->welcome_message );
-}
-
-=head2 end
-
-Attempt to render a view, if needed.
-
-=cut
-
-sub end : ActionClass('RenderView') {}
-
-=head1 AUTHOR
-
-Daniel Ruoso,,,
-
-=head1 LICENSE
-
-This library is free software, you can redistribute it and/or modify
-it under the same terms as Perl itself.
-
-=cut
-
-1;
Copied: Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/lib/PostApp/Controller/Root.pm (from rev 7173, Catalyst-Controller-SOAP/1.0/trunk/t/PostApp/lib/PostApp/Controller/Root.pm)
===================================================================
--- Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/lib/PostApp/Controller/Root.pm (rev 0)
+++ Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/lib/PostApp/Controller/Root.pm 2007-11-27 11:02:11 UTC (rev 7174)
@@ -0,0 +1,10 @@
+package PostApp::Controller::Root;
+use strict;
+use warnings;
+use base 'Catalyst::Controller';
+__PACKAGE__->config->{namespace} = '';
+sub default : Private {
+ my ( $self, $c ) = @_;
+ $c->response->body( 'Unhandled message!' );
+}
+1;
Deleted: Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/lib/PostApp.pm
===================================================================
--- Catalyst-Controller-SOAP/1.0/trunk/t/PostApp/lib/PostApp.pm 2007-11-27 10:55:47 UTC (rev 7169)
+++ Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/lib/PostApp.pm 2007-11-27 11:02:11 UTC (rev 7174)
@@ -1,62 +0,0 @@
-package PostApp;
-
-use strict;
-use warnings;
-
-use Catalyst::Runtime '5.70';
-
-# Set flags and add plugins for the application
-#
-# -Debug: activates the debug mode for very useful log messages
-# ConfigLoader: will load the configuration from a YAML file in the
-# application's home directory
-# Static::Simple: will serve static files from the application's root
-# directory
-
-use Catalyst qw/-Debug ConfigLoader Static::Simple/;
-
-our $VERSION = '0.01';
-
-# Configure the application.
-#
-# Note that settings in postapp.yml (or other external
-# configuration file that you set up manually) take precedence
-# over this when using ConfigLoader. Thus configuration
-# details given here can function as a default configuration,
-# with a external configuration file acting as an override for
-# local deployment.
-
-__PACKAGE__->config( name => 'PostApp' );
-
-# Start the application
-__PACKAGE__->setup;
-
-
-=head1 NAME
-
-PostApp - Catalyst based application
-
-=head1 SYNOPSIS
-
- script/postapp_server.pl
-
-=head1 DESCRIPTION
-
-[enter your description here]
-
-=head1 SEE ALSO
-
-L<PostApp::Controller::Root>, L<Catalyst>
-
-=head1 AUTHOR
-
-Daniel Ruoso,,,
-
-=head1 LICENSE
-
-This library is free software, you can redistribute it and/or modify
-it under the same terms as Perl itself.
-
-=cut
-
-1;
Copied: Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/lib/PostApp.pm (from rev 7173, Catalyst-Controller-SOAP/1.0/trunk/t/PostApp/lib/PostApp.pm)
===================================================================
--- Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/lib/PostApp.pm (rev 0)
+++ Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/lib/PostApp.pm 2007-11-27 11:02:11 UTC (rev 7174)
@@ -0,0 +1,12 @@
+package PostApp;
+
+use strict;
+use warnings;
+
+use Catalyst::Runtime '5.70';
+use Catalyst qw/ConfigLoader Static::Simple/;
+our $VERSION = '0.01';
+__PACKAGE__->config( name => 'PostApp' );
+__PACKAGE__->setup;
+
+1;
Deleted: Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/root/favicon.ico
===================================================================
(Binary files differ)
Deleted: Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/root/static/images/btn_120x50_built.png
===================================================================
(Binary files differ)
Deleted: Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/root/static/images/btn_120x50_built_shadow.png
===================================================================
(Binary files differ)
Deleted: Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/root/static/images/btn_120x50_powered.png
===================================================================
(Binary files differ)
Deleted: Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/root/static/images/btn_120x50_powered_shadow.png
===================================================================
(Binary files differ)
Deleted: Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/root/static/images/btn_88x31_built.png
===================================================================
(Binary files differ)
Deleted: Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/root/static/images/btn_88x31_built_shadow.png
===================================================================
(Binary files differ)
Deleted: Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/root/static/images/btn_88x31_powered.png
===================================================================
(Binary files differ)
Deleted: Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/root/static/images/btn_88x31_powered_shadow.png
===================================================================
(Binary files differ)
Deleted: Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/root/static/images/catalyst_logo.png
===================================================================
(Binary files differ)
Deleted: Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/script/post.pl
===================================================================
--- Catalyst-Controller-SOAP/1.0/trunk/t/PostApp/script/post.pl 2007-11-27 10:55:47 UTC (rev 7169)
+++ Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/script/post.pl 2007-11-27 11:02:11 UTC (rev 7174)
@@ -1,38 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-
-use LWP::UserAgent;
-use HTTP::Request;
-use Encode;
-
-my $ua = LWP::UserAgent->new();
-
-my $message = <<SOAP;
-<Envelope xmlns="http://www.w3.org/2003/05/soap-envelope">
- <Body>World</Body>
-</Envelope>
-SOAP
-my $request = HTTP::Request->new('POST','http://localhost:3000/ws/hello');
-$request->content_type('application/soap+xml');
-$request->content_encoding('utf8');
-$request->content(encode_utf8($message));
-my $response = $ua->request($request);
-print "MENSAGEM 1============\n";
-print $response->content;
-print "======================\n";
-
-$message = <<SOAP;
-<Envelope xmlns="http://www.w3.org/2003/05/soap-envelope">
- <Body><hello>World</hello></Body>
-</Envelope>
-SOAP
-$request = HTTP::Request->new('POST','http://localhost:3000/ws2');
-$request->content_type('application/soap+xml');
-$request->content_encoding('utf8');
-$request->content(encode_utf8($message));
-$response = $ua->request($request);
-print "MENSAGEM 2============\n";
-print $response->content;
-print "======================\n";
Copied: Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/script/post.pl (from rev 7173, Catalyst-Controller-SOAP/1.0/trunk/t/PostApp/script/post.pl)
===================================================================
--- Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/script/post.pl (rev 0)
+++ Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/script/post.pl 2007-11-27 11:02:11 UTC (rev 7174)
@@ -0,0 +1,38 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use LWP::UserAgent;
+use HTTP::Request;
+use Encode;
+my $ua = LWP::UserAgent->new();
+print "REQUEST: =============\n";
+my $message = <<SOAP;
+<Envelope xmlns="http://www.w3.org/2003/05/soap-envelope">
+ <Body>World</Body>
+</Envelope>
+SOAP
+my $request = HTTP::Request->new('POST','http://localhost:3000/ws/hello');
+$request->content_type('application/soap+xml');
+$request->content_encoding('utf8');
+$request->content(encode_utf8($message));
+my $response = $ua->request($request);
+print "RESPONSE: ============\n";
+print $response->content;
+print "======================\n";
+
+__END__
+
+$message = <<SOAP;
+<Envelope xmlns="http://www.w3.org/2003/05/soap-envelope">
+ <Body><hello>World</hello></Body>
+</Envelope>
+SOAP
+$request = HTTP::Request->new('POST','http://localhost:3000/ws2');
+$request->content_type('application/soap+xml');
+$request->content_encoding('utf8');
+$request->content(encode_utf8($message));
+$response = $ua->request($request);
+print "MENSAGEM 2============\n";
+print $response->content;
+print "======================\n";
Deleted: Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/script/postapp_create.pl
===================================================================
--- Catalyst-Controller-SOAP/1.0/trunk/t/PostApp/script/postapp_create.pl 2007-11-27 10:55:47 UTC (rev 7169)
+++ Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/script/postapp_create.pl 2007-11-27 11:02:11 UTC (rev 7174)
@@ -1,75 +0,0 @@
-#!/usr/bin/perl -w
-
-use strict;
-use warnings;
-use Getopt::Long;
-use Pod::Usage;
-use Catalyst::Helper;
-
-my $force = 0;
-my $mech = 0;
-my $help = 0;
-
-GetOptions(
- 'nonew|force' => \$force,
- 'mech|mechanize' => \$mech,
- 'help|?' => \$help
- );
-
-pod2usage(1) if ( $help || !$ARGV[0] );
-
-my $helper = Catalyst::Helper->new( { '.newfiles' => !$force, mech => $mech } );
-
-pod2usage(1) unless $helper->mk_component( 'PostApp', @ARGV );
-
-1;
-
-=head1 NAME
-
-postapp_create.pl - Create a new Catalyst Component
-
-=head1 SYNOPSIS
-
-postapp_create.pl [options] model|view|controller name [helper] [options]
-
- Options:
- -force don't create a .new file where a file to be created exists
- -mechanize use Test::WWW::Mechanize::Catalyst for tests if available
- -help display this help and exits
-
- Examples:
- postapp_create.pl controller My::Controller
- postapp_create.pl controller My::Controller BindLex
- postapp_create.pl -mechanize controller My::Controller
- postapp_create.pl view My::View
- postapp_create.pl view MyView TT
- postapp_create.pl view TT TT
- postapp_create.pl model My::Model
- postapp_create.pl model SomeDB DBIC::Schema MyApp::Schema create=dynamic\
- dbi:SQLite:/tmp/my.db
- postapp_create.pl model AnotherDB DBIC::Schema MyApp::Schema create=static\
- dbi:Pg:dbname=foo root 4321
-
- See also:
- perldoc Catalyst::Manual
- perldoc Catalyst::Manual::Intro
-
-=head1 DESCRIPTION
-
-Create a new Catalyst Component.
-
-Existing component files are not overwritten. If any of the component files
-to be created already exist the file will be written with a '.new' suffix.
-This behavior can be suppressed with the C<-force> option.
-
-=head1 AUTHOR
-
-Sebastian Riedel, C<sri at oook.de>
-Maintained by the Catalyst Core Team.
-
-=head1 COPYRIGHT
-
-This library is free software, you can redistribute it and/or modify
-it under the same terms as Perl itself.
-
-=cut
Deleted: Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/script/postapp_fastcgi.pl
===================================================================
--- Catalyst-Controller-SOAP/1.0/trunk/t/PostApp/script/postapp_fastcgi.pl 2007-11-27 10:55:47 UTC (rev 7169)
+++ Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/script/postapp_fastcgi.pl 2007-11-27 11:02:11 UTC (rev 7174)
@@ -1,80 +0,0 @@
-#!/usr/bin/perl -w
-
-BEGIN { $ENV{CATALYST_ENGINE} ||= 'FastCGI' }
-
-use strict;
-use warnings;
-use Getopt::Long;
-use Pod::Usage;
-use FindBin;
-use lib "$FindBin::Bin/../lib";
-use PostApp;
-
-my $help = 0;
-my ( $listen, $nproc, $pidfile, $manager, $detach, $keep_stderr );
-
-GetOptions(
- 'help|?' => \$help,
- 'listen|l=s' => \$listen,
- 'nproc|n=i' => \$nproc,
- 'pidfile|p=s' => \$pidfile,
- 'manager|M=s' => \$manager,
- 'daemon|d' => \$detach,
- 'keeperr|e' => \$keep_stderr,
-);
-
-pod2usage(1) if $help;
-
-PostApp->run(
- $listen,
- { nproc => $nproc,
- pidfile => $pidfile,
- manager => $manager,
- detach => $detach,
- keep_stderr => $keep_stderr,
- }
-);
-
-1;
-
-=head1 NAME
-
-postapp_fastcgi.pl - Catalyst FastCGI
-
-=head1 SYNOPSIS
-
-postapp_fastcgi.pl [options]
-
- Options:
- -? -help display this help and exits
- -l -listen Socket path to listen on
- (defaults to standard input)
- can be HOST:PORT, :PORT or a
- filesystem path
- -n -nproc specify number of processes to keep
- to serve requests (defaults to 1,
- requires -listen)
- -p -pidfile specify filename for pid file
- (requires -listen)
- -d -daemon daemonize (requires -listen)
- -M -manager specify alternate process manager
- (FCGI::ProcManager sub-class)
- or empty string to disable
- -e -keeperr send error messages to STDOUT, not
- to the webserver
-
-=head1 DESCRIPTION
-
-Run a Catalyst application as fastcgi.
-
-=head1 AUTHOR
-
-Sebastian Riedel, C<sri at oook.de>
-Maintained by the Catalyst Core Team.
-
-=head1 COPYRIGHT
-
-This library is free software, you can redistribute it and/or modify
-it under the same terms as Perl itself.
-
-=cut
Deleted: Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/t/01app.t
===================================================================
--- Catalyst-Controller-SOAP/1.0/trunk/t/PostApp/t/01app.t 2007-11-27 10:55:47 UTC (rev 7169)
+++ Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/t/01app.t 2007-11-27 11:02:11 UTC (rev 7174)
@@ -1,7 +0,0 @@
-use strict;
-use warnings;
-use Test::More tests => 2;
-
-BEGIN { use_ok 'Catalyst::Test', 'PostApp' }
-
-ok( request('/')->is_success, 'Request should succeed' );
Deleted: Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/t/02pod.t
===================================================================
--- Catalyst-Controller-SOAP/1.0/trunk/t/PostApp/t/02pod.t 2007-11-27 10:55:47 UTC (rev 7169)
+++ Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/t/02pod.t 2007-11-27 11:02:11 UTC (rev 7174)
@@ -1,9 +0,0 @@
-use strict;
-use warnings;
-use Test::More;
-
-eval "use Test::Pod 1.14";
-plan skip_all => 'Test::Pod 1.14 required' if $@;
-plan skip_all => 'set TEST_POD to enable this test' unless $ENV{TEST_POD};
-
-all_pod_files_ok();
Deleted: Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/t/03podcoverage.t
===================================================================
--- Catalyst-Controller-SOAP/1.0/trunk/t/PostApp/t/03podcoverage.t 2007-11-27 10:55:47 UTC (rev 7169)
+++ Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/t/03podcoverage.t 2007-11-27 11:02:11 UTC (rev 7174)
@@ -1,9 +0,0 @@
-use strict;
-use warnings;
-use Test::More;
-
-eval "use Test::Pod::Coverage 1.04";
-plan skip_all => 'Test::Pod::Coverage 1.04 required' if $@;
-plan skip_all => 'set TEST_POD to enable this test' unless $ENV{TEST_POD};
-
-all_pod_coverage_ok();
Deleted: Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/t/controller_WS.t
===================================================================
--- Catalyst-Controller-SOAP/1.0/trunk/t/PostApp/t/controller_WS.t 2007-11-27 10:55:47 UTC (rev 7169)
+++ Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp/t/controller_WS.t 2007-11-27 11:02:11 UTC (rev 7174)
@@ -1,10 +0,0 @@
-use strict;
-use warnings;
-use Test::More tests => 3;
-
-BEGIN { use_ok 'Catalyst::Test', 'PostApp' }
-BEGIN { use_ok 'PostApp::Controller::WS' }
-
-ok( request('/ws')->is_success, 'Request should succeed' );
-
-
Copied: Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp.t (from rev 7173, Catalyst-Controller-SOAP/1.0/trunk/t/PostApp.t)
===================================================================
--- Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp.t (rev 0)
+++ Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/PostApp.t 2007-11-27 11:02:11 UTC (rev 7174)
@@ -0,0 +1,55 @@
+use Test::More tests => 2;
+use File::Spec::Functions;
+use HTTP::Response;
+use IPC::Open3;
+use Symbol;
+
+my $response;
+
+$response = soap_xml_post
+ ('/ws/hello',
+ '<Envelope><Body>World</Body></Envelope>'
+ );
+
+ok($response->content =~ /Hello World/, 'Document Literal correct response: '.$response->content);
+
+$response = soap_xml_post
+ ('/ws2',
+ '<Envelope><Body><hello>World</hello></Body></Envelope>'
+ );
+
+ok($response->content =~ /Hello World/, 'RPC Literal Correct response: '.$response->content);
+
+
+sub soap_xml_post {
+ my $path = shift;
+ my $content = shift;
+
+ local %ENV;
+ $ENV{REMOTE_ADDR} ='127.0.0.1';
+ $ENV{CONTENT_LENGTH} = length $content;
+ $ENV{CONTENT_TYPE} ='application/soap+xml';
+ $ENV{SCRIPT_NAME} = $path;
+ $ENV{QUERY_STRING} = '';
+ $ENV{CATALYST_DEBUG} = 0;
+ $ENV{REQUEST_METHOD} ='POST';
+ $ENV{SERVER_PORT} ='80';
+ $ENV{SERVER_NAME} ='pitombeira';
+
+ my ($writer, $reader, $error) = map { gensym() } 1..3;
+ my $pid = open3($writer, $reader, $error,
+ $^X, '-I'.catfile(qw(blib lib)), '-I'.catfile(qw(lib)), catfile(qw(t PostApp script postapp_cgi.pl)));
+
+ print {$writer} $content;
+ close $content;
+
+ my $response_str = join '', <$reader>;
+ map { warn '# '.$_ } <$error>;
+
+ close $reader;
+ close $error;
+ waitpid $pid, 0;
+ return HTTP::Response->parse($response_str);
+}
+
+1;
Copied: Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/lib (from rev 7168, Catalyst-Controller-SOAP/1.0/trunk/t/lib)
Deleted: Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/lib/TestApp/Controller/Root.pm
===================================================================
--- Catalyst-Controller-SOAP/1.0/trunk/t/lib/TestApp/Controller/Root.pm 2007-11-27 10:53:41 UTC (rev 7168)
+++ Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/lib/TestApp/Controller/Root.pm 2007-11-27 11:02:11 UTC (rev 7174)
@@ -1,16 +0,0 @@
-package TestApp::Controller::Root;
-
-use strict;
-use warnings;
-use base 'Catalyst::Controller';
-
-__PACKAGE__->config->{namespace} = '';
-
-sub default : Private {
- my ( $self, $c ) = @_;
- $c->response->body( 'default response' );
-}
-
-sub end : ActionClass('RenderView') {}
-
-1;
Copied: Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/lib/TestApp/Controller/Root.pm (from rev 7173, Catalyst-Controller-SOAP/1.0/trunk/t/lib/TestApp/Controller/Root.pm)
===================================================================
--- Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/lib/TestApp/Controller/Root.pm (rev 0)
+++ Catalyst-Controller-SOAP/1.0/tags/0.0.6/t/lib/TestApp/Controller/Root.pm 2007-11-27 11:02:11 UTC (rev 7174)
@@ -0,0 +1,14 @@
+package TestApp::Controller::Root;
+
+use strict;
+use warnings;
+use base 'Catalyst::Controller';
+
+__PACKAGE__->config->{namespace} = '';
+
+sub default : Private {
+ my ( $self, $c ) = @_;
+ $c->response->body( 'default response' );
+}
+
+1;
More information about the Catalyst-commits
mailing list