[r418]: trunk / t / 19-apachesoap.t  Maximize  Restore  History

Download this file

55 lines (42 with data), 1.3 kB

 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
#!/bin/env perl
use strict;
BEGIN {
unless(grep /blib/, @INC) {
chdir 't' if -d 't';
unshift @INC, '../lib' if -d '../lib';
}
}
use strict;
use Test;
use SOAP::Lite
on_fault => sub {
my $soap = shift;
my $res = shift;
ref $res ? warn(join "\n", "--- SOAP FAULT ---", $res->faultcode, $res->faultstring, '')
: warn(join "\n", "--- TRANSPORT ERROR ---", $soap->transport->status, '');
return new SOAP::SOM;
}
;
my($a, $s, $r, $serialized, $deserialized);
my $proxy = 'http://localhost:8080/soap/servlet/rpcrouter';
# ------------------------------------------------------
use SOAP::Test;
$s = SOAP::Lite->uri('http://something/somewhere')->proxy($proxy)->on_fault(sub{});
eval { $s->transport->timeout($SOAP::Test::TIMEOUT = $SOAP::Test::TIMEOUT) };
$r = $s->test_connection;
unless (defined $r && defined $r->envelope) {
print "1..0 # Skip: ", $s->transport->status, "\n";
exit;
}
# ------------------------------------------------------
plan tests => 2;
{
# Local server with Apache SOAP (http://xml.apache.org/soap)
print "Apache SOAP server test(s)...\n";
$s = SOAP::Lite
-> uri('urn:xmltoday-delayed-quotes')
-> proxy($proxy)
;
ok($s->getQuote('MSFT')->result > 0);
ok($s->getQuote(SOAP::Data->name(symbol => 'MSFT'))->result > 0);
}

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks