[ Team LiB ] Previous Section Next Section

Web Services Best Practices

This section offers some practical tips on technologies and processes to utilize when designing, implementing, and deploying Web Services.

TIP

You can read several other best practices for Web Services at http://www-106.ibm.com/developerworks/views/webservices/articles.jsp?sort_order=desc&expand=&sort_by=Date&show_abstract=true&view_by=Search&search_by=Best+practices.

A good book on design patterns for Web Services is the new Paul Monday book: Web Services Patterns: Java Edition (ISBN: 1590590848).


Debugging Flag

If your Web Services are generating errors, it's quite useful to inspect the SOAP request and response messages for them. In many cases, this will lead you to the cause of the problem. The WebLogic Server Web Service architecture has the capability to print SOAP request and response messages to a command prompt. This can be performed at the server and/or the client. Add the flag -Dweblogic.webservice.verbose=true to the startup script for your client application (when using the WebLogic Server –generated proxy) or WebLogic Server. Be aware that this should be done only in the development phase of your project because of the loss in performance that results from the overhead involved in printing these debugging messages.

Ensure Interoperability

A client of a Web Service should be able to effectively access and communicate with that Web Service regardless of the language it was written in and no matter what hardware and operating system it is running on. To ensure this, keep up to date with Web Service technologies such as SOAP and WSDL, and avoid proprietary vendor extensions that do not follow these standards. The purpose of the Web Services Interoperability Organization is to track the interoperability of different Web Service implementations. Please visit its Web site at http://www.ws-i.org/. The SOAPBuilders Interoperability Lab, found at http://www.xmethods.com/ilab/, provides interoperability testing for different SOAP implementations.

Code for Failure

When your Web Service relies on other Web Services for processing, there is a probability that the external Web Service will not work as expected in the future. Be sure that you use try/catch blocks and appropriate business logic to recover gracefully from these errors.

Reduce the Amount of Network Overhead

Although your Web Service can call many other Web Services, which can then in turn call a multitude of others, the amount of network overhead involved can be prohibitively large for clients waiting for a response—especially synchronous clients. Try to reduce network overhead by executing business processes locally whenever possible.

Become More Familiar with Web Service Technologies

There are many technologies that Web Services are dependent on, such as SOAP, XML schemas, WSDL, UDDI and more. Become familiar with them as well as the WebLogic technologies, such as the web-services.xml file, the WebLogic Ant tasks, and the WebLogic Workshop runtime framework. For a complete list of Web Services technologies supported in WebLogic Server, please refer to http://dev2dev.bea.com/technologies/webservices/standards.jsp.

    [ Team LiB ] Previous Section Next Section