users@jax-rpc.java.net

Re: jax-rpc performance problems

From: Doug Kohlert <Doug.Kohlert_at_Sun.COM>
Date: Mon, 04 Oct 2004 12:49:38 -0700

Onur,
Part of the problem is that you are initializing the entire jaxrpc runtime
for one call. If you made a second call it should take significantly less time.

Onur Sencer wrote:

> 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

-- 
Doug Kohlert
Java Software Division
Sun Microsystems, Inc.
phone: 503 345-9806
---------------------------------------------------------------------
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