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

4241Re: [soaplite] Dump SOAP Message?

Expand Messages
  • Bryce Harrington
    Dec 9, 2004
    • 0 Attachment
      I've used Data::Dumper for doing this on the client side.

      use Data::Dumper;
      use SOAP::Lite;
      #etc. etc.

      my $result = $soap->get_foo($bar);

      print Dumper($result);


      On the server side, I think you could probably do similarly... For the
      header maybe something like...

      package Foo;
      use Data::Dumper;
      #etc.

      sub get_foo {
      my ($self, $bar, $header) = @_;

      warn Dumper($header);

      return 'baz';
      }

      Note that dumping the result object generates a huge amount of output.
      The header dump is smaller in comparison, so probably doesn't have all
      the info you'd need, so I don't know if this is the full solution.
      Anyway, hope it helps.

      Bryce

      On Thu, 9 Dec 2004, rfbreedlov wrote:
      > In a server set up with SOAP::Lite, is there a simple way to dump the
      > request message as text? (Please provide a relatively complete
      > message, not just a reference to some function, if possible.) Thank
      > you.
      >
      > My server is currently:
      >
      > #!/bin/perl -w
      > use SOAP::Transport::HTTP;
      > use Date::Manip;
      >
      > &Log("Server Started");
      >
      > $server = SOAP::Transport::HTTP::CGI
      > -> dispatch_to
      > ('/data/httpd/html/soap/modules', 'Demo', 'Temperatures', 'xmltest')
      > -> on_action(\&onAction)
      > -> handle;
      >
      > sub Log {
      > my @lines = @_;
      > open(OUT,">>serverlog.txt");
      > print OUT &ParseDate('today') . ': ' . join
      > ("\n",@lines) . "\n";
      > close OUT;
      > } # Log
      >
      >
      > sub onAction {
      > my ($a, $u, $n) = @_;
      > &main::Log("action: $a, $u, $n");
      > } # onAction
      >
      >
      >
      >
      >
      >
      >
      > Yahoo! Groups Links
      >
      >
      >
      >
      >
      >
      >
    • Show all 3 messages in this topic