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

4552Re: [soaplite] Accessing SOAP::Header

Expand Messages
  • �h�bh��
    Apr 10, 2005
      Jay,

      On the server side, SOAP headers can be accessed as follows:

      sub authenticate {
      my $self = shift;
      my $env = pop;
      my $str = $env->dataof("//MessageHeader/client_id")->value
      return SOAP::Data->name("client_id" => "$str");
      }

      Hope this helps

      / S \

      --- jameshargreavesgmail <james.hargreaves@...> wrote:
      >
      > No doubt another stupid question from yours truly ;)
      >
      > I have a SOAP::Transport::HTTP::CGI server and a simple SOAP::Lite
      > client. I can send a SOAP::Header fine:
      >
      > ===
      > soapimport.pl
      > ---
      > $soap = new SOAP::Lite
      > -> uri($uri)
      > -> proxy($server);
      >
      > $session_id = $soap->soapimport( SOAP::Header->name(client_id =>
      > $client_id),
      > SOAP::Header->name(password =>
      > $password) )->result;
      > ===
      >
      > but I don't know how to extract the SOAP::Header on the server so I
      > can verify the parameters:
      >
      > ===
      > soapimport.cgi
      > ---
      > use SOAP::Transport::HTTP;
      >
      > use TPG_SOAPImport;
      >
      > SOAP::Transport::HTTP::CGI
      > ->dispatch_to(qw(TPG_SOAPImport))
      > ->handle;
      > ===
      >
      > ===
      > TPG_SOAPImport.pm
      > ---
      > package TPG_SOAPImport;
      >
      > sub soapimport
      > { my $self = shift;
      >
      > # verify details
      > $self->authenticate;
      >
      > # do some stuff
      > ...
      > }
      >
      > sub authenticate
      > { my $self = shift;
      >
      > # how do i access the SOAP::Header element here ???
      > return undef;
      > }
      >
      > 1;
      > ===
      >
      > Any help would be appreciated!
      >
      > Thanks
      > Jay
      >
      >
      >
      >



      __________________________________
      Do you Yahoo!?
      Yahoo! Small Business - Try our new resources site!
      http://smallbusiness.yahoo.com/resources/
    • Show all 4 messages in this topic