File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes Design Pattern for Web Service Consumer Component Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Design Pattern for Web Service Consumer Component" Watch "Design Pattern for Web Service Consumer Component" New topic

Design Pattern for Web Service Consumer Component

Alka Parveen

Joined: Oct 29, 2007
Posts: 5
I want to build a component more like a library which consumes the web service and provide some re usable functions to interact with it. I want to build this library to use with all the applications that was previously using that web service. I am new to designing the web service consumer components so, kindly help me with the design that is feasible for this structure. Which kind of design pattern i can use for it or any specific implementation of it?

Thanks for all your help,

Peer Reynders

Joined: Aug 19, 2005
Posts: 2933
Basically what you are proposing to implement is a Business Delegate which in itself uses aspects of the Facade and Adapter pattern. Business Delegates are used to decouple the core business logic from the complexity of dealing with distributed functionality that may be exposed as EJBs, Message beans, or web services, etc.

The main challenge you will be facing is that most SOAP web service toolkits will provide their own infrastructure code. Each application server development environment will have its own SOAP toolkit and infrastructure code - so as a rule any "component" built with these tools will not be portable between application servers much less to standalone clients. If portability is a requirement, you either have to use an independent SOAP toolkit that is redistributed with your client package or develop your own infrastructure code based on a lower level API like SAAJ or even URLConnections with the XML APIs (both of which will duplicate features that are already present in the various development environments).

See also: Portable J2EE 1.4 Web Services?

Facade pattern and Web services
Alka Parveen

Joined: Oct 29, 2007
Posts: 5
Thanks peer.

Portability is not actually the requirement (atleast not for now). I will be using this library or component on one application server(Weblogic) only with other applications(portlets) deployed on that. I am very new to web services so if you have found any issues previously with any of these kind of stuff that can help, kindly share.

Thanks for all your help.

I agree. Here's the link:
subject: Design Pattern for Web Service Consumer Component
jQuery in Action, 3rd edition