[Catalyst-commits] r13209 - in Catalyst-Controller-SOAP/1.0/trunk: . lib/Catalyst/Action/SOAP lib/Catalyst/Controller t t/lib t/lib/TestApp2 t/lib/TestApp2/Controller

ruoso at dev.catalyst.perl.org ruoso at dev.catalyst.perl.org
Mon May 3 14:50:00 GMT 2010


Author: ruoso
Date: 2010-05-03 15:50:00 +0100 (Mon, 03 May 2010)
New Revision: 13209

Added:
   Catalyst-Controller-SOAP/1.0/trunk/t/lib/TestApp2.pm
   Catalyst-Controller-SOAP/1.0/trunk/t/lib/TestApp2/
   Catalyst-Controller-SOAP/1.0/trunk/t/lib/TestApp2/Controller/
   Catalyst-Controller-SOAP/1.0/trunk/t/lib/TestApp2/Controller/WS.pm
   Catalyst-Controller-SOAP/1.0/trunk/t/type-in-message.t
   Catalyst-Controller-SOAP/1.0/trunk/t/type-in-message.wsdl
Modified:
   Catalyst-Controller-SOAP/1.0/trunk/Makefile.PL
   Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst/Action/SOAP/RPCLiteral.pm
   Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst/Controller/SOAP.pm
Log:
[C-C-SOAP] Add a new test for type-based messages. Use MRO::Compat instead of Class::C3

