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

2020SOAPLite Performance question

Expand Messages
  • Paresh Kapadia
    Nov 7, 2002
    • 0 Attachment
      Message
      Hi,
       
      I have a performance related question after using the SoapLite API. I am running an Axis 1.0 Soap server and I am using Soap Lite client.
       
      What is difficult for me to understand is that when I make a call to the soap server directly it takes longer to get the response back whereas when I make a call using wsdl, it is twice as much faster.
       
      I was under the impression that WSDL would require more processing and one more http round trip, then the direct call.
       
      I am using the HiRes module to measure the times and I am including the code for both the direct call as well as the wsdl call and also the average time readings that I receive.
       
      Please help me understand this strange behavior, or am I not understanding the soap concepts well, or am I not making the soap call properly in my code.
       
      Thanks for your response,
       
      Paresh
       
      ----------------------------------------------------------------------------------------------------------------------------------------
       
       # WSDL Call
       #average  time took 0.183692 seconds 
       
      #!/bin/perl
      use strict;
      use SOAP::Lite; # + trace => 'all';
      my $service = new SOAP::Lite
          -> service('http://cdspcr.cadence.com:8080/services/PCRService?wsdl')
          -> autotype(0)
          -> on_fault( sub { my($soap, $res) = @_;
                                die ref $res ? $res->faultstring : $soap->transport->status; } );
      use Time::HiRes qw(gettimeofday tv_interval);
      my ( $start_time, $end_time, $elapsed );
      $start_time = [ gettimeofday ];
       
      my $cr = $service->getPCRInfo(220420, "pcrprint", "8.1", "diwana", "cdspcr", "", "");
      print "[$cr]\n" if defined $cr;
       
      $end_time = [ gettimeofday ];
      $elapsed  = tv_interval($start_time,$end_time);
      print "\ntime took $elapsed seconds\n\n";
       
      ----------------------------------------------------------------------------------------------------------------------------------------
       
       # Direct Call
       #average  time took 0.350295 seconds
       #!/bin/perl
      use strict;
      use SOAP::Lite; # + trace => 'all';
      my $service = new SOAP::Lite
          -> proxy('http://cdspcr.cadence.com:8080/services/PCRService')
          -> uri('PCRService')
          -> autotype(0)
          -> on_fault( sub { my($soap, $res) = @_;
                                die ref $res ? $res->faultstring : $soap->transport->status; } )
          ;
      use Time::HiRes qw(gettimeofday tv_interval);
      my ( $start_time, $end_time, $elapsed );
      $start_time = [ gettimeofday ];
       
      my $cr = $service->getPCRInfo(220420, "pcrprint", "8.1", "diwana", "cdspcr", "", "")->result;
      print "[$cr]\n" if defined $cr;
       
      $end_time = [ gettimeofday ];
      $elapsed  = tv_interval($start_time,$end_time);
      print "\ntime took $elapsed seconds\n\n"; 
       
      ----------------------------------------------------------------------------------------------------------------------------------------