Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Web service client design pattern (best practice)

I have a web service deployed and ready to use. The client application is going to use this service synchronously and extremely frequent. The amount of data returned from the web service is also considerable.

The web service client is a web application (liferay portlet). I have generated the client part with axis inside eclipse.

In my first tests, in each request I am instantiating a new ServiceProxy and calling its methods. I am not sure about robustness and reliability of this structure (making a new proxy object every single time).

I changed it to static classes with singleton proxy, but I am not sure what will happen during simultaneous calls of web application client (concurrency issues).

I want the design to decouple my web application from web service client and have something like client proxy cache (not data cache as my application is real time) or some thing similar.

I think there should be a design pattern or a best practice for web service client parts.

like image 923
Sina Jahan Avatar asked Oct 18 '10 15:10

Sina Jahan


1 Answers

Looks like your web service uses HTTP protocol, so no reason to have some proxy cache or something, the connection is created on each call, so you can call your once initialized WS client instance concurrently.

But anyhow you will pay 200ms for each call (from my practice), and it is mostly XML processing if network is super.

like image 130
zaletniy Avatar answered Sep 20 '22 15:09

zaletniy