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

2595Re: valueof usage help needed

Expand Messages
  • Alberto Accomazzi
    May 7, 2003
    • 0 Attachment
      From what I can tell if you give SOAP::Lite a WSDL file to instantiate
      your SOAP object, it will deserialize the response into a hash (rather
      than returning a SOAP::SOM object). My guess is that this is a
      "feature" although it's not clear to me why things were done this way
      and if there is any workaround. Among other things, this becomes a
      problem if you want to check for a fault.

      To see the contents of the returned value, I suggest you do this:

      use Data::Dumper;
      my $hash = $soap->OpGet(SOAP::Data->name("Request_ID" =>
      '000000000000002'));
      print Data::Dumper->Dump([$hash]);


      -- Alberto


      > Date: Wed, 07 May 2003 04:47:59 -0000
      > From: "Kamlesh" <kp52r11@...>
      > Subject: valueof usage help needed
      >
      > I have this code.
      > #!c:\perl\bin\perl.exe -w
      >
      > use SOAP::Lite;
      > use Data::Dumper;
      >
      > my $soap = SOAP::Lite
      > ->service
      > ('http://hdwebqa/arsys/WSDL/SJCappServer/UserLoginName');
      >
      > my $som = $soap->OpGet(SOAP::Data->name("Request_ID"
      > => '000000000000002'));
      >
      > print $som->valueof('//Envelope/Body/OpGetResponse/Full_Name') ;
      > print $som->valueof('//Envelope/Body/OpGetResponse/Email_Address');
      >
      > I know my wsdl works.
      > But I don't know how to get the response back. There are 2 values
      > returned back but I can't figure out how to use it.
      >
      > I am getting this error:
      >
      > Can't call method "valueof" without a package or object reference at
      > C:\DOCUME~1\kp52r11\LOCALS~1\Temp\dir138.tmp\r3.pl line 13.

      ****************************************************************************
      Alberto Accomazzi
      NASA Astrophysics Data System http://adswww.harvard.edu
      Harvard-Smithsonian Center for Astrophysics http://cfa-www.harvard.edu
      60 Garden Street, MS 83, Cambridge, MA 02138 USA
      ****************************************************************************
    • Show all 4 messages in this topic