initial import of SOAP-WSDL from CPAN

git-cpan-module:   SOAP-WSDL
git-cpan-version:  
git-cpan-authorid: MKUTTER
git-cpan-file:     authors/id/M/MK/MKUTTER/SOAP-WSDL.tar.gz
This commit is contained in:
Martin Kutter
2004-07-09 01:18:07 -08:00
committed by Michael G. Schwern
commit f528d729f6
9 changed files with 1320 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
$Log: CHANGES,v $
Revision 1.6 2004/06/11 19:51:49 lsc
- changed expansion mode
Revision 1.5 2004/06/11 19:49:54 lsc
- moved .t files to more self-describing names
- changed WSDL.pm to accept AXIS wsdl files
- implemented XPath query result caching on all absolute queries
Revision 1.4 2004/06/11 12:12:20 lsc
CPAN preparation
Revision 1.3 2004/06/11 11:59:51 lsc
Test commit
+9
View File
@@ -0,0 +1,9 @@
t/1_performance.t
t/2_helloworld.NET.t
t/acceptance/helloworld.asmx.xml
t/acceptance/helloworld.xml
WSDL.pm
MANIFEST
README
CHANGES
Makefile.PL
+10
View File
@@ -0,0 +1,10 @@
#!/usr/bin/perl -w
use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
WriteMakefile(
'NAME' => 'SOAP::WSDL',
'VERSION_FROM' => 'WSDL.pm', # finds $VERSION
'PREREQ_PM' => { 'XML::XPath' => 0,
'SOAP::Lite' => 0 }
);
+29
View File
@@ -0,0 +1,29 @@
SOAP::WSDL - a WSDL-driven message preprocessor for SOAP::Lite.
DESCRIPTION
See "perldoc SOAP::WSDL" (or "perldoc WSDL.pm") for details.
PREREQUISITES
SOAP::WSDL requires the following perl modules:
- SOAP::Lite
- XML::XPath
INSTALLING
Use the usual mantra:
perl Makefile.PL
make
make test
make install
LICENSE
This library is free software, you can distribute it under the same
terms as perl itself.
+1045
View File
File diff suppressed because it is too large Load Diff
+47
View File
@@ -0,0 +1,47 @@
#!/usr/bin/perl -w
use strict;
use Test::More tests=> 7;
use Time::HiRes qw( gettimeofday tv_interval );
use lib '../..';
use Data::Dumper;
use_ok "SOAP::WSDL";
### test vars END
print "Testing SOAP::WSDL ". $SOAP::WSDL::VERSION."\n";
print "Performance test with simple WSDL file\n";
my $data = {
name => 'Mein Name',
givenName => 'Vorname'
};
my $t0 = [gettimeofday];
ok( my $soap=SOAP::WSDL->new(
wsdl => 'file:///home/lsc/eclipse3/workspace/SOAP/t/acceptance/helloworld.asmx.xml',
no_dispatch => 1
), "Create SOAP::WSDL object (".tv_interval ( $t0, [gettimeofday]) ."ms)" ); #->proxy('http://erlm5aqa.ww001.siemens.net/lasttest/helloworld/helloworld.asmx' );
$soap->proxy('http://erlm5aqa.ww001.siemens.net/lasttest/helloworld/helloworld.asmx');
$t0 = [gettimeofday];
ok($soap->wsdlinit(caching => 1), "wsdl file init (".tv_interval ( $t0, [gettimeofday]) ."s)" );;
$soap->readable(1);
$t0 = [gettimeofday];
ok( $soap->call("sayHello" , %{ $data }), "1 x call pre-work (".tv_interval ( $t0, [gettimeofday]) ."s)" );;
$t0 = [gettimeofday];
ok($soap->call(sayHello => %{ $data }), "1 x call pre-work (".tv_interval ( $t0, [gettimeofday]) ."s)" );;
$t0 = [gettimeofday];
for (my $i=1; $i<100; $i++) {
$soap->call(sayHello => %{ $data });
}
ok(1, "100 x call pre-work (".tv_interval ( $t0, [gettimeofday]) ."s)" );;
$soap->call(sayHello => %{ $data });
$t0 = [gettimeofday];
for (my $i=1; $i<100; $i++) {
$soap->call(sayHello => %{ $data });
}
ok(1, "100 x call pre-work (".tv_interval ( $t0, [gettimeofday]) ."s)" );;
+90
View File
@@ -0,0 +1,90 @@
#!/usr/bin/perl -w
#######################################################################################
#
# 2_helloworld.t
#
# Acceptance test for message encoding, based on .NET wsdl and example code.
# SOAP::WSDL's encoding doesn't I<exactly> match the .NET example, because
# .NET doesn't always specify types (SOAP::WSDL does), and the namespace
# prefixes chosen are different (maybe the encoding style, too ? this would be a bug !)
#
########################################################################################
use strict;
use diagnostics;
use Test::More tests => 5;
use Time::HiRes qw( gettimeofday tv_interval );
use lib '../..';
use_ok "SOAP::WSDL";
### test vars END
print "Testing SOAP::WSDL ". $SOAP::WSDL::VERSION."\n";
print "Acceptance test against sample output with simple WSDL\n";
my $data = {
name => 'test',
# givenName => 'GIVENNAME',
# test => {
# name => 'TESTNAME',
# givenName => 'GIVENNAME',
# },
# test1 => {
# name => 'TESTNAME',
# givenName => 'GIVENNAME',
# extend => 'EXTEND',
# },
# test2 => {
# name => 'TESTNAME',
# givenName => 'GIVENNAME',
# }
};
my $t0 = [gettimeofday];
my $dir=`pwd`;
chomp $dir;
$dir=~s/\/t//;
ok( my $soap=SOAP::WSDL->new(
wsdl => 'file:///'.$dir.'/t/acceptance/test.wsdl.xml',
no_dispatch => 1
), "Create SOAP::WSDL object (".tv_interval ( $t0, [gettimeofday]) ."s)" ); #->proxy('http://erlm5aqa.ww001.siemens.net/lasttest/helloworld/helloworld.asmx' );
$soap->proxy('http://erlm5aqa.ww001.siemens.net/lasttest/helloworld/helloworld.asmx');
$t0 = [gettimeofday];
ok($soap->wsdlinit(), "WSDL init (".tv_interval ( $t0, [gettimeofday]) ."s)") ;
$t0 = [gettimeofday];
do {
my $xml = $soap->serializer->method( $soap->call(sayHello => %{ $data }) );
open (FILE, "acceptance/helloworld.xml")
|| open (FILE, "t/acceptance/helloworld.xml") || die "can't open acceptance file";
my $xml_test=<FILE>;
close FILE;
$xml=~s/^.+\<([^\/]+?)\:Body\>//;
$xml=~s/\<\/$1\:Body\>.*//;
$xml_test=~s/^.+\<([^\/]+?)\:Body\>//;
$xml_test=~s/\<\/$1\:Body\>.*//;
if ( ($xml) && ($xml eq $xml_test) ) { pass ("Message encoding (" .tv_interval ( $t0, [gettimeofday]) ."s)") } else {
fail( "Message encoding (".tv_interval ( $t0, [gettimeofday]) ."s)") ;
print "$xml\n$xml_test\n"; };
};
$t0 = [gettimeofday];
do {
my $xml = $soap->serializer->method( $soap->call(sayHello => %{ $data }) );
open (FILE, "acceptance/helloworld.xml")
|| open FILE, ("t/acceptance/helloworld.xml") || die "can't open acceptance file";
my $xml_test=<FILE>;
close FILE;
$xml=~s/^.+\<([^\/]+?)\:Body\>//;
$xml=~s/\<\/$1\:Body\>.*//;
$xml_test=~s/^.+\<([^\/]+?)\:Body\>//;
$xml_test=~s/\<\/$1\:Body\>.*//;
if ( ($xml) && ($xml eq $xml_test) ) { pass ("Message encoding (" .tv_interval ( $t0, [gettimeofday]) ."s)") } else {
fail( "Message encoding (".tv_interval ( $t0, [gettimeofday]) ."s)") ;
print "$xml\n$xml_test\n"; };
};
+75
View File
@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="UTF-8"?>
<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:s0="urn:HelloWorld"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
targetNamespace="urn:HelloWorld"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<types>
<s:schema elementFormDefault="qualified"
targetNamespace="urn:HelloWorld">
<s:element name="sayHello">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="name"
type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="sayHelloResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1"
name="sayHelloResult" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</types>
<message name="sayHelloSoapIn">
<part name="parameters" element="s0:sayHello" />
</message>
<message name="sayHelloSoapOut">
<part name="parameters" element="s0:sayHelloResponse" />
</message>
<portType name="Service1Soap">
<operation name="sayHello">
<input message="s0:sayHelloSoapIn" />
<output message="s0:sayHelloSoapOut" />
</operation>
</portType>
<binding name="Service1Soap" type="s0:Service1Soap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document" />
<operation name="sayHello">
<soap:operation soapAction="urn:HelloWorld#sayHello"
style="document" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
</binding>
<service name="Service1">
<port name="Service1Soap" binding="s0:Service1Soap">
<soap:address
location="http://erlm5aqa.ww001.siemens.net/lasttest/helloworld/helloworld.asmx" />
</port>
</service>
</definitions>
+1
View File
@@ -0,0 +1 @@
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><sayHello xmlns="urn:HelloWorld"><name xsi:type="xsd:string">test</name></sayHello></soap:Body></soap:Envelope>