File: 02_port.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 (40 lines) | stat: -rw-r--r-- 1,129 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
use Test::More tests => 10;
use strict;
use warnings;
use diagnostics;
use Cwd;
use lib '../lib';

use File::Basename;
use File::Spec;

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;

use_ok(qw/SOAP::WSDL/);

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

ok( ($soap->servicename('testService')  ), 'set service' );
ok( ($soap->portname('testPort2')  ) ,'set portname');
ok( $soap->wsdlinit(), 'parsed WSDL' );

ok( $soap->wsdlinit( servicename => 'testService', portname => 'testPort'), 'parsed WSDL' );

ok( ($soap->portname() eq 'testPort' ), 'found port passed to wsdlinit');

ok( $soap = SOAP::WSDL->new(
    wsdl => 'file://' . $url . '/../../acceptance/wsdl/02_port.wsdl'
), 'Instantiated object' );

ok( $soap->wsdlinit() );
$soap->outputxml(1);
eval { $soap->call('test') };
like $@, qr{type \s tns:testSimpleType1 \s , \s urn:simpleType \s not \s found}xms;