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

printing out items from the SOM object ???

Expand Messages
  • jonthorwilliams
    I got stuck trying to print out values from the SOM object. I cant seem to get any of the SOM methods to print correctly, except for result and
    Message 1 of 3 , May 23, 2002
    • 0 Attachment
      I got stuck trying to print out values from the SOM object. I cant
      seem to get any of the SOM methods to print correctly, except
      for "result" and "namespaceuriof()". here is a completely working
      SOAP::Lite script as an example. can you say what is wrong with it?
      more specifically why cant i get proper results from the valueof,
      dataof, attr, and paramsout methods???

      ----------------------------

      #!perl -w

      use strict;
      use SOAP::Lite +'trace';

      my $soap = SOAP::Lite
      -> uri('/examples')
      -> on_action(sub { sprintf '"%s"', shift })
      -> proxy('http://superhonker.userland.com/');

      my $som = $soap->getStateName(
      SOAP::Header->name('MyHeader')->type(string => 'Value'),
      SOAP::Data->name(statenum => 49)
      );

      print "\n-----\n";

      if ($som->match(SOAP::SOM::envelope)) {
      print "Header=".$som->valueof('Header')."\n";
      print "Body=".$som->valueof('Body')."\n";
      print "First Body Value=".($som->body)[0]."\n";
      print "Res=".$som->result."\n";
      print "NS=".$som->namespaceuriof('Body')."\n";
      my $trans = $som->dataof;
      print "Attr Test=".$trans->attr."\n";
      print "ParamsOut=".$som->paramsout()."\n";

      } else {
      print "nothing here\n";
      }

      ----------------------------


      jon
    Your message has been successfully submitted and would be delivered to recipients shortly.