Loading ...
Sorry, an error occurred while loading the content.

how to handle MS.net returning an array of strings?

Expand Messages
  • mdiplacido@yahoo.com
    this is what my MS.net server is returning: SOAP::Lite goes off and dumps the fetchUniqueUrlsForTodayResult result set into a hash using string as the keys.
    Message 1 of 3 , Aug 8 8:00 AM
    • 0 Attachment
      this is what my MS.net server is returning:

      SOAP::Lite goes off and dumps the fetchUniqueUrlsForTodayResult
      result set into a hash using 'string' as the keys. the last insert
      into the hash wins which gives me test2. how do i tell SOAP::Lite
      to make this an array (instead of a HASH) using the values between
      the <string></string> tags as the array element values?

      HTTP/1.1 200 OK
      Content-Type: text/xml; charset=utf-8
      Content-Length: length

      <?xml version="1.0" encoding="utf-8"?>
      <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Body>
      <fetchUniqueUrlsForTodayResponse xmlns="http://tempuri.org/">
      <fetchUniqueUrlsForTodayResult>
      <string>tesst</string>
      <string>test2</string>
      </fetchUniqueUrlsForTodayResult>
      </fetchUniqueUrlsForTodayResponse>
      </soap:Body>
      </soap:Envelope>
    • Paul Kulchenko
      Hi, mdiplacido! ... Very similar question was discussed just yesterday. Take a look there for more information and long explanation:
      Message 2 of 3 , Aug 8 8:11 AM
      • 0 Attachment
        Hi, mdiplacido!

        > into the hash wins which gives me test2. how do i tell SOAP::Lite
        > to make this an array (instead of a HASH) using the values between
        > the <string></string> tags as the array element values?
        Very similar question was discussed just yesterday. Take a look there
        for more information and long explanation:

        http://groups.yahoo.com/group/soaplite/message/746

        In your case you may do:

        my $som = SOAP::Lite->proxy(...)->uri(...)->fetchUniqueUrlsForToday;

        foreach ($som->valueof('//fetchUniqueUrlsForTodayResult/string')) {
        print "$_\n";
        }

        Hope it works for you.

        Best wishes, Paul.

        --- mdiplacido@... wrote:
        > this is what my MS.net server is returning:
        >
        > SOAP::Lite goes off and dumps the fetchUniqueUrlsForTodayResult
        > result set into a hash using 'string' as the keys. the last insert
        >
        > into the hash wins which gives me test2. how do i tell SOAP::Lite
        >
        > to make this an array (instead of a HASH) using the values between
        > the <string></string> tags as the array element values?
        >
        > HTTP/1.1 200 OK
        > Content-Type: text/xml; charset=utf-8
        > Content-Length: length
        >
        > <?xml version="1.0" encoding="utf-8"?>
        > <soap:Envelope
        > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        > xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
        > <soap:Body>
        > <fetchUniqueUrlsForTodayResponse xmlns="http://tempuri.org/">
        > <fetchUniqueUrlsForTodayResult>
        > <string>tesst</string>
        > <string>test2</string>
        > </fetchUniqueUrlsForTodayResult>
        > </fetchUniqueUrlsForTodayResponse>
        > </soap:Body>
        > </soap:Envelope>
        >
        >
        > ------------------------ Yahoo! Groups Sponsor
        >
        > To unsubscribe from this group, send an email to:
        > soaplite-unsubscribe@yahoogroups.com
        >
        >
        >
        > Your use of Yahoo! Groups is subject to
        > http://docs.yahoo.com/info/terms/
        >
        >


        __________________________________________________
        Do You Yahoo!?
        Make international calls for as low as $.04/minute with Yahoo! Messenger
        http://phonecard.yahoo.com/
      • mdiplacido@yahoo.com
        works perfectly! thanks! ... SOAP::Lite ... between ... there ... insert ... SOAP::Lite ... between ... Messenger
        Message 3 of 3 , Aug 8 9:25 AM
        • 0 Attachment
          works perfectly! thanks!

          --- In soaplite@y..., Paul Kulchenko <paulclinger@y...> wrote:
          > Hi, mdiplacido!
          >
          > > into the hash wins which gives me test2. how do i tell
          SOAP::Lite
          > > to make this an array (instead of a HASH) using the values
          between
          > > the <string></string> tags as the array element values?
          > Very similar question was discussed just yesterday. Take a look
          there
          > for more information and long explanation:
          >
          > http://groups.yahoo.com/group/soaplite/message/746
          >
          > In your case you may do:
          >
          > my $som = SOAP::Lite->proxy(...)->uri(...)->fetchUniqueUrlsForToday;
          >
          > foreach ($som->valueof('//fetchUniqueUrlsForTodayResult/string')) {
          > print "$_\n";
          > }
          >
          > Hope it works for you.
          >
          > Best wishes, Paul.
          >
          > --- mdiplacido@y... wrote:
          > > this is what my MS.net server is returning:
          > >
          > > SOAP::Lite goes off and dumps the fetchUniqueUrlsForTodayResult
          > > result set into a hash using 'string' as the keys. the last
          insert
          > >
          > > into the hash wins which gives me test2. how do i tell
          SOAP::Lite
          > >
          > > to make this an array (instead of a HASH) using the values
          between
          > > the <string></string> tags as the array element values?
          > >
          > > HTTP/1.1 200 OK
          > > Content-Type: text/xml; charset=utf-8
          > > Content-Length: length
          > >
          > > <?xml version="1.0" encoding="utf-8"?>
          > > <soap:Envelope
          > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          > > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
          > > xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
          > > <soap:Body>
          > > <fetchUniqueUrlsForTodayResponse xmlns="http://tempuri.org/">
          > > <fetchUniqueUrlsForTodayResult>
          > > <string>tesst</string>
          > > <string>test2</string>
          > > </fetchUniqueUrlsForTodayResult>
          > > </fetchUniqueUrlsForTodayResponse>
          > > </soap:Body>
          > > </soap:Envelope>
          > >
          > >
          > > ------------------------ Yahoo! Groups Sponsor
          > >
          > > To unsubscribe from this group, send an email to:
          > > soaplite-unsubscribe@y...
          > >
          > >
          > >
          > > Your use of Yahoo! Groups is subject to
          > > http://docs.yahoo.com/info/terms/
          > >
          > >
          >
          >
          > __________________________________________________
          > Do You Yahoo!?
          > Make international calls for as low as $.04/minute with Yahoo!
          Messenger
          > http://phonecard.yahoo.com/
        Your message has been successfully submitted and would be delivered to recipients shortly.