[Catalyst-commits] r10437 - Catalyst-Model-SOAP/1.0/trunk/t

ruoso at dev.catalyst.perl.org ruoso at dev.catalyst.perl.org
Fri Jun 5 20:39:59 GMT 2009


Author: ruoso
Date: 2009-06-05 20:39:59 +0000 (Fri, 05 Jun 2009)
New Revision: 10437

Added:
   Catalyst-Model-SOAP/1.0/trunk/t/06_docliteral_oneway.t
   Catalyst-Model-SOAP/1.0/trunk/t/hello5.wsdl
Log:
[C-M-SOAP] a test for one way document literal message

Added: Catalyst-Model-SOAP/1.0/trunk/t/06_docliteral_oneway.t
===================================================================
--- Catalyst-Model-SOAP/1.0/trunk/t/06_docliteral_oneway.t	                        (rev 0)
+++ Catalyst-Model-SOAP/1.0/trunk/t/06_docliteral_oneway.t	2009-06-05 20:39:59 UTC (rev 10437)
@@ -0,0 +1,33 @@
+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/hello5.wsdl', { GreetPort => '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 ''
+};
+my $ret = MyFooModel::Bar::Baz->Greet
+  ({ who => 'World', greeting => 'Hello' });
+is('', '', 'Output message processed!');

Added: Catalyst-Model-SOAP/1.0/trunk/t/hello5.wsdl
===================================================================
--- Catalyst-Model-SOAP/1.0/trunk/t/hello5.wsdl	                        (rev 0)
+++ Catalyst-Model-SOAP/1.0/trunk/t/hello5.wsdl	2009-06-05 20:39:59 UTC (rev 10437)
@@ -0,0 +1,46 @@
+<?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:schema>
+  </wsdl:types>
+  <wsdl:message name="AskGreeting">
+    <wsdl:part name="parameters" element="hello:GreetingSpecifier"/>
+  </wsdl:message>
+  <wsdl:portType name="GreetingPort">
+    <wsdl:operation name="Greet">
+      <wsdl:input message="hello:AskGreeting"/>
+    </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: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