[Catalyst-commits] r9693 - in Catalyst-Model-SOAP/1.0/trunk: . lib/Catalyst/Model t t/lib

ruoso at dev.catalyst.perl.org ruoso at dev.catalyst.perl.org
Mon Apr 13 21:00:52 GMT 2009


Author: ruoso
Date: 2009-04-13 22:00:52 +0100 (Mon, 13 Apr 2009)
New Revision: 9693

Added:
   Catalyst-Model-SOAP/1.0/trunk/t/02_docliteral.t
   Catalyst-Model-SOAP/1.0/trunk/t/03_docliteral_multipart.t
   Catalyst-Model-SOAP/1.0/trunk/t/04_rpcliteral.t
   Catalyst-Model-SOAP/1.0/trunk/t/hello.wsdl
   Catalyst-Model-SOAP/1.0/trunk/t/hello2.wsdl
   Catalyst-Model-SOAP/1.0/trunk/t/hello3.wsdl
   Catalyst-Model-SOAP/1.0/trunk/t/hello4.wsdl
   Catalyst-Model-SOAP/1.0/trunk/t/lib/TestTransport.pm
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/01_basics.t
Log:
[C-M-SOAP] now we work with the latest XML::Compile::SOAP

Modified: Catalyst-Model-SOAP/1.0/trunk/Makefile.PL
===================================================================
--- Catalyst-Model-SOAP/1.0/trunk/Makefile.PL	2009-04-13 15:00:32 UTC (rev 9692)
+++ Catalyst-Model-SOAP/1.0/trunk/Makefile.PL	2009-04-13 21:00:52 UTC (rev 9693)
@@ -4,7 +4,8 @@
   (
    NAME              => 'Catalyst::Model::SOAP',
    VERSION_FROM      => 'lib/Catalyst/Model/SOAP.pm',
-   PREREQ_PM         => { Catalyst::Runtime => 5.7011, XML::Compile::SOAP => 0 },
+   PREREQ_PM         => { Catalyst::Runtime => 5.7011, XML::Compile::SOAP => 2.04,
+                          XML::Compile => 1.03 },
    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	2009-04-13 15:00:32 UTC (rev 9692)
+++ Catalyst-Model-SOAP/1.0/trunk/lib/Catalyst/Model/SOAP.pm	2009-04-13 21:00:52 UTC (rev 9693)
@@ -5,7 +5,7 @@
     use XML::Compile::Util qw/pack_type/;
     use List::Util qw/first/;
     use base qw(Catalyst::Model);
-    our $VERSION = '0.0.7';
+    our $VERSION = '0.0.8';
 
 
     __PACKAGE__->mk_accessors('transport');
@@ -52,119 +52,66 @@
                 no strict 'refs';
                 @{$realtarget.'::ISA'} = qw(Catalyst::Model::SOAP::Instance);
 
-                my $serv = $wsdl_obj->find(service => $service)
+                my $serv = $wsdl_obj->findDef(service => $service)
                   or die 'Could not find service '.$service;
-                my @ports = @{$serv->{port} || []};
+                my @ports = @{$serv->{wsdl_port} || []};
                 my $port = first {$_->{name} eq $portname } @ports
                   or die 'Could not find port '.$portname;
                 my $bindname = $port->{binding}
                   or die 'Could not find binding for port '.$portname;
-                my $binding = $wsdl_obj->find(binding => $bindname)
+                my $binding = $wsdl_obj->findDef(binding => $bindname)
                   or die 'Could not find binding '.$bindname;
                 my $porttypename = $binding->{type}
                   or die 'Could not find portType for binding '.$bindname;
-                my $portType = $wsdl_obj->find(portType => $porttypename)
-                  or die 'Could not find portType '.$porttypename;
-                my $operations = $portType->{operation}
-                  or die 'No operations found for portType '.$porttypename;
+                my $operations = $binding->{wsdl_operation}
+                  or die 'No operations found for binding '.$bindname;
 
 
                 for my $operationhash (@$operations) {
                     my $operation = $wsdl_obj->operation(service => $service,
                                                          port => $portname,
+                                                         binding => $bindname,
+                                                         portType => $porttypename,
                                                          operation => $operationhash->{name});
-
-                    my $style = $binding->{'{'.NS_WSDLSOAP.'}binding'}[0]->getAttribute('style');
-                    my $proto = $binding->{'{'.NS_WSDLSOAP.'}binding'}[0]->getAttribute('transport');
-
-                    my ($use) = map { $_->{input}{'{'.NS_WSDLSOAP.'}body'}[0]->getAttribute('use') }
-                      grep { $_->{name} eq $operation->name } @{ $binding->{operation} || [] };
-
-                    $style = $style =~ /document/i ? 'document' : 'rpc';
-                    $use = $use =~ /literal/i ? 'literal' : 'encoded';
-
-                    $operation->{style} = $style;
-
-                    $self->_register_operation($wsdl_obj, $operation, $realtarget, $transport, $style, $use, $proto);
+                    $self->_register_operation($wsdl_obj, $operation, $realtarget, $transport);
                 }
 
-            }
+              }
         } else {
             my $realtarget = $self.'::'.$target;
             no strict 'refs';
             @{$realtarget.'::ISA'} = qw(Catalyst::Model::SOAP::Instance);
-            foreach my $operation ($wsdl_obj->operations(produce => 'OBJECTS')) {
-                $self->_register_operation($wsdl_obj, $operation,$realtarget,$transport,'','');
+            foreach my $operation ($wsdl_obj->operations()) {
+                $self->_register_operation($wsdl_obj, $operation, $realtarget, $transport);
             }
         }
     }
     sub _register_operation {
-        my ($self, $wsdl_obj, $operation, $realtarget, $transport, $style, $use, $proto) = @_;
+        my ($self, $wsdl_obj, $operation, $realtarget, $transport) = @_;
         no strict 'refs';
         my $send;
         if ($transport) {
             $send = $transport->compileClient(kind => $operation->kind);
         }
 
-        my ($rpcin, $rpcout);
-        if ($style =~ /rpc/i && $use =~ /literal/i) {
-            my $portop = $operation->portOperation();
+        my $code = $operation->compileClient($send ? ( transport => $send ) : ());
 
-            if ($portop->{input}{message}) {
-                my $input_parts = $wsdl_obj->find(message => $portop->{input}{message})
-                  ->{part};
+        my $name = $operation->name();
+        my $style = $operation->style;
+        my $use = $operation->{input_def}{body}{use};
 
-                for (@{$input_parts}) {
-                    my $type = $_->{type} ? $_->{type} : $_->{element};
-                    $_->{compiled_writer} = $wsdl_obj->schemas->compile
-                      (WRITER => $type, elements_qualified => 'ALL');
-                };
-
-                $rpcin = sub {
-                    my ($doc, $data) = @_;
-                    my $operation_element = $doc->createElement($operation->name);
-                    my @parts =
-                      map {
-                          $_->{compiled_writer}->($doc, $data->{$_->{name}})
-                      } @{$input_parts};
-                    $operation_element->appendChild($_)
-                      for grep { ref $_ } @parts;
-                    return $operation_element;
-                };
-            }
-
-            if ($portop->{output}{message}) {
-                my $output_parts = $wsdl_obj->find(message => $portop->{output}{message})
-                  ->{part};
-                for (@{$output_parts}) {
-                    my $type = $_->{type} ? $_->{type} : $_->{element};
-                    $_->{compiled_reader} = $wsdl_obj->schemas->compile
-                      (READER => $type);
-                }
-
-
-                $rpcout = sub {
-                    my $soap = shift;
-                    my @nodes = grep { UNIVERSAL::isa($_, 'XML::LibXML::Element') } @_;
-                    return
-                      {
-                       map {
-                           my $data = $_->{compiled_reader}->(shift @nodes);
-                           ( $_->{name} => $data )
-                       } @{$output_parts}
-                      };
-                };
-            }
-
-        }
-
-        my $code = $operation->compileClient($send ? ( transport => $send ) : (),
-                                             rpcin => $rpcout,
-                                             rpcout => $rpcin,
-                                             protocol => $proto);
         *{$realtarget.'::'.$operation->name()} = sub {
             my $self = shift;
-            return $code->(@_);
+            if ($style =~ /rpc/i) {
+              my $ret = $code->(@_);
+              if (exists $ret->{$name}) {
+                return $ret->{$name};
+              } else {
+                return $ret;
+              }
+            } else {
+              return $code->(@_);
+            }
         };
         *{$realtarget.'::_'.$operation->name().'_data'} = sub {
             return ($wsdl_obj, $operation, $code);
@@ -175,31 +122,6 @@
     use strict;
     use warnings;
     use base qw(Catalyst::Model);
-}
-
-
-{   use XML::Compile::Schema::BuiltInTypes;
-    package
-      # avoid being indexed...
-      XML::Compile::Schema::BuiltInTypes;
-
-    $XML::Compile::Schema::BuiltInTypes::builtin_types{QName}{parse} =
-     sub { my ($qname, $node) = @_;
-           my $prefix = $qname =~ s/^([^:]*)\:// ? $1 : '';
-
-           $node = $node->node if $node->isa('XML::Compile::Iterator');
-
-           unless ($prefix) {
-               return pack_type($node->namespaceURI, $qname);
-           }
-
-           my $ns = $node->lookupNamespaceURI($prefix)
-               or error __x"cannot find prefix `{prefix}' for QNAME `{qname}'"
-                     , prefix => $prefix, qname => $qname;
-           pack_type $ns, $qname;
-         };
-
-
 };
 
 

Modified: Catalyst-Model-SOAP/1.0/trunk/t/01_basics.t
===================================================================
--- Catalyst-Model-SOAP/1.0/trunk/t/01_basics.t	2009-04-13 15:00:32 UTC (rev 9692)
+++ Catalyst-Model-SOAP/1.0/trunk/t/01_basics.t	2009-04-13 21:00:52 UTC (rev 9693)
@@ -1,15 +1,16 @@
 
-use Test::More tests => 9;
+use Test::More tests => 5;
 use Symbol;
+use XML::Compile;
+use XML::Compile::Transport::SOAPHTTP;
 BEGIN { use_ok('Catalyst::Model::SOAP') };
 
 use lib 't/lib/';
-use MyXMLModule;
 
 {
     package MyFooModel;
     use base qw(Catalyst::Model::SOAP);
-    __PACKAGE__->register_wsdl('http://foo.bar/baz.wsdl', 'Bar::Baz');
+    __PACKAGE__->register_wsdl('t/hello.wsdl', 'Bar::Baz');
 };
 
 {
@@ -21,10 +22,5 @@
 
 ok(defined @MyFooModel::Bar::Baz::ISA, 'Loading the wsdl pre-registers the class.');
 is(MyFooModel::Bar::Baz->foo(), 'ok', 'The dynamic class isa Catalyst::Model::SOAP::Instance.');
-ok(defined &MyFooModel::Bar::Baz::op1, 'Loading the wsdl pre-registers the method.');
-ok(defined &MyFooModel::Bar::Baz::_op1_data, 'Loading the wsdl pre-register the helper-method');
-is(MyFooModel::Bar::Baz->op1, 'op1', 'The method calls the coderef.');
-my @data = MyFooModel::Bar::Baz->_op1_data();
-is(ref $data[0], 'MyXML::WSDL11', 'The first element in the data is the wsdl object');
-is(ref $data[1], 'MyXML::Operation', 'The second element in the data is the operation object');
-is(ref $data[2], 'CODE', 'The third element in the data is the code reference');
+ok(defined &MyFooModel::Bar::Baz::Greet, 'Loading the wsdl pre-registers the method.');
+ok(defined &MyFooModel::Bar::Baz::_Greet_data, 'Loading the wsdl pre-register the helper-method');

Added: Catalyst-Model-SOAP/1.0/trunk/t/02_docliteral.t
===================================================================
--- Catalyst-Model-SOAP/1.0/trunk/t/02_docliteral.t	                        (rev 0)
+++ Catalyst-Model-SOAP/1.0/trunk/t/02_docliteral.t	2009-04-13 21:00:52 UTC (rev 9693)
@@ -0,0 +1,35 @@
+use Test::More tests => 3;
+use Symbol;
+use XML::Compile;
+use XML::Compile::Transport::SOAPHTTP;
+BEGIN { use_ok('Catalyst::Model::SOAP') };
+
+use lib 't/lib/';
+use TestTransport;
+
+use XML::LibXML;
+my $parser = XML::LibXML->new();
+our $test_code;
+{
+  package MyFooModel;
+  use base qw(Catalyst::Model::SOAP);
+  __PACKAGE__->config->{transport} =
+    TestTransport->new
+      (sub {
+         return $test_code->(@_);
+       });
+  __PACKAGE__->register_wsdl('t/hello.wsdl', 'Bar::Baz');
+};
+
+# now we check if the body is consistent
+$test_code = sub {
+  my $message = shift->toString;
+  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/"><Body><hello:GreetingResponse xmlns:hello="http://example.com/hello"><hello:greeting>Hello World!</hello:greeting></hello:GreetingResponse></Body></SOAP-ENV:Envelope>
+SOAPMESSAGE
+};
+my $ret = MyFooModel::Bar::Baz->Greet
+  ({ parameters => { who => 'World', greeting => 'Hello' }});
+
+is($ret->{details}{greeting}, 'Hello World!', 'Output message processed!');

Added: Catalyst-Model-SOAP/1.0/trunk/t/03_docliteral_multipart.t
===================================================================
--- Catalyst-Model-SOAP/1.0/trunk/t/03_docliteral_multipart.t	                        (rev 0)
+++ Catalyst-Model-SOAP/1.0/trunk/t/03_docliteral_multipart.t	2009-04-13 21:00:52 UTC (rev 9693)
@@ -0,0 +1,38 @@
+use Test::More tests => 3, todo => 3;
+use Symbol;
+use XML::Compile;
+use XML::Compile::Transport::SOAPHTTP;
+BEGIN { use_ok('Catalyst::Model::SOAP') };
+
+use lib 't/lib/';
+use TestTransport;
+
+use XML::LibXML;
+my $parser = XML::LibXML->new();
+our $test_code;
+{
+  package MyFooModel;
+  use base qw(Catalyst::Model::SOAP);
+  __PACKAGE__->config->{transport} =
+    TestTransport->new
+      (sub {
+         return $test_code->(@_);
+       });
+  __PACKAGE__->register_wsdl('t/hello.wsdl', 'Bar::Baz');
+};
+
+# now we check if the body is consistent
+$test_code = sub {
+  my $message = shift->toString;
+  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/"><Body><hello:greeting xmlns:hello="http://example.com/hello">Hello World!</hello:greeting></Body></SOAP-ENV:Envelope>
+SOAPMESSAGE
+};
+my $ret = MyFooModel::Bar::Baz->Greet
+  ({ who => 'World', greeting => 'Hello' });
+
+TODO: {
+  local $TODO = 'Some bug in XML::Compile here.';
+  is($ret->{greeting}, 'Hello World!', 'Output message processed!');
+}

Added: Catalyst-Model-SOAP/1.0/trunk/t/04_rpcliteral.t
===================================================================
--- Catalyst-Model-SOAP/1.0/trunk/t/04_rpcliteral.t	                        (rev 0)
+++ Catalyst-Model-SOAP/1.0/trunk/t/04_rpcliteral.t	2009-04-13 21:00:52 UTC (rev 9693)
@@ -0,0 +1,37 @@
+use Test::More tests => 3, todo => 3;
+use Symbol;
+use XML::Compile;
+use XML::Compile::Transport::SOAPHTTP;
+BEGIN { use_ok('Catalyst::Model::SOAP') };
+
+use lib 't/lib/';
+use TestTransport;
+
+use XML::LibXML;
+my $parser = XML::LibXML->new();
+our $test_code;
+{
+  package MyFooModel;
+  use base qw(Catalyst::Model::SOAP);
+  __PACKAGE__->config->{transport} =
+    TestTransport->new
+      (sub {
+         return $test_code->(@_);
+       });
+  __PACKAGE__->register_wsdl('t/hello4.wsdl', { Greet => 'Bar::Baz' });
+};
+
+# now we check if the body is consistent
+$test_code = sub {
+  my $message = shift->toString;
+  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/"><Body><Greet><hello:greeting xmlns:hello="http://example.com/hello">Hello World!</hello:greeting></Greet></Body></SOAP-ENV:Envelope>
+SOAPMESSAGE
+
+};
+my $ret = MyFooModel::Bar::Baz->Greet
+  ({ who => 'World', greeting => 'Hello' });
+
+is($ret->{greeting}, 'Hello World!', 'Output message processed!');

Added: Catalyst-Model-SOAP/1.0/trunk/t/hello.wsdl
===================================================================
--- Catalyst-Model-SOAP/1.0/trunk/t/hello.wsdl	                        (rev 0)
+++ Catalyst-Model-SOAP/1.0/trunk/t/hello.wsdl	2009-04-13 21:00:52 UTC (rev 9693)
@@ -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:element 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:element 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" element="hello:GreetingSpecifier"/>
+  </wsdl:message>
+  <wsdl:message name="GiveGreeting">
+    <wsdl:part name="details" element="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>

Added: Catalyst-Model-SOAP/1.0/trunk/t/hello2.wsdl
===================================================================
--- Catalyst-Model-SOAP/1.0/trunk/t/hello2.wsdl	                        (rev 0)
+++ Catalyst-Model-SOAP/1.0/trunk/t/hello2.wsdl	2009-04-13 21:00:52 UTC (rev 9693)
@@ -0,0 +1,49 @@
+<?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: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:schema>
+  </wsdl:types>
+  <wsdl:message name="AskGreeting">
+    <wsdl:part name="who" element="hello:who"/>
+    <wsdl:part name="greeting" element="hello:greeting"/>
+    <wsdl:part name="count" element="hello:count"/>
+  </wsdl:message>
+  <wsdl:message name="GiveGreeting">
+    <wsdl:part name="greeting" element="hello:greeting"/>
+  </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="rpc"/>
+    <wsdl:operation name="Greet">
+      <soap:operation soapAction="http://example.com/" />
+      <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>
\ No newline at end of file

Added: Catalyst-Model-SOAP/1.0/trunk/t/hello3.wsdl
===================================================================
--- Catalyst-Model-SOAP/1.0/trunk/t/hello3.wsdl	                        (rev 0)
+++ Catalyst-Model-SOAP/1.0/trunk/t/hello3.wsdl	2009-04-13 21:00:52 UTC (rev 9693)
@@ -0,0 +1,80 @@
+<?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:element 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:sequence>
+        </s:complexType>
+      </s:element>
+      <s:element 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" element="hello:GreetingSpecifier"/>
+  </wsdl:message>
+  <wsdl:message name="GiveGreeting">
+    <wsdl:part name="details" element="hello:GreetingResponse"/>
+  </wsdl:message>
+  <wsdl:portType name="Greeting">
+    <wsdl:operation name="Greet">
+      <wsdl:input message="hello:AskGreeting"/>
+      <wsdl:output message="hello:GiveGreeting"/>
+    </wsdl:operation>
+  </wsdl:portType>
+  <wsdl:portType name="Shouting">
+    <wsdl:operation name="Shout">
+      <wsdl:input message="hello:AskGreeting"/>
+      <wsdl:output message="hello:GiveGreeting"/>
+    </wsdl:operation>
+  </wsdl:portType>
+  <wsdl:binding name="Greeting" type="hello:Greeting">
+    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+    <wsdl:operation name="Greet">
+      <soap:operation style="document"/>
+      <wsdl:input>
+        <soap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output>
+        <soap:body use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+  </wsdl:binding>
+  <wsdl:binding name="Shouting" type="hello:Shouting">
+    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+    <wsdl:operation name="Shout">
+      <soap:operation 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="Greet">
+    <wsdl:port name="Greet" binding="hello:Greeting">
+      <soap:address location="http://localhost:3000/hello/Greet"/>
+    </wsdl:port>
+    <wsdl:port name="Shout" binding="hello:Shouting">
+      <soap:address location="http://localhost:3000/hello/Shout"/>
+    </wsdl:port>
+  </wsdl:service>
+</wsdl:definitions>
\ No newline at end of file

Added: Catalyst-Model-SOAP/1.0/trunk/t/hello4.wsdl
===================================================================
--- Catalyst-Model-SOAP/1.0/trunk/t/hello4.wsdl	                        (rev 0)
+++ Catalyst-Model-SOAP/1.0/trunk/t/hello4.wsdl	2009-04-13 21:00:52 UTC (rev 9693)
@@ -0,0 +1,58 @@
+<?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:element minOccurs="0" maxOccurs="1" name="who" type="s:string"/>
+      <s:element minOccurs="0" maxOccurs="1" name="greeting" type="s:string"/>
+    </s:schema>
+  </wsdl:types>
+  <wsdl:message name="AskGreeting">
+    <wsdl:part name="who" element="hello:who"/>
+    <wsdl:part name="greeting" element="hello:greeting"/>
+  </wsdl:message>
+  <wsdl:message name="GiveGreeting">
+    <wsdl:part name="greeting" element="hello:greeting"/>
+  </wsdl:message>
+  <wsdl:portType name="Greeting">
+    <wsdl:operation name="Greet">
+      <wsdl:input message="hello:AskGreeting"/>
+      <wsdl:output message="hello:GiveGreeting"/>
+    </wsdl:operation>
+    <wsdl:operation name="Shout">
+      <wsdl:input message="hello:AskGreeting"/>
+      <wsdl:output message="hello:GiveGreeting"/>
+    </wsdl:operation>
+  </wsdl:portType>
+  <wsdl:binding name="Greeting" type="hello:Greeting">
+    <soap:binding transport="http://jabber.org/protocol/soap" style="rpc"/>
+    <wsdl:operation name="Greet">
+      <wsdl:input>
+        <soap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output>
+        <soap:body use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+    <wsdl:operation name="Shout">
+      <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="Greet" binding="hello:Greeting">
+      <soap:address location="http://localhost:3000/rpcliteral/"/>
+    </wsdl:port>
+  </wsdl:service>
+</wsdl:definitions>

Added: Catalyst-Model-SOAP/1.0/trunk/t/lib/TestTransport.pm
===================================================================
--- Catalyst-Model-SOAP/1.0/trunk/t/lib/TestTransport.pm	                        (rev 0)
+++ Catalyst-Model-SOAP/1.0/trunk/t/lib/TestTransport.pm	2009-04-13 21:00:52 UTC (rev 9693)
@@ -0,0 +1,16 @@
+package TestTransport;
+
+use strict;
+use warnings;
+use base qw(XML::Compile::Transport);
+
+sub new {
+  my ($class, $code) = @_;
+  return bless \$code, $class;
+}
+
+sub compileClient {
+  ${shift()};
+}
+
+1;




More information about the Catalyst-commits mailing list