[Catalyst-commits] r13312 - in Catalyst-Model-SOAP/1.0/trunk: .
lib/Catalyst/Model t
ruoso at dev.catalyst.perl.org
ruoso at dev.catalyst.perl.org
Mon May 24 19:57:39 GMT 2010
Author: ruoso
Date: 2010-05-24 20:57:39 +0100 (Mon, 24 May 2010)
New Revision: 13312
Modified:
Catalyst-Model-SOAP/1.0/trunk/Makefile.PL
Catalyst-Model-SOAP/1.0/trunk/lib/Catalyst/Model/SOAP.pm
Catalyst-Model-SOAP/1.0/trunk/t/04_rpcliteral.t
Log:
[C-M-SOAP] XML::Compile::SOAP now produces a value with the operation $name."Response" value
Modified: Catalyst-Model-SOAP/1.0/trunk/Makefile.PL
===================================================================
--- Catalyst-Model-SOAP/1.0/trunk/Makefile.PL 2010-05-24 15:44:11 UTC (rev 13311)
+++ Catalyst-Model-SOAP/1.0/trunk/Makefile.PL 2010-05-24 19:57:39 UTC (rev 13312)
@@ -4,7 +4,7 @@
(
NAME => 'Catalyst::Model::SOAP',
VERSION_FROM => 'lib/Catalyst/Model/SOAP.pm',
- PREREQ_PM => { Catalyst::Runtime => 5.7011, XML::Compile::SOAP => 2.07,
+ PREREQ_PM => { Catalyst::Runtime => 5.7011, XML::Compile::SOAP => 2.14,
XML::Compile => 1.06, XML::LibXML => 1.70, Moose => 0.90 },
ABSTRACT_FROM => 'lib/Catalyst/Model/SOAP.pm',
AUTHOR => 'Daniel Ruoso <daniel at ruoso.com>',
Modified: Catalyst-Model-SOAP/1.0/trunk/lib/Catalyst/Model/SOAP.pm
===================================================================
--- Catalyst-Model-SOAP/1.0/trunk/lib/Catalyst/Model/SOAP.pm 2010-05-24 15:44:11 UTC (rev 13311)
+++ Catalyst-Model-SOAP/1.0/trunk/lib/Catalyst/Model/SOAP.pm 2010-05-24 19:57:39 UTC (rev 13312)
@@ -5,7 +5,7 @@
use XML::Compile::Util qw/pack_type/;
use List::Util qw/first/;
use base qw(Catalyst::Model);
- our $VERSION = '1.4';
+ our $VERSION = '1.5';
__PACKAGE__->mk_accessors('transport');
@@ -83,7 +83,9 @@
if ($style =~ /rpc/i) {
my $ret = $code->(@_);
if (exists $ret->{$name}) {
- return $ret->{$name};
+ return $ret->{$name};
+ } elsif (exists $ret->{$name.'Response'}) {
+ return $ret->{$name.'Response'};
} else {
return $ret;
}
Modified: Catalyst-Model-SOAP/1.0/trunk/t/04_rpcliteral.t
===================================================================
--- Catalyst-Model-SOAP/1.0/trunk/t/04_rpcliteral.t 2010-05-24 15:44:11 UTC (rev 13311)
+++ Catalyst-Model-SOAP/1.0/trunk/t/04_rpcliteral.t 2010-05-24 19:57:39 UTC (rev 13312)
@@ -9,6 +9,9 @@
use XML::LibXML;
my $parser = XML::LibXML->new();
+my $NS = 'http://example.com/hello';
+use XML::Compile::SOAP::Util ':soap11';
+my $soapenv = SOAP11ENV;
our $test_code;
{
package MyFooModel;
@@ -27,11 +30,18 @@
ok($message =~ /Hello|World/g, 'Output message contain parameters.');
return $parser->parse_string(<<SOAPMESSAGE);
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hello="http://example.com/hello"><SOAP-ENV:Body><hello:Greet><hello:greeting>Hello World!</hello:greeting></hello:Greet></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="$soapenv" xmlns:hello="$NS">
+ <SOAP-ENV:Body>
+ <hello:GreetResponse>
+ <hello:greeting>Hello, World!</hello:greeting>
+ </hello:GreetResponse>
+ </SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
SOAPMESSAGE
};
my $ret = MyFooModel::Bar::Baz->Greet
({ who => 'World', greeting => 'Hello' });
-is($ret->{greeting}, 'Hello World!', 'Output message processed!');
+is($ret->{greeting}, 'Hello, World!', 'Output message processed!');
More information about the Catalyst-commits
mailing list