[Catalyst-commits] r7628 - in Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst: Action/SOAP Controller

drew at dev.catalyst.perl.org drew at dev.catalyst.perl.org
Wed Apr 23 16:29:40 BST 2008


Author: drew
Date: 2008-04-23 16:29:40 +0100 (Wed, 23 Apr 2008)
New Revision: 7628

Modified:
   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
Log:
Added logging of incoming and outgoing XML messages.


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-04-22 20:46:12 UTC (rev 7627)
+++ Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst/Action/SOAP/DocumentLiteral.pm	2008-04-23 15:29:40 UTC (rev 7628)
@@ -12,6 +12,7 @@
           my $envelope = $c->stash->{soap}->parsed_envelope;
           my $namespace = $c->stash->{soap}->namespace || NS_SOAP_ENV;
           my ($body) = $envelope->getElementsByTagNameNS($namespace, 'Body');
+          $c->log->debug("Incoming XML: " . $body->toString);
           my $operation = $self->name;
           $c->stash->{soap}->operation_name($operation);
           eval {

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-04-22 20:46:12 UTC (rev 7627)
+++ Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst/Action/SOAP/RPCEndpoint.pm	2008-04-23 15:29:40 UTC (rev 7628)
@@ -15,6 +15,7 @@
           my $envelope = $c->stash->{soap}->parsed_envelope;
           my $namespace = $c->stash->{soap}->namespace || NS_SOAP_ENV;
           my ($body) = $envelope->getElementsByTagNameNS($namespace,'Body',0);
+          $c->log->debug("Incoming XML: " . $body->toString);
           my @children = grep { UNIVERSAL::isa( $_, 'XML::LibXML::Element') } $body->getChildNodes();
           if (scalar @children != 1) {
               $c->stash->{soap}->fault

Modified: Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst/Controller/SOAP.pm
===================================================================
--- Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst/Controller/SOAP.pm	2008-04-22 20:46:12 UTC (rev 7627)
+++ Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst/Controller/SOAP.pm	2008-04-23 15:29:40 UTC (rev 7628)
@@ -287,9 +287,6 @@
                 $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);
             } elsif (my $lit = $soap->literal_return) {
@@ -305,10 +302,11 @@
                   unless $self->wsdlobj;
 
                 my $arr = $self->encoders->{$soap->operation_name}->($response, $cmp);
-                $body->appendChild($_) for @{$arr};
+                $body->appendChild($_) for @$arr;
             }
         }
 
+        $c->log->debug("Outgoing XML: ".$envelope->toString());
         $c->res->content_type('text/xml');
         $c->res->body($envelope->toString());
     }




More information about the Catalyst-commits mailing list