1#!/usr/bin/perl -w
2#######################################################################################
3#
4# 2_helloworld.t
5#
6# Acceptance test for message encoding, based on .NET wsdl and example code.
7# SOAP::WSDL's encoding doesn't I<exactly> match the .NET example, because
8# .NET doesn't always specify types (SOAP::WSDL does), and the namespace
9# prefixes chosen are different (maybe the encoding style, too ? this would be a bug !)
10#
11########################################################################################
12
13use strict;
14use Test::More tests => 4;
15use lib '../../../lib/';
16use File::Basename;
17use File::Spec;
18
19my $path = File::Spec->rel2abs( dirname __FILE__ );
20my ($volume, $dir) = File::Spec->splitpath($path, 1);
21my @dir_from = File::Spec->splitdir($dir);
22unshift @dir_from, $volume if $volume;
23my $url = join '/', @dir_from;
24
25use_ok q/SOAP::WSDL/;
26
27### test vars END
28print "# Testing SOAP::WSDL ". $SOAP::WSDL::VERSION."\n";
29print "# Acceptance test against sample output with simple WSDL\n";
30
31my $data = {
32    name => 'test',
33    givenName => 'test',
34};
35
36my $soap = undef;
37
38ok $soap = SOAP::WSDL->new(
39    wsdl => 'file://'.$url.'/../../acceptance/wsdl/11_helloworld.wsdl',
40    no_dispatch => 1
41), 'Create SOAP::WSDL object';
42
43# won't work without - would require SOAP::WSDL::Deserializer::SOM,
44# which requires SOAP::Lite
45$soap->outputxml(1);
46
47$soap->proxy('http://helloworld/helloworld.asmx');
48
49ok $soap->wsdlinit(
50    servicename => 'Service1',
51), 'wsdlinit';
52
53
54ok $soap->call('sayHello', 'sayHello' => $data), 'soap call';
55
56