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

'trace' on server side?

Expand Messages
  • tilmankoschnick
    Hello everybody, is there something like the use SOAP::Lite +trace call on the server side? I am using use SOAP::Lite trace ; use SOAP::Transport::HTTP; but
    Message 1 of 7 , May 22, 2003
    • 0 Attachment
      Hello everybody,

      is there something like the 'use SOAP::Lite +trace' call on the server side? I am using

      use SOAP::Lite 'trace';
      use SOAP::Transport::HTTP;

      but this only gives me some information, like

      SOAP::Serializer::new: ()
      SOAP::Deserializer::new: ()
      SOAP::Parser::new: ()
      SOAP::Server::new: ()
      SOAP::Transport::HTTP::Server::new: ()
      SOAP::Transport::HTTP::Daemon::new: ()
      ...

      but not the call and response itself, as it would on the client side. I've searched the archive and found a couple of similar questions, but no answer, so I'm asking again in the hope someone found out by now.

      Cheers, Tilman Koschnick
    • jpeyser
      The trace does not work because there are no SOAP::Trace::debug calls in the server package. But, we can do a little hack. Redefine the SOAP::Server::handle
      Message 2 of 7 , May 22, 2003
      • 0 Attachment
        The trace does not work because there are no SOAP::Trace::debug calls
        in the server package. But, we can do a little hack.

        Redefine the SOAP::Server::handle subroutine in your server module
        and include a SOAP::Trace::debug call.

        sub SOAP::Server::handle { SOAP::Trace::trace('()');
        my $self = shift;

        # we want to restore it when we are done
        local $SOAP::Constants::DEFAULT_XML_SCHEMA =
        $SOAP::Constants::DEFAULT_XML_SCHEMA;

        # SOAP version WILL NOT be restored when we are done.
        # is it problem?

        # ***** NEW DEBUG CALL TO DISPLAY XML. *****
        SOAP::Trace::debug($_[0]);
        .
        .
        .

        Jonathan

        --- In soaplite@yahoogroups.com, "tilmankoschnick" <til@b...> wrote:
        > Hello everybody,
        >
        > is there something like the 'use SOAP::Lite +trace' call on the
        server side? I am using
        >
        > use SOAP::Lite 'trace';
        > use SOAP::Transport::HTTP;
        >
        > but this only gives me some information, like
        >
        > SOAP::Serializer::new: ()
        > SOAP::Deserializer::new: ()
        > SOAP::Parser::new: ()
        > SOAP::Server::new: ()
        > SOAP::Transport::HTTP::Server::new: ()
        > SOAP::Transport::HTTP::Daemon::new: ()
        > ...
        >
        > but not the call and response itself, as it would on the client
        side. I've searched the archive and found a couple of similar
        questions, but no answer, so I'm asking again in the hope someone
        found out by now.
        >
        > Cheers, Tilman Koschnick
      • quinn@funkspiel.org
        ... Please see these messages on the subject: http://groups.yahoo.com/group/soaplite/message/2044 http://groups.yahoo.com/group/soaplite/message/2054 Actually,
        Message 3 of 7 , May 22, 2003
        • 0 Attachment
          On Thu, May 22, 2003 at 06:48:17PM -0000, tilmankoschnick wrote:
          > Hello everybody,
          >
          > is there something like the 'use SOAP::Lite +trace' call on the server side? I am using

          Please see these messages on the subject:

          http://groups.yahoo.com/group/soaplite/message/2044
          http://groups.yahoo.com/group/soaplite/message/2054

          Actually, I have a question as well as an answer: Where are these
          server-side trace messages supposed to appear? No one mentioned that. ;)

          I don't see them in my Apache access or error logs (using Apache::SOAP
          under mod_perl). Does anyone know where they're supposed to go?

          Regards,
          --Q
        • jpeyser
          Seems to go the standard output. If you want to redirect the output then use SOAP::Trace- import(debug = sub {...}); and define your own subroutine. Jonathan
          Message 4 of 7 , May 22, 2003
          • 0 Attachment
            Seems to go the standard output. If you want to redirect the output
            then use

            SOAP::Trace->import(debug => sub {...});

            and define your own subroutine.

            Jonathan


            --- In soaplite@yahoogroups.com, quinn@f... wrote:
            > On Thu, May 22, 2003 at 06:48:17PM -0000, tilmankoschnick wrote:
            > > Hello everybody,
            > >
            > > is there something like the 'use SOAP::Lite +trace' call on the
            server side? I am using
            >
            > Please see these messages on the subject:
            >
            > http://groups.yahoo.com/group/soaplite/message/2044
            > http://groups.yahoo.com/group/soaplite/message/2054
            >
            > Actually, I have a question as well as an answer: Where are these
            > server-side trace messages supposed to appear? No one mentioned
            that. ;)
            >
            > I don't see them in my Apache access or error logs (using
            Apache::SOAP
            > under mod_perl). Does anyone know where they're supposed to go?
            >
            > Regards,
            > --Q
          • John Ralston
            In my server, I put: use SOAP::Lite+trace= debug ; open STDERR, , error.log ; and the server dumps a debug trace into error.log. trace= all dumps
            Message 5 of 7 , May 22, 2003
            • 0 Attachment
              In my server, I put:

              use SOAP::Lite+trace=>'debug';
              open STDERR, '>', "error.log";

              and the server dumps a debug trace into error.log. trace=>'all' dumps everything.

              John
            • Tilman Koschnick
              Hello & thanks for your replies. A combination of them did the trick for me; a quick summary for future reference: I added two lines to SOAP/Transport/HTTP.pm,
              Message 6 of 7 , May 23, 2003
              • 0 Attachment
                Hello & thanks for your replies. A combination of them did the trick for
                me; a quick summary for future reference:

                I added two lines to SOAP/Transport/HTTP.pm,

                SOAP::Trace::transport($self->request->as_string);

                to the top of SOAP::Transport::HTTP::Server::handle, and

                SOAP::Trace::transport($self->response->as_string);

                to the bottom of SOAP::Transport::HTTP::Server::make_response. In my
                server, I called

                use SOAP::Lite 'trace';
                use SOAP::Transport::HTTP;

                and, voilĂ , the full messages as in my clients.

                Cheers, Til



                tilmankoschnick wrote:
                > Hello everybody,
                >
                > is there something like the 'use SOAP::Lite +trace' call on the
                server side? I am using
                >
                > use SOAP::Lite 'trace';
                > use SOAP::Transport::HTTP;
                >
                > but this only gives me some information, like
                >
                > SOAP::Serializer::new: ()
                > SOAP::Deserializer::new: ()
                > SOAP::Parser::new: ()
                > SOAP::Server::new: ()
                > SOAP::Transport::HTTP::Server::new: ()
                > SOAP::Transport::HTTP::Daemon::new: ()
                > ...
                >
                > but not the call and response itself, as it would on the client side.
                I've searched the archive and found a couple of similar questions, but
                no answer, so I'm asking again in the hope someone found out by now.
                >
                > Cheers, Tilman Koschnick
              • kgoess
                ... Thanks for figuring that out, that is incredibly helpful. Here s a performance improvement on it, instead of sending the entire request and response into
                Message 7 of 7 , May 23, 2003
                • 0 Attachment
                  --- In soaplite@yahoogroups.com, Tilman Koschnick <til@b...> wrote:
                  > Hello & thanks for your replies. A combination of them did the trick for
                  > me; a quick summary for future reference:
                  >
                  > I added two lines to SOAP/Transport/HTTP.pm,

                  Thanks for figuring that out, that is incredibly helpful. Here's a performance
                  improvement on it, instead of sending the entire request and response into
                  the bit bucket when you turn off tracing, only get the string when it's
                  needed:

                  --- SOAP/Transport/HTTP.pm.bak Fri May 23 10:51:13 2003
                  +++ SOAP/Transport/HTTP.pm Fri May 23 11:10:16 2003
                  @@ -225,6 +225,8 @@
                  sub handle {
                  my $self = shift->new;

                  + SOAP::Trace::transport(sub {$self->request->as_string} );
                  +
                  if ($self->request->method eq 'POST') {
                  $self->action($self->request->header('SOAPAction') || undef);
                  } elsif ($self->request->method eq 'M-POST') {
                  @@ -294,6 +296,9 @@
                  'Content-Length' => SOAP::Utils::bytelength $response),
                  $response,
                  ));
                  +
                  + SOAP::Trace::transport( sub {$self->response->as_string} );
                  +
                  }


                  Enable it like this:

                  use SOAP::Lite trace =>
                  [transport =>
                  sub { print STDERR (ref $_[0] eq 'CODE' ? &{$_[0]} : $_[0]) }
                  ];
                Your message has been successfully submitted and would be delivered to recipients shortly.