OK, so there is some SOAP service on http://webservices.seek.com.au/marketsegment.asmx, if you go here and enter eg. "Main" into the inputbox and submit the form you can see the result. After wasting lots of time (as is to be expected with SOAP) I am able to send a request accepted by the service (ab)using SOAP::Lite and get this load of bull^B^B^B^BXML back. The test output from use SOAP::Lite +trace => [ all, -transport ]; looks correct, the print Dumper($som) looks about right as well. Or at least it seems to contain the data it's supposed to.
But print Dumper($som->result) prints just
Very helpfull, isn't it?$VAR1 = { 'SpecificClassification' => { 'list' => { 'listItem' => '' } } };
Here's the code:
# MarketSegment.pm package MarketSeg; # -- generated by SOAP::Lite (v0.60) for Perl -- soaplite.com -- Copyr +ight (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 sel +f : (__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://webse +rvices.seek.com.au'}) => map {@templates ? shift(@templates)->value($ +_) : $_} @_); #print "=====================SOM====================\n",Dumper($som)," +\n========================/SOM=============\n"; #print "=====================freeform====================\n",Dumper($s +om->freeform),"\n========================/freeform=============\n"; if ($som->fault) { die "The unclef***ing SOAP failed again, bastard!\n" . $som->f +aultstring; } 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): @EX +PORT_OK\n"; } 1; #test.pl use MarketSeg; $soap = new MarketSeg; my $xml = MarketSeg::GetMarketClassifiers("Main"); use Data::Dumper; print Dumper($xml);
So what am I supposed to use to get my dirty hands at the data? (Converting the misdesigned mess to something usefull is gonna be yet another fun.)
P.S.: I admit I did not sacrifice the chicken yet.
Jenda
| XML sucks. Badly. SOAP, on the other hand, is the most powerfull vacuum pump ever invented. |
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |