Hi,
I deployed simple web serice (Calculator) using wsdd.
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<service name="C" provider="java:RPC">
<parameter name="className" value="com.my.Calculator"/>
<parameter name="allowedMethods" value="*"/>
<parameter name="scope" value="session"/>
</service>
</deployment>
Then i have a client in java which is trying to invoke add method of this
service 30 times like that:
(..i am trying to pretend 30 users clicking add button ..)
...
for ( int i = 0 ; i < 30 ; i++)
{
Zad z = new Zad(i1.intValue(), i2.intValue());
z.start();
}
...
class Zad extends Thread
{
int a, b;
public Zad(int a, int b) { this.a = a; this.b = b; }
public void run()
{ try
{
String endpoint = "http://localhost:8080/axis/services/C";
Integer i1 = new Integer(a);
Integer i2 = new Integer(b);
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setOperationName( "add" );
call.addParameter( "op1", XMLType.XSD_INT, ParameterMode.IN );
call.addParameter( "op2", XMLType.XSD_INT, ParameterMode.IN );
call.setReturnType( XMLType.XSD_INT );
Integer ret = (Integer)call.invoke( new Object [] { i1, i2 });
System.out.println("Got result : " + ret);
}catch(Exception e) { e.printStackTrace(); }
}
}
but i've got an Exception after some well done adds
Got result: 2
Got result: 2
...
Got result: 2
Got result: 2
AxisFault
....
stackTrace: java.net.ConnectionException: Connection refuse: connect
.....
If anyone know, am i able to invoke 100 add methods (of my calculator
service) at one time?
soppose it is a public service and 100 users at one time would like to add
some integers.
darek