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

$VAR1 = { 'SpecificClassification' => { 'list' => { 'listItem' => '' } } };
Very helpfull, isn't it?

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.


In reply to SOAP::Lite? Erm, what the (censored) is the $som->result supposed to return? by Jenda

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.