[Catalyst-commits] r7379 - in Catalyst-Controller-SOAP/1.0/trunk:
lib/Catalyst/Action lib/Catalyst/Action/SOAP
lib/Catalyst/Controller t
ruoso at dev.catalyst.perl.org
ruoso at dev.catalyst.perl.org
Sun Jan 13 13:50:44 GMT 2008
Author: ruoso
Date: 2008-01-13 13:50:43 +0000 (Sun, 13 Jan 2008)
New Revision: 7379
Modified:
Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst/Action/SOAP.pm
Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst/Action/SOAP/DocumentLiteral.pm
Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst/Action/SOAP/RPCEndpoint.pm
Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst/Controller/SOAP.pm
Catalyst-Controller-SOAP/1.0/trunk/t/PostApp.t
Log:
[C-C-SOAP] Using Namespace-aware lookup methods. Bump version to 0.1.2
Modified: Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst/Action/SOAP/DocumentLiteral.pm
===================================================================
--- Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst/Action/SOAP/DocumentLiteral.pm 2008-01-12 15:55:48 UTC (rev 7378)
+++ Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst/Action/SOAP/DocumentLiteral.pm 2008-01-13 13:50:43 UTC (rev 7379)
@@ -1,6 +1,7 @@
{ package Catalyst::Action::SOAP::DocumentLiteral;
use base qw/Catalyst::Action::SOAP/;
+ use constant NS_SOAP_ENV => "http://www.w3.org/2003/05/soap-envelope";
sub execute {
my $self = shift;
@@ -9,7 +10,7 @@
$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 ($body) = $envelope->getElementsByTagNameNS(NS_SOAP_ENV, 'Body');
$self->NEXT::execute($controller, $c, $body);
}
}
Modified: Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst/Action/SOAP/RPCEndpoint.pm
===================================================================
--- Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst/Action/SOAP/RPCEndpoint.pm 2008-01-12 15:55:48 UTC (rev 7378)
+++ Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst/Action/SOAP/RPCEndpoint.pm 2008-01-13 13:50:43 UTC (rev 7379)
@@ -1,6 +1,7 @@
{ package Catalyst::Action::SOAP::RPCEndpoint;
use base qw/Catalyst::Action::SOAP/;
+ use constant NS_SOAP_ENV => "http://www.w3.org/2003/05/soap-envelope";
sub execute {
my $self = shift;
@@ -10,7 +11,7 @@
$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 ($body) = $envelope->getElementsByTagNameNS(NS_SOAP_ENV,'Body',0);
my @children = $body->getChildNodes();
if (scalar @children != 1) {
$c->stash->{soap}->fault
Modified: Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst/Action/SOAP.pm
===================================================================
--- Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst/Action/SOAP.pm 2008-01-12 15:55:48 UTC (rev 7378)
+++ Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst/Action/SOAP.pm 2008-01-13 13:50:43 UTC (rev 7379)
@@ -19,7 +19,8 @@
sub prepare_soap_xml_post {
my ($self, $c) = @_;
- if ($c->req->content_type =~ /application\/soap\+xml/ &&
+ # This should be applocation/soap+xml, but some clients doesn't seem to respect that.
+ if ($c->req->content_type =~ /xml/ &&
$c->req->method eq 'POST') {
my $body = $c->req->body;
my $xml_str = join '', <$body>;
Modified: Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst/Controller/SOAP.pm
===================================================================
--- Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst/Controller/SOAP.pm 2008-01-12 15:55:48 UTC (rev 7378)
+++ Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst/Controller/SOAP.pm 2008-01-13 13:50:43 UTC (rev 7379)
@@ -5,7 +5,7 @@
use XML::LibXML;
use constant NS_SOAP_ENV => "http://www.w3.org/2003/05/soap-envelope";
- our $VERSION = '0.1.1';
+ our $VERSION = '0.1.2';
sub _parse_SOAP_attr {
my ($self, $c, $name, $value) = @_;
Modified: Catalyst-Controller-SOAP/1.0/trunk/t/PostApp.t
===================================================================
--- Catalyst-Controller-SOAP/1.0/trunk/t/PostApp.t 2008-01-12 15:55:48 UTC (rev 7378)
+++ Catalyst-Controller-SOAP/1.0/trunk/t/PostApp.t 2008-01-13 13:50:43 UTC (rev 7379)
@@ -8,20 +8,20 @@
$response = soap_xml_post
('/ws/hello',
- '<Envelope><Body>World</Body></Envelope>'
+ '<Envelope xmlns="http://www.w3.org/2003/05/soap-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>'
+ '<Envelope xmlns="http://www.w3.org/2003/05/soap-envelope"><Body><hello>World</hello></Body></Envelope>'
);
ok($response->content =~ /Hello World/, 'RPC Literal Correct response: '.$response->content);
$response = soap_xml_post
('/ws/foo',
- '<Envelope><Body>World</Body></Envelope>'
+ '<Envelope xmlns="http://www.w3.org/2003/05/soap-envelope"><Body>World</Body></Envelope>'
);
ok($response->content =~ /\<foo\>\<bar\>\<baz\>Hello World\!\<\/baz\>\<\/bar\>\<\/foo\>/, 'Literal response: '.$response->content);
More information about the Catalyst-commits
mailing list