You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@xml.apache.org by Ackerl Werner <Ac...@ubavie.gv.at> on 2001/09/17 20:39:42 UTC
timeout - apacheSOAP client / SOAP::Lite server on NT
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
D: windows 2000sp1
iis 5.0
perl 5.6.1 Binary build 629 provided by ActiveState Tool Corp.
SOAP::Lite 0.46
tested combinations:
client client server
written machine machine result
in
java A B ok
java B B ok
perl B B ok
java A C timeout
java B C timeout
perl B C ok
java A C*) ok
java B C*) ok
perl B C*) ok
java A D timeout
java B D timeout
perl B D ok
*) SOAP::Lite standalone server; all other server implementations
are cgi scripts using apache or iis
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); file:// <file://<--> <-- 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;
==========================================================