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

6350Re: [soaplite] Empty results with SOAP::Lite - why?

Expand Messages
  • Joe Hourcle
    Jul 27, 2009
    • 0 Attachment
      On Mon, 27 Jul 2009, Patrick Schoenfeld wrote:

      > Hi,
      >
      > I'm currently trying to train myself in using SOAP::Lite
      > and having problems with the most basic use. Unfortunately
      > I must confess that I don't know much about SOAP, except
      > rough basics.
      >
      > OK, lets consider the following script:
      > use SOAP::Lite +trace => 'debug';
      > $uri = 'http://packages.qa.debian.org/cgi-bin/soap-alpha.cgi';
      > $soap = SOAP::Lite->new();
      > $soap->proxy($uri);
      > $soap->default_ns($uri);
      > $ver = $soap->version;
      > # This returns nothing, why?
      >
      > The SOAP interface above does not have a namespace.
      > According to the SOAP dump, the interface seems to answer the
      > command with the right answer (its the same as a similar script written
      > in python returns):
      >
      > <SOAP-ENV:Envelope
      > xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
      > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
      > xmlns:ZSI="http://www.zolera.com/schemas/ZSI/"
      > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><SOAP-ENV:Header></SOAP-ENV:Header><SOAP-ENV:Body><versionResponse
      > id="o8c9dfe0"
      > xsi:type="xsd:string">0.1.2066</versionResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
      >
      > So from the code above, I expect $ver to be 0.1.2066, but its empty.
      > Can somebody enlighten me, what I am doing wrong? Pointers
      > to the documentation welcome, because I didn't find anything,
      > which helps me.

      Normally, with RPC-encoded, the response is a struct, not a string, so
      inside the SOAP body, you'd see something like:

      <versionResponse>
      <version xsi:type="xsd:string> ... </version>
      </versionResponse>

      As for the 'result()' comment from earlier -- unless you're using
      autodispatch, SOAP::Lite returns a SOAP::SOM object, not the response, so
      you'd have to call result() on the object to get the value.

      (in your case, I gave it a quick test, and it came up empty -- I was able
      to call 'body' on it, and got back:

      { 'versionResponse' => '0.1.2066' }

      -Joe
    • Show all 6 messages in this topic