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

Re: [soaplite] Different object returned by using SOAP::Lite->proxy() or SOAP::Lite->service() ?

Expand Messages
  • Byrne Reese
    This is fixed in the lastest development version of SOAP::Lite. SOAP- service returns the actual result - usually a SCALAR. :-/ Not ideal for most people.
    Message 1 of 3 , Apr 19, 2005
    • 0 Attachment
      This is fixed in the lastest development version of SOAP::Lite.
      SOAP->service returns the actual result - usually a SCALAR. :-/ Not
      ideal for most people.

      SOAP->proxy returns a SOAP::SOM object.

      In SOAP::Lite 0.65_4 I believe, one can ask for the SOAP::SOM object
      from a SOAP->service() call, by setting the preference:

      SOAP->want_som(1);

      As for the second question - yes, uri is perhaps a bad choice of names
      (it is being deprecated and renamed in SOAP::Lite 0.65_5). It specifies
      the namespace.

      Byrne

      Cristina Aurrecoechea wrote:

      > I would like to understand the following but I cant
      > find good tutorials on this.
      >
      > It seems the returned object ($service in client
      > below) is different if I use SOAP::Lite->service(wsdl)
      > or if I use SOAP::Lite->proxy(servicelocation)
      >
      > When using SOAP::Lite->proxy(), and then calling the
      > method (getNameList which returns a string[4]), I
      > obtain something that prints as 1 and cannot be
      > dereferenced. In order to obtain the reference to the
      > array, I need to use the valueof() statement below.
      >
      > When using SOAP::Lite->service(), and then calling the
      > method , I obtain right away the reference to the
      > array. Then I just need to dereference it and print
      > the items.
      > (in this case the valueof() statement needs to be out,
      > or you get an error, "cannot execute valueof() to an
      > unblessed reference")
      >
      > Can someone explain this behavior or give me some
      > pointer to an explanation?
      >
      > One more question: in my example, the uri() is
      > useless. The program works without it or even if I use
      > it with a non-existing namespace. Probably this is
      > because the information given in proxy() is enough to
      > find the service. When is uri() necessary and should
      > its value correspond to the targetNamespace in WSDL
      > file?
      >
      > Thanks
      > Cristina
      >
      > -----------------------------------------------------------------------------------------------------------------------------------------------
      > $service = SOAP::Lite
      >
      > -> uri('http://aurrecotest') <http://aurrecotest%27%29>
      >
      > ->proxy('http://mango.ctegd.uga.edu:9021/axis/services/TestArrayService')
      > <http://mango.ctegd.uga.edu:9021/axis/services/TestArrayService%27%29>
      > #
      > ->service("http://mango.ctegd.uga.edu/webservicestest/TestArrayService.wsdl")
      > ;
      >
      >
      > #without, 1999 schemas are used and server acts out
      > $service->serializer->namespaces({"http://schemas.xmlsoap.org/soap/encoding/"=>"SOAP-ENC","http://schemas.xmlsoap.org/soap/envelope/"=>"SOAP-INV","http://www.w3.org/2001/XMLSchema"=>"xsd","http://www.w3.org/2001/XMLSchema-instance"=>"xsi"});
      >
      > $result = $service->getNameList();
      > $result =
      > $result->valueof('//getNameListResponse/getNameListReturn');
      >
      > while (@$result){
      > $item = shift @$result;
      > print "$item\n";
      > }
      >
      >
      >
      > ------------------------------------------------------------------------
      > *Yahoo! Groups Links*
      >
      > * To visit your group on the web, go to:
      > http://groups.yahoo.com/group/soaplite/
      >
      > * To unsubscribe from this group, send an email to:
      > soaplite-unsubscribe@yahoogroups.com
      > <mailto:soaplite-unsubscribe@yahoogroups.com?subject=Unsubscribe>
      >
      > * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
      > Service <http://docs.yahoo.com/info/terms/>.
      >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.