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

Re: [soaplite] How do I parse request values by name?

Expand Messages
  • Andrew Bayliss
    You have to inherit from SOAP::Server::Parameters, e.g our @ISA = qw(SOAP::Server::Parameters); then you can pop the SOM, and get at the params by name: sub
    Message 1 of 1 , Sep 15, 2006
    View Source
    • 0 Attachment
      You have to inherit from SOAP::Server::Parameters, e.g

      our @ISA = qw(SOAP::Server::Parameters);

      then you can pop the SOM, and get at the params by name:

      sub whatever {

      my $som = pop;
      my $params = $som->method(); # hash ref
      ...
      }


      Andrew

      On 15/09/06, jmichalicek <jmichalicek@...> wrote:
      >
      >
      >
      >
      >
      >
      >
      > I am attempting to write a SOAP::Lite server CGI and do not want to
      > assume the order that a client is passing me values in the request.
      > How can I access these by name? I have found examples but none of
      > them work. The examples and other documentation I have found say that
      > the envelope is passed to the method as an SOM object as the final
      > parameter for the method. Unfortunately, I am not getting the
      > envelope. If I pop @_ all I get is the last value I passed in. For
      > example:
      >
      > <?xml version="1.0" encoding="UTF-8"?><soap:Envelope
      > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      > xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
      > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      > soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      > xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      > <soap:Body><doReplyxmlns="http://www.bash-shell.net/test">
      > <val1 xsi:type="xsd:int">1</val1><val2 xsi:type="xsd:string">2</val2>
      > </doReply></soap:Body></soap:Envelope>
      >
      > if in my method I then do "my $envelope = pop @_", $envelope is not an
      > SOM object but the value "2".
      >
      > In case it's relevant, I have to force install due to these tests
      > failing. I can't figure out why they are failing, though.
      >
      > t/03-server............NOK 2# Failed test 2 in t/03-server.t at line 174
      > t/03-server............NOK 3# Failed test 3 in t/03-server.t at line
      > 174 fail #2
      > t/03-server............NOK 4# Failed test 4 in t/03-server.t at line
      > 174 fail #3
      > t/03-server............NOK 7# Failed test 7 in t/03-server.t at line 182
      > t/03-server............NOK 8# Failed test 8 in t/03-server.t at line
      > 182 fail #2
      > t/03-server............NOK 9# Failed test 9 in t/03-server.t at line
      > 182 fail #3
      >
      > t/04-attach............Something wrong with MIME message:
      > MIME::Parser: can't flush: at
      > /usr/lib/perl5/site_perl/5.8.0/MIME/Parser.pm line 821.
      >
      > t/04-attach............dubious
      > Test returned status 255 (wstat 65280, 0xff00)
      >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.