# MarketSegment.pm package MarketSeg; # -- generated by SOAP::Lite (v0.60) for Perl -- soaplite.com -- Copyright (C) 2000-2001 Paul Kulchenko -- # -- generated from http://webservices.seek.com.au/marketsegment.asmx?wsdl [Tue Mar 8 15:31:24 2005] my %methods = ( GetMarketClassifiers => { endpoint => 'http://webservices.seek.com.au/marketsegment.asmx', soapaction => 'http://webservices.seek.com.au/GetMarketClassifiers', uri => '', parameters => [ SOAP::Data->new(name => 'marketSegment', type => '', attr => {}), ], }, ); use SOAP::Lite; use Exporter; use Carp (); use Data::Dumper; #use SOAP::Lite +trace => [ all, -transport ]; use vars qw(@ISA $AUTOLOAD @EXPORT_OK %EXPORT_TAGS); @ISA = qw(Exporter SOAP::Lite); @EXPORT_OK = (keys %methods); %EXPORT_TAGS = ('all' => [@EXPORT_OK]); no strict 'refs'; for my $method (@EXPORT_OK) { my %method = %{$methods{$method}}; *$method = sub { my $self = UNIVERSAL::isa($_[0] => __PACKAGE__) ? ref $_[0] ? shift # OBJECT # CLASS, either get self or create new and assign to self : (shift->self || __PACKAGE__->self(__PACKAGE__->new)) # function call, either get self or create new and assign to self : (__PACKAGE__->self || __PACKAGE__->self(__PACKAGE__->new)); $self->proxy($method{endpoint} || Carp::croak "No server address (proxy) specified") unless $self->proxy; my @templates = @{$method{parameters}}; my $som = $self -> endpoint($method{endpoint}) -> uri($method{uri}) -> on_action(sub{qq!"$method{soapaction}"!}) -> readable(1) # -> call($method => map {@templates ? shift(@templates)->value($_) : $_} @_); -> call( SOAP::Data->name($method)->attr({xmlns => 'http://webservices.seek.com.au'}) => map {@templates ? shift(@templates)->value($_) : $_} @_); #print "=====================SOM====================\n",Dumper($som),"\n========================/SOM=============\n"; #print "=====================freeform====================\n",Dumper($som->freeform),"\n========================/freeform=============\n"; if ($som->fault) { die "The unclef***ing SOAP failed again, bastard!\n" . $som->faultstring; } UNIVERSAL::isa($som => 'SOAP::SOM') ? wantarray ? $som->paramsall : $som->result : $som; } } sub AUTOLOAD { my $method = substr($AUTOLOAD, rindex($AUTOLOAD, '::') + 2); return if $method eq 'DESTROY'; die "Unrecognized method '$method'. List of available method(s): @EXPORT_OK\n"; } 1; #test.pl use MarketSeg; $soap = new MarketSeg; my $xml = MarketSeg::GetMarketClassifiers("Main"); use Data::Dumper; print Dumper($xml);