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

Multiple calls problem

Expand Messages
  • Artur Brodowski
    Hello, I wrote a simple SOAP proxy, but I have a problem accesing different methods from client during one session: use SOAP::Lite; # ... $soap = SOAP::Lite -
    Message 1 of 3 , Oct 5, 2004
    View Source
    • 0 Attachment
      Hello,
      I wrote a simple SOAP proxy, but I have a problem accesing different
      methods from client during one session:

      use SOAP::Lite;
      # ...

      $soap = SOAP::Lite
      -> uri("http://$SOAPhost:$SOAPport/SProxy")
      -> proxy("http://$SOAPhost:$SOAPport/")
      ;

      $client = $soap->fun1($arg1);
      unless ($client->fault) {
      # works fine here...
      }

      $client = $soap->fun2($arg2);
      unless ($client->fault) {
      # different method - DOES NOT WORK PROPERLY
      }

      $client = $soap->fun1($arg1);
      unless ($client->fault) {
      # same call as the first one, works fine
      }


      It seems that server (based on SOAP::Transport::HTTP) uses some kind
      of cache - when I try to call fun2, it executes fun1 with empty (?)
      arguments. Is it possible to call different methods from one session,
      do I need to 'flush' session after every call?

      Artur Brodowski.
      --
      only so many songs can be sung with two lips two lungs and one tongue
    • Joseph Hourcle
      ... [trimmed] ... I ve never had such a problem. The following works for me: #!/usr/bin/perl -- use SOAP::Lite; my $soap = SOAP::Lite -
      Message 2 of 3 , Oct 7, 2004
      View Source
      • 0 Attachment
        On Tue, 5 Oct 2004, Artur Brodowski wrote:

        >
        > Hello,
        > I wrote a simple SOAP proxy, but I have a problem accesing different
        > methods from client during one session:

        [trimmed]

        > It seems that server (based on SOAP::Transport::HTTP) uses some kind
        > of cache - when I try to call fun2, it executes fun1 with empty (?)
        > arguments. Is it possible to call different methods from one session,
        > do I need to 'flush' session after every call?

        I've never had such a problem. The following works for me:


        #!/usr/bin/perl --

        use SOAP::Lite;

        my $soap = SOAP::Lite
        -> uri('http://annoying.org/MyTest')
        -> proxy('http://127.0.0.1/cgi-bin/vso/test.cgi')
        -> on_debug(sub{print@_})
        ;

        use Data::Dumper;


        test($_) for ( 1 .. 5, qw( _1 _2 _3 _4 _5 ) );


        sub test {
        my $num = shift;
        print "\n\n-----\nTest $num:\n-----\n\n";

        my $results = eval "\$soap->test$num();";
        if ($results->fault()) {
        print join( "$/\t", "\nERROR : ", $results->faultcode(), $results->faultstring(), $results->faultdetail(),'');
        } else {
        print Dumper($results->result());
        }
        }


        -----
        Joe Hourcle
      • Byrne Reese
        This seems highly irregular. Can you provide me with a trace of the program? Perhaps you can turn debugging on: use SOAP::Lite +trace = qw(debug); Send me the
        Message 3 of 3 , Nov 13, 2004
        View Source
        • 0 Attachment
          This seems highly irregular. Can you provide me with a trace of the
          program? Perhaps you can turn debugging on:

          use SOAP::Lite +trace => qw(debug);

          Send me the output and I think I can help. But I reiterate, something
          seems amiss - there is no real caching in SOAP::Lite unless you use a
          WSDL - and then it only "caches" a template - not actual values. But
          that is neither here nor there.

          Send me a trace and let me see what I can find out.

          Byrne

          Artur Brodowski wrote:

          > Hello,
          > I wrote a simple SOAP proxy, but I have a problem accesing different
          > methods from client during one session:
          >
          > use SOAP::Lite;
          > # ...
          >
          > $soap = SOAP::Lite
          > -> uri("http://$SOAPhost:$SOAPport/SProxy")
          > -> proxy("http://$SOAPhost:$SOAPport/")
          > ;
          >
          > $client = $soap->fun1($arg1);
          > unless ($client->fault) {
          > # works fine here...
          > }
          >
          > $client = $soap->fun2($arg2);
          > unless ($client->fault) {
          > # different method - DOES NOT WORK PROPERLY
          > }
          >
          > $client = $soap->fun1($arg1);
          > unless ($client->fault) {
          > # same call as the first one, works fine
          > }
          >
          >
          > It seems that server (based on SOAP::Transport::HTTP) uses some kind
          > of cache - when I try to call fun2, it executes fun1 with empty (?)
          > arguments. Is it possible to call different methods from one session,
          > do I need to 'flush' session after every call?
          >
          > Artur Brodowski.
          > --
          > only so many songs can be sung with two lips two lungs and one tongue
        Your message has been successfully submitted and would be delivered to recipients shortly.