Skip to main content

4 sec on proxy creation

8 replies [Last post]
dsanatin
Offline
Joined: 2008-08-28

Hi Metro support,

My wsdl has about 45 operations. It takes 4 sec to create the client proxy (8 sec - for the first proxy). JAX-RPC (JWSDP) spends 8-16 msecs on it!!!

Please, could you advise how to solve this problem? 4 sec is about 200% of request processing time.

Thanks,
Dmitry

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
slonopotamus
Offline
Joined: 2006-02-28

You should not want to create new service for each request.

dsanatin
Offline
Joined: 2008-08-28

I use one service. There is problem with time of proxy creation.

dsanatin
Offline
Joined: 2008-08-28

Hi All,

Thank you for all your efforts.

Rama explained me the reason of this. Metro spends most of the time in creating JAXBContext. It seems reasonable because of huge the number of classes. Later, it doesn't take any time creating proxies from that service instance.

Regards,
Dmitry

ramapulavarthi
Offline
Joined: 2004-06-01

JAX-WS fetches the wsdl at runtime each time a Service instance is created.
See if packaging the wsdl locally can make it any better.
You can find information about it in Vivek's blog (http://weblogs.java.net/blog/vivekp/archive/2007/06/portable_client.html) or https://metro.dev.java.net/guide/Developing_client_application_with_loca...

dsanatin
Offline
Joined: 2008-08-28

Thanks for reply.WSDL was placed locally when I tested it. WsdlLocation switch was used for this. 4 sec is terrible time. I did not expect such time from reference implementation.

ramapulavarthi
Offline
Joined: 2004-06-01

If you are packaging the wsdl locally it should not take that long.
Are you recreating the service instance each time?
Is it possible to attach the wsdl or send the wsdl? Can you do profiling to see where its spending time and give us more info.

dsanatin
Offline
Joined: 2008-08-28

We have huge load and use many servers. So we need to create several services (as we use threads) for each server.

I sent wsdl by e-mail as requested.

Thanks,
Dmitry

jitu
Offline
Joined: 2003-06-14

Rama is looking into your wsdl. But I don't follow your comment about
"So we need to create several services (as we use threads) for each server. "

You could use a Service and create a proxy for each thread using the same Service instance. You could also set the endpoint address for each proxy, if required.

HelloService svc = new HelloService()

// thread-1
proxy1 = svc.getHelloPort();
// set endpoint address1 if required
proxy1.echo();
proxy1.echo();

// thread-2
proxy2 = svc.getHelloPort();
// set endpoint address2 if required
proxy2.echo();
proxy2.echo();

In fact most of the cases, you should be able to share the same proxy instance in multiple threads.