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

timeout - apacheSOAP client / SOAP::Lite server on NT

Expand Messages
  • cjbecjbe@yahoo.com
    a server written in SOAP Lite seems to block - but only when the server is running on a windows NT machine, and the client is written in java / apacheSOAP.
    Message 1 of 3 , Sep 10, 2001
    • 0 Attachment
      a server written in SOAP Lite seems to block - but only when the
      server is running on a windows NT machine, and the client is written
      in java / apacheSOAP. instead i get an error message, that the
      webserver has killed the sever process after 15 minutes.

      the machines
      A:
      windows nt 4.0sp5
      sun jdk 1.3.1
      apacheSOAP 2.2

      B:
      linux 2.2.16 (SuSE 7.0)
      Classic VM (build 1.2.2-L, green threads, nojit
      apacheSOAP 2.2
      perl 5.005_03
      SOAP::Lite 0.50
      Apache/1.3.12 (Unix) (SuSE/Linux) mod_fastcgi/2.2.2
      balanced_by_mod_backhand/1.0.8 mod_perl/1.24 ...

      C:
      windows nt 4.0sp6
      iis 4.0
      perl 5.005_03 Binary build 522 provided by ActiveState Tool Corp.
      SOAP::Lite 0.51

      tested combinations:
      client client server
      written machine machine result
      in
      java A B ok
      java A C timeout
      java B B ok
      java B C timeout
      perl B B ok
      perl B C ok

      code: java client
      ==========================================================
      import java.net.*;
      import javax.xml.parsers.*;
      import org.apache.soap.util.xml.*;
      import org.apache.soap.*;
      import org.apache.soap.rpc.*;
      import org.w3c.dom.*;
      import org.xml.sax.*;
      import org.apache.soap.encoding.*;
      import org.apache.soap.encoding.soapenc.*;
      import org.apache.soap.transport.http.SOAPHTTPConnection;

      public class testSOAP
      {

      public static void main(String[] args)
      {
      try {
      // URL targetURL = new
      URL("http://www2.ubavie.gv.at:4712/abfdv_offline/abfdv_server.pl");
      URL targetURL = new
      URL("http://edv262.ubavie.gv.at:80/~ackerl/cgi-bin/abfdv_server.pl");
      String actionURI =
      targetURL.getProtocol() + "://" +
      targetURL.getHost() + "/" +
      "abfdv";

      System.out.println( targetURL.toString() );
      System.out.println( actionURI.toString() );
      String command = "debug";
      Call call = new Call ();
      call.setTargetObjectURI ( actionURI );
      call.setMethodName ( command );
      call.setEncodingStyleURI( Constants.NS_URI_SOAP_ENC );
      SOAPHTTPConnection shc;
      shc = new SOAPHTTPConnection();
      shc.setTimeout(5000); //<-- 5 seconds
      call.setSOAPTransport(shc);
      Response resp = call.invoke (
      targetURL,
      actionURI + "#" + command
      );
      if (resp == null) {
      System.out.println( "Der Server " + targetURL.toString() + "
      hat nicht geantwortet.\n" );
      System.exit(0);
      }
      System.out.println( resp.toString() );
      if (resp.generatedFault ())
      {
      Fault fault = resp.getFault ();
      System.out.println( "Der Server vermeldet folgende(n) Fehler:"
      );
      System.out.println( "Fault Code = " + fault.getFaultCode ()
      );
      System.out.println( "Fault String = " + fault.getFaultString
      () );
      System.exit(0);
      }
      else
      {
      System.out.println( "Erfolg! Der Server uebermittelte uns
      folgende Botschaft:\n" );
      System.out.println( resp.getReturnValue() );
      System.exit(0);
      }
      }
      catch( Exception ex )
      {
      ex.printStackTrace(System.err);
      System.exit(0);
      }
      }
      }
      ==========================================================

      code: perl client
      ==========================================================
      use SOAP::Lite;
      $soap_response = SOAP::Lite
      -> uri('http://www2.ubavie.gv.at/abfdv')
      ->
      proxy('http://www2.ubavie.gv.at:4712/abfdv_offline/abfdv_server.pl')
      -> debug();
      @res = $soap_response->paramsout;
      $res = $soap_response->result;
      if( $soap_response->fault )
      {
      print join ', ',
      $soap_response->faultcode,
      $soap_response->faultstring;
      print "\n";
      }
      else
      {
      print "Result is $res, outparams are @res\n";
      }
      ==========================================================

      code: perl server
      ==========================================================
      #!/usr/bin/perl -w
      use SOAP::Transport::HTTP;
      my $server = SOAP::Transport::HTTP::CGI
      -> objects_by_reference( qw(abfdv) )
      -> dispatch_to('abfdv')
      -> handle()
      ;
      package abfdv;
      use strict;
      use vars qw(@ISA);
      BEGIN
      {
      @ISA = qw(SOAP::Server::Parameters);
      }
      sub debug
      {
      my( $self, @params ) = @_;
      my $s = join( '~~~', '', $self, @params, '' );
      return
      SOAP::Data->name( Params => $s ),
      SOAP::Data->name( PerlVersion => $] ),
      SOAP::Data->name( INC => join( '~~~', @INC ) ),
      ;
      }
      1;
      ==========================================================

      anyone got an idea?
    • cjbecjbe@yahoo.com
      that was - after all - a CR-LF problem. apacheSOAP spikes it s XML with a handfull of newlines. (a SOAP::Lite client doesn t) and in the combination IIS + Perl
      Message 2 of 3 , Sep 25, 2001
      • 0 Attachment
        that was - after all - a CR-LF problem.
        apacheSOAP spikes it's XML with a handfull of newlines.
        (a SOAP::Lite client doesn't)
        and in the combination IIS + Perl the CR-LF's got converted to CR's.
        so SOAP::Lite timed out trying to read $ENV{'CONTENT_LENGTH'} from
        STDIN, when there where (in this case) only $ENV{'CONTENT_LENGTH'}-7
        characters there

        dear paul,
        please insert a 'binmode STDIN;' into SOAP::Transport::HTTP->handle()
        and all other places where you read from STDIN

        (some extensive code for switching on binmode can be found in the CGI
        module)

        --- In soaplite@y..., cjbecjbe@y... wrote:
        > a server written in SOAP Lite seems to block - but only when the
        > server is running on a windows NT machine, and the client is written
        > in java / apacheSOAP. instead i get an error message, that the
        > webserver has killed the sever process after 15 minutes.
      • Paul Kulchenko
        Hi, cjbecjbe! ... My bad. Fixed. Thank you. What s the name I should grant credit to? Best wishes, Paul. ... __________________________________________________
        Message 3 of 3 , Sep 25, 2001
        • 0 Attachment
          Hi, cjbecjbe!

          > that was - after all - a CR-LF problem.
          > please insert a 'binmode STDIN;' into
          My bad. Fixed. Thank you. What's the name I should grant credit to?

          Best wishes, Paul.

          --- cjbecjbe@... wrote:
          > that was - after all - a CR-LF problem.
          > apacheSOAP spikes it's XML with a handfull of newlines.
          > (a SOAP::Lite client doesn't)
          > and in the combination IIS + Perl the CR-LF's got converted to
          > CR's.
          > so SOAP::Lite timed out trying to read $ENV{'CONTENT_LENGTH'} from
          > STDIN, when there where (in this case) only
          > $ENV{'CONTENT_LENGTH'}-7
          > characters there
          >
          > dear paul,
          > please insert a 'binmode STDIN;' into
          > SOAP::Transport::HTTP->handle()
          > and all other places where you read from STDIN
          >
          > (some extensive code for switching on binmode can be found in the
          > CGI
          > module)
          >
          > --- In soaplite@y..., cjbecjbe@y... wrote:
          > > a server written in SOAP Lite seems to block - but only when the
          > > server is running on a windows NT machine, and the client is
          > written
          > > in java / apacheSOAP. instead i get an error message, that the
          > > webserver has killed the sever process after 15 minutes.
          >
          >
          >
          > ------------------------ Yahoo! Groups Sponsor
          >
          > To unsubscribe from this group, send an email to:
          > soaplite-unsubscribe@yahoogroups.com
          >
          >
          >
          > Your use of Yahoo! Groups is subject to
          > http://docs.yahoo.com/info/terms/
          >
          >


          __________________________________________________
          Do You Yahoo!?
          Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger. http://im.yahoo.com
        Your message has been successfully submitted and would be delivered to recipients shortly.