[Catalyst-commits] r10477 - in Catalyst-Controller-SOAP/1.0/trunk:
lib/Catalyst/Action lib/Catalyst/Controller t
ruoso at dev.catalyst.perl.org
ruoso at dev.catalyst.perl.org
Mon Jun 8 21:19:39 GMT 2009
Author: ruoso
Date: 2009-06-08 21:19:38 +0000 (Mon, 08 Jun 2009)
New Revision: 10477
Modified:
Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst/Action/SOAP.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] dont set error 500 with SOAP Fault, setting 500 means a transport fault, not a processing fault.
[C-C-SOAP] applies patch from kmx
Modified: Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst/Action/SOAP.pm
===================================================================
--- Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst/Action/SOAP.pm 2009-06-07 16:36:31 UTC (rev 10476)
+++ Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst/Action/SOAP.pm 2009-06-08 21:19:38 UTC (rev 10477)
@@ -24,7 +24,7 @@
$c->req->method eq 'POST') {
my $body = $c->req->body;
my $xml_str = ref $body ? (join '', <$body>) : $body;
- $c->log->debug("Incoming XML: $xml_str");
+ $c->log->debug("Incoming XML: $xml_str") if $c->debug;
eval {
$c->stash->{soap}->envelope($xml_str);
$c->stash->{soap}->parsed_envelope($self->xml_parser->parse_string($xml_str));
Modified: Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst/Controller/SOAP.pm
===================================================================
--- Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst/Controller/SOAP.pm 2009-06-07 16:36:31 UTC (rev 10476)
+++ Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst/Controller/SOAP.pm 2009-06-08 21:19:38 UTC (rev 10477)
@@ -12,7 +12,7 @@
use constant NS_SOAP_ENV => "http://schemas.xmlsoap.org/soap/envelope/";
use constant NS_WSDLSOAP => "http://schemas.xmlsoap.org/wsdl/soap/";
- our $VERSION = '1.17';
+ our $VERSION = '1.18';
__PACKAGE__->mk_accessors qw(wsdl wsdlobj decoders encoders
ports wsdlservice xml_compile soap_action_prefix rpc_endpoint_paths);
@@ -389,7 +389,6 @@
}
if ($envelope) {
- $c->res->status(500) if $soap->fault;
$c->log->debug("Outgoing XML: ".$envelope->toString()) if $c->debug;
$c->res->content_type('text/xml; charset=UTF-8');
$c->res->body(encode('utf8',$envelope->toString()));
Modified: Catalyst-Controller-SOAP/1.0/trunk/t/PostApp.t
===================================================================
--- Catalyst-Controller-SOAP/1.0/trunk/t/PostApp.t 2009-06-07 16:36:31 UTC (rev 10476)
+++ Catalyst-Controller-SOAP/1.0/trunk/t/PostApp.t 2009-06-08 21:19:38 UTC (rev 10477)
@@ -1,8 +1,9 @@
+use strict;
+use warnings;
use Test::More tests => 16;
-use File::Spec::Functions;
-use HTTP::Response;
-use IPC::Open3;
-use Symbol;
+use lib 't/PostApp/lib';
+use Catalyst::Test 'PostApp';
+use HTTP::Request::Common;
my $response;
@@ -152,33 +153,10 @@
my $path = shift;
my $content = shift;
- local %ENV = %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} = 1;
- $ENV{REQUEST_METHOD} ='POST';
- $ENV{SERVER_PORT} ='80';
- $ENV{SERVER_NAME} ='pitombeira';
- $ENV{HTTP_SOAPAction} = 'http://example.com/actions/Greet';
-
- my ($writer, $reader, $error) = map { gensym() } 1..3;
- my $pid = open3($writer, $reader, $error,
- $^X, (map { '-I'.$_ } @INC),
- 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);
+ return request POST $path,
+ Content => $content,
+ Content_Type => 'application/soap+xml',
+ SOAPAction => 'http://example.com/actions/Greet';
}
1;
More information about the Catalyst-commits
mailing list