Modified: Catalyst-Controller-SOAP/1.0/trunk/Makefile.PL
===================================================================
--- Catalyst-Controller-SOAP/1.0/trunk/Makefile.PL	2010-05-03 14:35:03 UTC (rev 13208)
+++ Catalyst-Controller-SOAP/1.0/trunk/Makefile.PL	2010-05-03 14:50:00 UTC (rev 13209)
@@ -5,7 +5,7 @@
 WriteMakefile(
     NAME              => 'Catalyst::Controller::SOAP',
     VERSION_FROM      => 'lib/Catalyst/Controller/SOAP.pm', # finds $VERSION
-    PREREQ_PM         => { Catalyst::Runtime => 5.7011, XML::LibXML => 0, Class::C3 => 0,
+    PREREQ_PM         => { Catalyst::Runtime => 5.7011, XML::LibXML => 0, MRO::Compat => 0,
                            XML::Compile::SOAP => 2.03
                           },
     ($] >= 5.005 ?     ## Add these new keywords supported since 5.005

Modified: Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst/Action/SOAP/RPCLiteral.pm
===================================================================
--- Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst/Action/SOAP/RPCLiteral.pm	2010-05-03 14:35:03 UTC (rev 13208)
+++ Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst/Action/SOAP/RPCLiteral.pm	2010-05-03 14:50:00 UTC (rev 13209)
@@ -1,7 +1,8 @@
 { package Catalyst::Action::SOAP::RPCLiteral;
 
   use base qw/Catalyst::Action::SOAP/;
-  use Class::C3;
+  use MRO::Compat;
+  use mro 'c3';
 
   sub execute {
       my $self = shift;

Modified: Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst/Controller/SOAP.pm
===================================================================
--- Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst/Controller/SOAP.pm	2010-05-03 14:35:03 UTC (rev 13208)
+++ Catalyst-Controller-SOAP/1.0/trunk/lib/Catalyst/Controller/SOAP.pm	2010-05-03 14:50:00 UTC (rev 13209)
@@ -6,13 +6,14 @@
     use XML::Compile::WSDL11;
     use XML::Compile::SOAP11;
     use UNIVERSAL qw(isa);
-    use Class::C3;
+    use MRO::Compat;
+    use mro 'c3';
     use Encode;
 
     use constant NS_SOAP_ENV => "http://schemas.xmlsoap.org/soap/envelope/";
     use constant NS_WSDLSOAP => "http://schemas.xmlsoap.org/wsdl/soap/";
 
-    our $VERSION = '1.19';
+    our $VERSION = '1.20';
 
     __PACKAGE__->mk_accessors qw(wsdl wsdlobj decoders encoders
          ports wsdlservice xml_compile soap_action_prefix rpc_endpoint_paths);

Added: Catalyst-Controller-SOAP/1.0/trunk/t/lib/TestApp2/Controller/WS.pm
===================================================================
--- Catalyst-Controller-SOAP/1.0/trunk/t/lib/TestApp2/Controller/WS.pm	                        (rev 0)
+++ Catalyst-Controller-SOAP/1.0/trunk/t/lib/TestApp2/Controller/WS.pm	2010-05-03 14:50:00 UTC (rev 13209)
@@ -0,0 +1,17 @@
+package TestApp2::Controller::WS;
+
+use strict;
+use warnings;
+use base 'Catalyst::Controller::SOAP';
+
+__PACKAGE__->config->{wsdl} = 't/hello.wsdl';
+
+sub Greet :WSDLPort('GreetPort') {
+    my ($self, $c, $args) = @_;
+    my $who = $args->{parameters}{who};
+    my $grt = $args->{parameters}{greeting};
+    my $num = $args->{parameters}{count};
+    $c->stash->{soap}->compile_return({ details => { greeting => $num.' '.$grt.' '.$who.'!'.(ref $num||'') }});
+}
+
+1;

Added: Catalyst-Controller-SOAP/1.0/trunk/t/lib/TestApp2.pm
===================================================================
--- Catalyst-Controller-SOAP/1.0/trunk/t/lib/TestApp2.pm	                        (rev 0)
+++ Catalyst-Controller-SOAP/1.0/trunk/t/lib/TestApp2.pm	2010-05-03 14:50:00 UTC (rev 13209)
@@ -0,0 +1,13 @@
+package TestApp2;
+
+use strict;
+use warnings;
+
+use Catalyst::Runtime;
+use Catalyst;
+
+our $VERSION = '0.01';
+__PACKAGE__->config( name => 'TestApp2' );
+__PACKAGE__->setup;
+
+1;

Added: Catalyst-Controller-SOAP/1.0/trunk/t/type-in-message.t
===================================================================
--- Catalyst-Controller-SOAP/1.0/trunk/t/type-in-message.t	                        (rev 0)
+++ Catalyst-Controller-SOAP/1.0/trunk/t/type-in-message.t	2010-05-03 14:50:00 UTC (rev 13209)
@@ -0,0 +1,32 @@
+use Test::More tests => 2;
+
+BEGIN { use_ok('Catalyst::Controller::SOAP') };
+use Catalyst::Action::SOAP::DocumentLiteral;
+use lib qw(t/lib);
+use Catalyst::Test 'TestApp2';
+use Encode;
+use HTTP::Request::Common;
+
+my $response = soap_xml_post('/hello',<<SOAPENV);
+   <Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
+      <Body>
+        <GreetingSpecifier xmlns="http://example.com/hello">
+          <who>World</who>
+          <greeting>Hello</greeting>
+          <count>1</count>
+        </GreetingSpecifier>
+      </Body>
+    </Envelope>
+SOAPENV
+
+like($response->content, qr/Hello World/, 'Hello World!');
+
+sub soap_xml_post {
+    my $path = shift;
+    my $content = shift;
+
+    return request POST $path, 
+        Content => $content,
+        Content_Type => 'application/soap+xml', 
+        SOAPAction => 'http://example.com/actions/Greet';
+}

Added: Catalyst-Controller-SOAP/1.0/trunk/t/type-in-message.wsdl
===================================================================
--- Catalyst-Controller-SOAP/1.0/trunk/t/type-in-message.wsdl	                        (rev 0)
+++ Catalyst-Controller-SOAP/1.0/trunk/t/type-in-message.wsdl	2010-05-03 14:50:00 UTC (rev 13209)
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions
+    xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
+    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+    xmlns:s="http://www.w3.org/2001/XMLSchema"
+    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+    xmlns:hello="http://example.com/hello"
+    xmlns="http://example.com/hello"
+    targetNamespace="http://example.com/hello">
+
+  <wsdl:types>
+    <s:schema elementFormDefault="qualified" targetNamespace="http://example.com/hello">
+      <s:complexType name="GreetingSpecifier">
+        <s:complexType>
+          <s:sequence>
+            <s:element minOccurs="0" maxOccurs="1" name="who" type="s:string"/>
+            <s:element minOccurs="0" maxOccurs="1" name="greeting" type="s:string"/>
+            <s:element minOccurs="0" maxOccurs="1" name="count" type="s:integer"/>
+          </s:sequence>
+        </s:complexType>
+      </s:element>
+      <s:complexType name="GreetingResponse">
+        <s:complexType>
+          <s:sequence>
+            <s:element minOccurs="0" maxOccurs="1" name="greeting" type="s:string"/>
+          </s:sequence>
+        </s:complexType>
+      </s:element>
+    </s:schema>
+  </wsdl:types>
+  <wsdl:message name="AskGreeting">
+    <wsdl:part name="parameters" type="hello:GreetingSpecifier"/>
+  </wsdl:message>
+  <wsdl:message name="GiveGreeting">
+    <wsdl:part name="details" type="hello:GreetingResponse"/>
+  </wsdl:message>
+  <wsdl:portType name="GreetingPort">
+    <wsdl:operation name="Greet">
+      <wsdl:input message="hello:AskGreeting"/>
+      <wsdl:output message="hello:GiveGreeting"/>
+    </wsdl:operation>
+  </wsdl:portType>
+  <wsdl:binding name="GreetingBind" type="hello:GreetingPort">
+    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+    <wsdl:operation name="Greet">
+      <soap:operation soapAction="http://example.com/" style="document"/>
+      <wsdl:input>
+        <soap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output>
+        <soap:body use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+  </wsdl:binding>
+  <wsdl:service name="GreetService">
+    <wsdl:port name="GreetPort" binding="hello:GreetingBind">
+      <soap:address location="http://localhost:3000/hello"/>
+    </wsdl:port>
+  </wsdl:service>
+</wsdl:definitions>




More information about the Catalyst-commits mailing list