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

4458So fustrated returning hash that does not match XML results???

Expand Messages
  • dustintodd
    Mar 5, 2005
    • 0 Attachment
      I am trying to accessing the XML results below. I expected the results
      to be array of hashes based on my reading. But it appears to be a hash
      of hashes. I have include the raw XML results, a portion of the code
      I use to access it and the program run results. I have tried a number
      of different approaches and example code without getting the results I
      want. Can anyone see what I am doing wrong?

      - Dustin -

      <?xml version="1.0" encoding="UTF-8"?>
      <getTableMetadataReturn xsi:type="ns1:TableMetadata">
      <columns xsi:type="ns1:TableColumn">
      <name xsi:type="xsd:string">CWVLWLANNUCASTKEYINDEX</name>
      <type xsi:type="xsd:string">INTEGER</type>
      <columns xsi:type="ns1:TableColumn">
      <name xsi:type="xsd:string">CWVLWLANNUCASTKEYLEN</name>
      <type xsi:type="xsd:string">INTEGER</type>
      <columns xsi:type="ns1:TableColumn">
      <name xsi:type="xsd:string">CWVLWLANNUCASTKEYVALUE</name>
      <type xsi:type="xsd:string">VARCHAR</type>
      <columns xsi:type="ns1:TableColumn">
      <name xsi:type="xsd:string">VLANID</name>
      <type xsi:type="xsd:string">INTEGER</type>

      Code to print out results

      my $tablemeta = SOAP::Lite
      -> proxy('http://XXXX:XXXXXX@')
      -> uri('urn:com.cisco.nm.wlse.xmlapi.inventory')
      -> on_debug(sub{print@_})
      -> getTableMetadata($tlisting);

      if ($tablemeta->fault) {
      print $tablemeta->faultcode, " ", $tablemeta->faultstring, "\n",
      $tablemeta->faultdetail, "\n";
      } else {
      my $tablemetawork = $tablemeta->result;
      for my $k1 ( keys %$tablemetawork ) {
      print "k1: $k1\n";
      for my $k2 ( keys %{$tablemetawork->{ $k1 }} ) {
      print "$k1: $k2 $tablemetawork->{ $k1 }{ $k2 }\n";

      Portion of output
      k1: columns
      columns: name VLANID
      columns: type INTEGER
    • Show all 2 messages in this topic