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

Re: Adding SOAP headers in a client

Expand Messages
  • Todd Ekenstam
    ... client ... Sorry, the Quick Start DOES work for the client side. # convert it into the Header $authInfo = SOAP::Header- name(authInfo = $authInfo); #
    Message 1 of 3 , Nov 11, 2002
    • 0 Attachment
      --- In soaplite@y..., "Todd Ekenstam" <tekenstam@y...> wrote:
      > How do you add a SOAP header in the client? In the server I do
      > something like:
      >
      > sub fake_login {
      > $authInfo = +{ 'username' => 'john_doe',
      > 'timestamp' => 1036799949,
      > 'signature' => '2c4db5d1650b8c98'};
      > return 1, SOAP::Header->name(authInfo => $authInfo);
      > }
      >
      > That works. But I don't see examples of how to do this on the
      client
      > side.

      Sorry, the Quick Start DOES work for the client side.

      # convert it into the Header
      $authInfo = SOAP::Header->name(authInfo => $authInfo);
      # invoke protected method
      $response = SOAP::Lite
      -> uri('http://www.soaplite.com/TicketAuth')
      -> proxy('http://myserver/cgi-bin/ticketauth.cgi')
      -> protected($authInfo, 'garbage');

      An argument of SOAP::Header->name provided as a parameter to the
      method is converted to a header much the same as a SOAP::Header->name
      is converted when provided as a return parameter.

      But now I can't seem to get the header back out on the server side.
      the Quick Start example says to do something like this:

      my $email = $checkAuthInfo->(pop->valueof('//authInfo'));

      However, I get a fault "Can't locate object method "valueof" via
      package "garbage" (perhaps you forgot to load "garbage"?"

      The pop is getting the last parameter, not the header.


      Any help would be appreciated.


      Thanks,

      Todd
    • Duncan Cameron
      ... .. ... Do you have a line like this? @TicketAuth::ISA = qw(SOAP::Server::Parameters); Regards, Duncan Cameron
      Message 2 of 3 , Nov 11, 2002
      • 0 Attachment
        On 2002-11-12 Todd Ekenstam wrote:
        >--- In soaplite@y..., "Todd Ekenstam" <tekenstam@y...> wrote:

        ..

        >But now I can't seem to get the header back out on the server side.
        >the Quick Start example says to do something like this:
        >
        > my $email = $checkAuthInfo->(pop->valueof('//authInfo'));
        >
        >However, I get a fault "Can't locate object method "valueof" via
        >package "garbage" (perhaps you forgot to load "garbage"?"
        >
        >The pop is getting the last parameter, not the header.
        Do you have a line like this?

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

        Regards,
        Duncan Cameron
      Your message has been successfully submitted and would be delivered to recipients shortly.