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

Re: [soaplite] SOAP::Lite client botches response, help

Expand Messages
  • Jay A. Kreibich
    ... It isn t. $rv is a reference to a SOAP::SOM object. You need to extract the values you want form that object. See
    Message 1 of 3 , Mar 29, 2005
    • 0 Attachment
      On Tue, Mar 29, 2005 at 11:57:57PM -0000, Christopher scratched on the wall:
      >
      >
      > My service's response is a string, an int and an array of strings:
      >
      > <testFuncResponse SOAP-ENC:root="1">
      > <rvs SOAP-ENC:arrayType="xsd:string[2]" xsi:type="SOAP-ENC:Array">
      > <item>return 1</item>
      > <item>return 2</item>
      > </rvs>
      > <errcode xsi:type="xsd:int">0</errcode>
      > <errmsg xsi:type="xsd:string">success</errmsg>
      > </testFuncResponse>
      >
      > SOAP::Lite only makes the first response value available to me:
      >
      > $rv = SOAP::Lite->service('file:../test.wsdl')->testFunc('hello
      > soap!');
      > print @{$rv}
      > # returns: return 1return2
      >
      > It would seem that $rv should be a hash reference:
      > { 'rvs' => ["return 1", "return 2"],
      > 'errcode' => 0,
      > 'errmsg' => 'success'
      > }
      >
      > Why is SOAP::Lite ignoring the other elements in the response?

      It isn't. $rv is a reference to a SOAP::SOM object. You need
      to extract the values you want form that object. See
      http://cpan.uwinnipeg.ca/htdocs/SOAP-Lite/SOAP/Lite.html#soap__som
      for more details.

      -j

      --
      Jay A. Kreibich | CommTech, Emrg Net Tech Svcs
      jak@... | Campus IT & Edu Svcs
      <http://www.uiuc.edu/~jak> | University of Illinois at U/C
    • Christopher
      ... xsi:type= SOAP-ENC:Array ... http://cpan.uwinnipeg.ca/htdocs/SOAP-Lite/SOAP/Lite.html#soap__som ... use SOAP::Lite; $rv =
      Message 2 of 3 , Mar 30, 2005
      • 0 Attachment
        --- In soaplite@yahoogroups.com, "Jay A. Kreibich" <jak@u...> wrote:
        > On Tue, Mar 29, 2005 at 11:57:57PM -0000, Christopher scratched on
        the wall:
        > >
        > >
        > > My service's response is a string, an int and an array of
        strings:
        > >
        > > <testFuncResponse SOAP-ENC:root="1">
        > > <rvs SOAP-ENC:arrayType="xsd:string[2]"
        xsi:type="SOAP-ENC:Array">
        > > <item>return 1</item>
        > > <item>return 2</item>
        > > </rvs>
        > > <errcode xsi:type="xsd:int">0</errcode>
        > > <errmsg xsi:type="xsd:string">success</errmsg>
        > > </testFuncResponse>
        > >
        > > SOAP::Lite only makes the first response value available to me:
        > >
        > > $rv = SOAP::Lite->service('file:../test.wsdl')->testFunc('hello
        > > soap!');
        > > print @{$rv}
        > > # returns: return 1return2
        > >
        > > It would seem that $rv should be a hash reference:
        > > { 'rvs' => ["return 1", "return 2"],
        > > 'errcode' => 0,
        > > 'errmsg' => 'success'
        > > }
        > >
        > > Why is SOAP::Lite ignoring the other elements in the response?
        >
        > It isn't. $rv is a reference to a SOAP::SOM object. You need
        > to extract the values you want form that object. See
        >
        http://cpan.uwinnipeg.ca/htdocs/SOAP-Lite/SOAP/Lite.html#soap__som
        > for more details.
        >
        > -j

        use SOAP::Lite;
        $rv = SOAP::Lite->service('file:../test.wsdl')->testFunc({x =>'hello
        soap!'});
        print $rv->paramsall;
        ### Can't call method "paramsout" on unblessed reference
        at ./client.pl line 6.
        print ref($rv);
        ### ARRAY

        Admittedly, I'm no Perl expert, but that doesn't look like a ref to
        a SOM object...? I'm prolly just making a dumb mistake, I haven't
        programmed in Perl for a while.

        Thank you for the help.
      Your message has been successfully submitted and would be delivered to recipients shortly.