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

access to raw CGI post data on server

Expand Messages
  • Alois Treindl
    To debug a rare server problem with failing CGIs, we have added a trace function for faults in the service cgi, like this: use SOAP::Lite +trace = [ fault =
    Message 1 of 4 , Nov 25, 2005
    • 0 Attachment
      To debug a rare server problem with failing CGIs, we
      have added a trace function for faults in the service cgi, like this:

      use SOAP::Lite +trace => [ fault => \&log_faults ];

      sub log_faults {
      open LOGFILE,">/tmp/fault.log";
      print LOGFILE join "\n", @_;
      foreach (keys %ENV) {
      print LOGFILE "ENV{$_} = $ENV{$_}\n";
      }
      close LOGFILE;
      }


      This logs the soap fault message and all HTTP environment variables.

      We would like to see the original POST data of the cgi request
      (the incoming xml file).

      How can I access this at this stage, to print it into the fault-logfile?

      I would be happy to get a reply despite thanksgiving weekend (we don't
      have this holiday in europe)
    • Byrne Reese
      Check out: http://www.majordojo.com/archives/2005/03/unlocking_065_d.php And http://www.majordojo.com/archives/2004/10/intercepting_th.php ... ^byrne
      Message 2 of 4 , Nov 25, 2005
      • 0 Attachment
        Check out:

        http://www.majordojo.com/archives/2005/03/unlocking_065_d.php

        And

        http://www.majordojo.com/archives/2004/10/intercepting_th.php

        > To debug a rare server problem with failing CGIs, we
        > have added a trace function for faults in the service cgi, like this:
        >
        > use SOAP::Lite +trace => [ fault => \&log_faults ];
        >
        > sub log_faults {
        > open LOGFILE,">/tmp/fault.log";
        > print LOGFILE join "\n", @_;
        > foreach (keys %ENV) {
        > print LOGFILE "ENV{$_} = $ENV{$_}\n";
        > }
        > close LOGFILE;
        > }
        >
        >
        > This logs the soap fault message and all HTTP environment variables.
        >
        > We would like to see the original POST data of the cgi request
        > (the incoming xml file).
        >
        > How can I access this at this stage, to print it into the fault-logfile?
        >
        > I would be happy to get a reply despite thanksgiving weekend (we don't
        > have this holiday in europe)
        >
        >
        >
        >
        >
        > YAHOO! GROUPS LINKS
        > Visit your group "soaplite" on the web.
        > To unsubscribe from this group, send an email to:
        > soaplite-unsubscribe@yahoogroups.com
        > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
        >


        ^byrne
      • Alois Treindl
        ... I am afraid I do not really understand these two references, i.e. how to apply the information there to my actual example. Would it be possible to give
        Message 3 of 4 , Nov 27, 2005
        • 0 Attachment
          --- In soaplite@yahoogroups.com, "Byrne Reese" <byrne@m...> wrote:
          >
          > Check out:
          >
          > http://www.majordojo.com/archives/2005/03/unlocking_065_d.php
          >
          > And
          >
          > http://www.majordojo.com/archives/2004/10/intercepting_th.php
          >

          I am afraid I do not really understand these two references, i.e. how
          to apply the information there to my actual example.

          Would it be possible to give more precise instractions, for my case?
        • Alois Treindl
          I solved the problem myself. Made a little modifications in Transport::HTTP.pm to save the local variable $content into a globally visible $save_content for
          Message 4 of 4 , Nov 30, 2005
          • 0 Attachment
            I solved the problem myself.

            Made a little modifications in Transport::HTTP.pm to save the local
            variable $content into a globally visible $save_content for each
            received request, just after is was read raw from the stdin.

            Then, in the log_faults() function below,
            we can print $SOAP::Transport::HTTP::saved_content
            to the fault logfile.

            by the way, the original problem I had reported turned out to be
            caused by the soap client. Some incorrect initialisation of re-used
            components on the client resulted in incorrect service calls.

            Alois



            --- In soaplite@yahoogroups.com, "Alois Treindl" <alois@a...> wrote:
            >
            > To debug a rare server problem with failing CGIs, we
            > have added a trace function for faults in the service cgi, like this:
            >
            > use SOAP::Lite +trace => [ fault => \&log_faults ];
            >
            > sub log_faults {
            > open LOGFILE,">/tmp/fault.log";
            > print LOGFILE join "\n", @_;
            > foreach (keys %ENV) {
            > print LOGFILE "ENV{$_} = $ENV{$_}\n";
            > }
            > close LOGFILE;
            > }
            >
            >
            > This logs the soap fault message and all HTTP environment variables.
            >
            > We would like to see the original POST data of the cgi request
            > (the incoming xml file).
            >
            > How can I access this at this stage, to print it into the fault-logfile?
          Your message has been successfully submitted and would be delivered to recipients shortly.