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

2414General Perl ? related to SOAP::Lite

Expand Messages
  • Fallin Jonathan
    Feb 25, 2003
    • 0 Attachment
      This is a more general Perl Question related to using
      SOAP::Lite. I am calling a method against a WSDL that
      returns an object of type "Codes" as defined in the
      WSDL. SOAP::Lite generates the correct SOAP request
      and gets back the correct SOAP response which is then
      apparantly marsheled into a Perl object via the WSDL
      definition. So far so good. I have dumped the
      $result from the method call using DATA::Dumper and
      have attached the output to this post. All of the
      data I want is in there, I just can't seem to get at
      it. Here's the Perl Code.

      use SOAP::Lite;
      use Data::Dumper;

      my $soap = SOAP::Lite


      my $result = $soap->getCodes(\SOAP::Data->value(
      SOAP::Data->type("string")->name("userGuid" =>

      => "AirClic_US***"),

      => "Wombat Inc")
      SOAP::Data->type("string")->name("ticket" =>

      print OUT Dumper($result);

      Referring to the Perl Data Object from the attached
      Document (CodesObject.txt), these calls work

      print $result->{deviceId}; #Prints "0" //This is
      print $result->{deviceType}; #Prints "1" //This is

      And these calls retrieve their respective nested array
      of objects

      @services = $result->{services}; //array of objects
      for key="services"
      @codes = $result->{codes}; //array of objects for

      But if I try and get the value located at line #76 for
      example ('code' => '55') I keep getting undefined
      values back.

      From above, @codes should be an array of size 2 but
      length(@codes) gives me 1 (not two)

      I've tried

      @codes = $result->{codes};
      $value = $codes[0]->{scan}->{code};

      But $value comes back as undefined.

      How do I traverse the object returned by the WSDL
      method? How do I get the value located on line # 76?

      Jonathan Fallin
      1705 37th St NW
      Washington DC 20007

      Do you Yahoo!?
      Yahoo! Tax Center - forms, calculators, tips, more