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

40Re: [soaplite] Array/Object return values from Apache SOAP???

Expand Messages
  • Paul Kulchenko
    Feb 14, 2001
    • 0 Attachment
      Hi, Brian!

      All parameters will be transferred exactly as is if possible, so if
      you have

      --1--

      on server side:

      sub a { return [1,2,3] }

      on client side it'll be:

      $arrayref = $soap->a->result;
      print @$arrayref;

      --2--

      on server side:

      sub a { return (1,2,3) }

      on client side it'll be:

      @array = $soap->a->paramsin;
      print @array;

      ->result; # returns FIRST parameter
      ->paramsout; # returns OTHER parameters (starting from second if any)
      ->paramsin; # returns ALL parameters (combined ->result,
      ->paramsout)

      Shortly, what you returned on server side is what you get on client
      side.

      Best wishes, Paul.

      --- Brian Skrab <bgs@...> wrote:
      > Hello again,
      >
      > My SOAP::Lite code will be interacting with an Apache SOAP
      > server
      > which already has a few services that return arrays,
      > objects, and
      > arrays of objects. I can interact with the services that
      > return
      > single, common data types like a string or a boolean, but
      > when I try
      > to interact with a service that returns an array of
      > strings, I
      > cannot seem to get at the array. Here is a piece of the
      > code I am
      > using to get an array of strings...
      >
      > my $soap_data_urn = SOAP::Data->type('string')
      > ->name('target')
      > ->value('urn:TimeManager');
      >
      > $response = $soap_lite
      > -> uri('urn:ServiceManager')
      > -> locate($soap_data_urn);
      >
      > @strings = $response->paramsout;
      >
      > foreach(@strings) {
      > print"$_\n";
      > }
      >
      > I have even tried getting the first string in the response
      > as
      > suggested by the perldoc...
      >
      > $string1 = $response->result;
      > print("\$string1 = $string1\n");
      >
      > The output of the above statement follows (if it's any
      > help)...
      >
      > $string1 = Array=ARRAY(0x846e70c)
      >
      > What about Objects? If I call a method that returns the
      > SOAP
      > equivalent of a Java Object, how do I access that
      > object's/structure's
      > members? Do I need a Perl Object that mirrors the Java
      > Object, or
      > can I simply reference it as a hash?
      >
      > Any tips/examples will be very much appreciated.
      >
      > Thanks,
      >
      > ~brian
      >
      >
      > ------------------------ Yahoo! Groups Sponsor
      >
      > To unsubscribe from this group, send an email to:
      > soaplite-unsubscribe@yahoogroups.com
      >
      >
      >


      __________________________________________________
      Do You Yahoo!?
      Get personalized email addresses from Yahoo! Mail - only $35
      a year! http://personal.mail.yahoo.com/
    • Show all 2 messages in this topic