If you look at the WSDL you will see that the response message is defined like:

<s:element name="GetMarketClassifiersResponse"> <s:complexType> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="GetMarketClas +sifiersResult"> <s:complexType mixed="true"> <s:sequence> <s:any /> </s:sequence> </s:complexType> </s:element> </s:sequence> </s:complexType> </s:element>
The problem with this is that the actual payload is therefore the <s:any /> - that is to say the designers punted on the definition and opted to say "we're going to return some XML of some sort" - it appears from the XML below that this is being generated from another system and not by the .NET serialization. This is not very useful and the stub created by stubmaker.pl is not going to deal with it well as it stands. Because this is an ASP.NET web service one is able to access it, for nstance, via an HTTP GET - you can see that it returns something like:
<SpecificClassification xmlns="http://seek.com.au/SpecificClassificati +on.xsd"> <list id="list-1" value="Location" multiSelect="false"> <listItem id="listItem-1000" value="Sydney" linking="listItem-2819 + listItem-2820 listItem-2821 listItem-2822 listItem-2835 listItem-283 +6 " legacyID="listItem-1000"> </listItem> </list> </SpecificClassification>
(I've removed most of the records for clarity.)

You could quite easily use LWP::UserAgent to retrieve the data as above and the use (e.g.) XML::Simple to access the data or you should be able to use SOAP::SOM directly, however there appears to be a bug somewhere that is stopping it from getting at the attributes, so I think that you probably want to use my first suggestion until it gets fixed.

You can access the attributes odf the listItem elements with something like:

use SOAP::Lite ; + my $client = SOAP::Lite ->readable(1) ->uri('http://webservices.seek.com.au') ->autotype(0) ->on_action(sub { join '/', @_ }) ->proxy('http://webservices.seek.com.au/marketsegment.a +smx'); $som = $client->GetMarketClassifiers(SOAP::Data->name('mark +etSegment','Main')->uri('http://webservices.seek.com.au')); + my $foo = $som->match('//GetMarketClassifiersResponse/SpecificClassifi +cation/list/'); + foreach my $item ($foo->dataof('//listItem/')) { print $item->attr->{id},"\n"; }
- it's just a matter of finding the right combination of SOAP::SOM and SOAP::Data munging.

update: It appears the bug was in my brain.

/J\


In reply to Re: SOAP::Lite? Erm, what the (censored) is the $som->result supposed to return? by gellyfish
in thread 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.