File: 03_complexType-sequence.t

package info (click to toggle)
libsoap-wsdl-perl 3.004-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,600 kB
  • sloc: perl: 8,433; xml: 1,769; java: 19; makefile: 15
file content (80 lines) | stat: -rw-r--r-- 1,740 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
BEGIN {
    use Test::More tests => 6;
    use lib '../lib';
    use lib 't/lib';
    use lib 'lib';
    use Cwd;
    use File::Basename;
    
    our $SKIP;
    eval "use Test::SOAPMessage";
    if ($@)
    {
		$SKIP = "Test::Differences required for testing. $@";
	}
}

use_ok(qw/SOAP::WSDL/);

my $xml;

my $path = File::Spec->rel2abs( dirname __FILE__ );
my ($volume, $dir) = File::Spec->splitpath($path, 1);
my @dir_from = File::Spec->splitdir($dir);
unshift @dir_from, $volume if $volume;
my $url = join '/', @dir_from;

#2
ok( $soap = SOAP::WSDL->new(
	wsdl => 'file://' . $url . '/../../acceptance/wsdl/03_complexType-sequence.wsdl'
), 'Instantiated object' );

#3
ok( $soap->wsdlinit(
	checkoccurs => 1,
	servicename => 'testService',
), 'parsed WSDL' );
$soap->no_dispatch(1);

# won't work without - would require SOAP::WSDL::Deserializer::SOM,
# which requires SOAP::Lite
$soap->outputxml(1);


#4
ok $xml = $soap->call('test', 
	testSequence => {
		Test1 => 'Test 1',
		Test2 => 'Test 2',
	}
), 'Serialized complexType';

TODO: {
    local $TODO = "not implemented yet";
    #5
    eval 
    { 
            $xml = $soap->call('test', 
                            testSequence => {
                                    Test1 => 'Test 1',
                            }
                    );
    };
    ok( ($@),
            "Died on illegal number of elements"
    );
    
    #6
    eval 
    { 
            $xml = $soap->call('test', 
                            testSequence => {
                                    Test1 => 'Test 1',
                                    Test2 => [ 1, 2, 3, ]
                            }
                    ); 
    };
    ok( ($@),
            "Died on illegal number of elements"
    );
};