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

6336Cannot encode unnamed element as 'hash'. Will be encoded as 'map' instead

Expand Messages
  • rsvancara
    Jun 11, 2009
      I have created a very basic soap service that returns a hash of hashes. When I call my soap service, I see this in the apache error logs for every request I make.

      Cannot encode unnamed element as 'hash'. Will be encoded as 'map' instead

      Here is my code in a perl object method that returs the hash of hashes.

      sub getJobList {

      my $self = shift;

      # Get the result of the output
      my $result = `/usr/bin/qstat -f`;

      # An array that contains all the lines of the result
      my @result_array = split(/\n/,$result);

      # Hash to store all the jobs
      my %result_hash = ();

      # temporary hash to store attributes for a job
      my %temp_hash =();

      my $i = 1;

      my $jobid = 0;

      foreach my $line (@result_array){

      #Each job section is seperated by jobid
      #Iterate through the list and look for these "Job Id" lines

      #if($i > 0){
      #$result_hash{$i} = \%temp_hash;

      my @jobid_array = split(/:/,$line);
      #$jobid = $jobid_array[1];

      $jobid_array[1] =~s/^\s//;
      $jobid = $jobid_array[1];

      #$temp_hash{'jobid'} = $jobid_array[1];
      $result_hash{$jobid}{'jobid'} = $jobid;

      # Job State, C for completed Q for queued
      my @jobstate_array = split(/=/,$line);
      #$temp_hash{'job_state'} = $jobstate_array[1];
      $jobstate_array[1] =~s/^\s//;
      $result_hash{$jobid}{'job_state'} = $jobstate_array[1];

      return \%result_hash;

      Here is the is my webservice cgi that uses the object method described above:

      #!/usr/bin/perl -w

      use strict;
      use grid::Grid;

      use SOAP::Transport::HTTP

      -> dispatch_to('grid::Grid')
      -> handle;

      So what can I do to eliminate this error.