Hi, I implemented a static stub client, and invoked a web service. On runtime, It takes 3 seconds to perform functions up to invoking of hello.sayHello() function. Also invoking of sayHello function takes 3 seconds. So, calling a web service takes 6 seconds in this example. Don't you think this is too much (especially the first part up to the invoking of the service) ? Is there a better way that takes less time to invoke a service? The code is below. (this is the example on the tutorial)
Onur
public class StaticStubHello {
private String endpointAddress;
public static void main(String[] args) {
String endPt="
http://localhost:8080/jaxrpc-HelloWorld/hello";
System.out.println("Endpoint address = "+ endPt);
try {
long t1=System.currentTimeMillis();
Stub stub = createProxy();
stub._setProperty(javax.xml.rpc.Stub.ENDPOINT_ADDRESS_PROPERTY,
endPt);
HelloIF hello = (HelloIF) stub;
long t2=System.currentTimeMillis();
String result= hello.sayHello("Duke!");
long t3=System.currentTimeMillis();
System.out.println(result + " "+(t2-t1)+" "+(t3-t2));
} catch (Exception ex) {
ex.printStackTrace();
}
}
private static Stub createProxy() {
// Note: MyHelloService_Impl is implementation-specific.
HelloWorldService_Impl x=new HelloWorldService_Impl();
return (Stub) (x.getHelloIFPort());
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jax-rpc.dev.java.net
For additional commands, e-mail: users-help_at_jax-rpc.dev.java.net