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

Re: [soaplite] Re: Working TicketAuth example?

Expand Messages
  • Paul Kulchenko
    Hi Todd, ... I guess your problem was around this code: package main; .... package foo; @foo:ISA = bar ; The problem is that inheritance (@foo:ISA) doesn t
    Message 1 of 4 , Nov 12, 2002
    • 0 Attachment
      Hi Todd,

      > Not sure why that's a problem. The other examples (hibye, etc.)
      > seemed to work with everything in the same file.
      I guess your problem was around this code:

      package main;

      ....

      package foo;
      @foo:ISA = 'bar';

      The problem is that inheritance (@foo:ISA) doesn't work unless you
      wrap your package code into BEGIN block (or use a separate file,
      which effectively does the same):

      BEGIN {
      package foo;
      @foo:ISA = 'bar';
      }

      That's the way Perl works and I've posted the explanation few times
      already. Other simple examples work because they don't use
      inheritance. Let me know if it's something else.

      Best wishes, Paul.

      --- Todd Ekenstam <tekenstam@...> wrote:
      > I answered my own question. I knew it had to be something
      > blindingly
      > stupid.
      >
      > My problem was that I had both the SOAP::Transport::HTTP::CGI
      > dispatcher and the package to be dispatched to in the same file.
      > As
      > soon as I moved the package into a separate file (i.e.
      > TicketAuth.cgi
      > and TicketAuth.pm) I was able to get access to the SOAP headers.
      >
      > Not sure why that's a problem. The other examples (hibye, etc.)
      > seemed to work with everything in the same file.
      >
      > Thanks for everyone's suggestions.
      >
      >
      > Todd



      __________________________________________________
      Do you Yahoo!?
      U2 on LAUNCH - Exclusive greatest hits videos
      http://launch.yahoo.com/u2
    • Todd Ekenstam
      Thanks again Duncan/Paul. Just another follow-up. If you want the TicketAuth example all in one file, the other thing that needs to go into the BEGIN block
      Message 2 of 4 , Nov 13, 2002
      • 0 Attachment
        Thanks again Duncan/Paul.

        Just another follow-up. If you want the TicketAuth example all in
        one file, the other thing that needs to go into the BEGIN block are
        the "private" functions:

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

        $TicketAuth::calculateAuthInfo = sub {
        return md5(join '', 'mysecretstring', @_);
        };
        # etc...
        }

        Otherwise you have a similar (but more obvious) inheritance problem
        trying to call $calculateAuthInfo->().


        Todd



        --- In soaplite@y..., Paul Kulchenko <paulclinger@y...> wrote:
        > Hi Todd,
        >
        > > Not sure why that's a problem. The other examples (hibye, etc.)
        > > seemed to work with everything in the same file.
        > I guess your problem was around this code:
        >
        > package main;
        >
        > ....
        >
        > package foo;
        > @foo:ISA = 'bar';
        >
        > The problem is that inheritance (@foo:ISA) doesn't work unless you
        > wrap your package code into BEGIN block (or use a separate file,
        > which effectively does the same):
        >
        > BEGIN {
        > package foo;
        > @foo:ISA = 'bar';
        > }
        >
        > That's the way Perl works and I've posted the explanation few times
        > already. Other simple examples work because they don't use
        > inheritance. Let me know if it's something else.
        >
        > Best wishes, Paul.
      Your message has been successfully submitted and would be delivered to recipients shortly.