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

Re: [soaplite] Re: Accessing SOAP::Header

Expand Messages
  • Jay A. Kreibich
    ... The server function soapimport needs to be part of a package that is derived (e.g., has an @ISA value) from the SOAP::Lite package
    Message 1 of 4 , Apr 11, 2005
    • 0 Attachment
      On Mon, Apr 11, 2005 at 12:41:49PM -0000, jameshargreavesgmail scratched on the wall:
      >
      > Thanks - but I still can't access the header! If I perform the

      > Why am I not able to access the envelope as you suggest?

      The server function "soapimport" needs to be part of a package that
      is derived (e.g., has an @ISA value) from the SOAP::Lite package
      'SOAP::Server::Parameters'. This clues in SOAP::Lite to append the
      SOAP::SOM object as the last argument.

      Once you have a reference to the SOM object, you can extract the
      headers in to a hash with the call "headers". Example:

      ----------------------------------------------------------------------

      package mySoapPackage;
      our( @ISA ) = ( 'SOAP::Server::Parameters' );

      [...]

      sub soapimport
      {
      my( $class ) = shift( @_ );
      my( $som ) = pop( @_ );
      my( $hdr ) = $som -> header( );
      my( $ck ) = $hdr -> {'check'};

      # $ck is a scalar string value, not a SOAP::Data object

      [...]
      }

      ----------------------------------------------------------------------

      The SOM object can also be used to extract named parameters and other
      elements of the transaction.

      -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
    Your message has been successfully submitted and would be delivered to recipients shortly.