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

Re: [soaplite] Confused return values

Expand Messages
  • Weidong Wang
    When using service() call, you get back the result directly, instead of the SOM object. To get it, do this: my $s = SOAP::Lite
    Message 1 of 2 , Jul 9, 2002
    • 0 Attachment
      When using service() call, you get back the result directly, instead of the SOM object. To get it, do this:
       
      my $s = SOAP::Lite
         ->service('
      http://soap.digitaldistractions.com/MHAService.wsdl');
      my $result = $s->hello(@vals);
      my $somObj = $s->call;
       
      Weidong
       
      ----- Original Message -----
      From: lbotha_uk
      Sent: Tuesday, July 09, 2002 11:50 AM
      Subject: [soaplite] Confused return values

      Hi all,

      I'm somewhat confused about the return values I receive when calling
      my SOAP service.  Whenever I call a remote method, the type of the
      return value is an array of strings (in the case below, it's
      ["Hello Long John Silver", "o01fS.lBjwG1A"] ) , rather than the
      SOAP::SOM object that I really need.  How do I force SOAP::Lite to
      return a SOAP::SOM object rather than an array?

      The XML of the SOAP reply is shown below, showing the two return
      values:

      <?xml version="1.0" encoding="UTF-8"?>
      <SOAP-ENV:Envelope xmlns:SOAP-
      ENC="http://schemas.xmlsoap.org/soap/encoding/"
         SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
         xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
         xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
         xmlns:xsd="http://www.w3.org/1999/XMLSchema">
         <SOAP-ENV:Body>
            <namesp5:helloResponse xmlns:namesp5="MHAService">
               <result xsi:type="xsd:string">Hello Long John Silver</result>
               <session xsi:type="xsd:string">o01fS.lBjwG1A</session>
            </namesp5:helloResponse>
         </SOAP-ENV:Body>
      </SOAP-ENV:Envelope>

      The (simplified) client code in question is:

      push @vals, SOAP::Data->name('firstname')->value("Long John");
      push @vals, SOAP::Data->name('lastname')->value("Silver");
      ...
      my $s = SOAP::Lite
         ->service('http://soap.digitaldistractions.com/MHAService.wsdl');
      my @ret = $s->hello(@vals);

      What I really need is:

      my $ret = $s->hello(@vals); # ...where $ret is of type SOAP::SOM

      Any ideas?
      Louis



      To unsubscribe from this group, send an email to:
      soaplite-unsubscribe@yahoogroups.com



      Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
    Your message has been successfully submitted and would be delivered to recipients shortly.