Web services performance best practices

Web services are developed and deployed based on standards provided by the Web Services for J2EE specification, as is the mechanism used to access a Web service. This article explains performance considerations for Web services supported by this specification.

When you develop or deploy a Web service, several artifacts are required, including a Web Services Description Language (WSDL) file. The WSDL file describes the format and syntax of the Web service input and output SOAP messages. When a Web service is implemented in the WebSphere Application Service runtime, the SOAP message is translated based on the J2EE request. The J2EE-based response is then translated back to a SOAP message.

The most critical performance consideration is the translation between the XML-based SOAP message and the Java object. Performance is high for a Web service implementation in WebSphere Application Server, however, application design, deployment and tuning can be improved. See Monitoring the performance of Web services applications for more information about analyzing and tuning Web services.

If you are using Web service application that was developed for a WAS version prior to v6, one can achieve better performance by running the wsdeploy command. The wsdeploy command regenerates Web services artifact classes to increase the serialization and deserialization performance.

 

Basic considerations for a high-performance Web services application

The

following are basic considerations you should know when designing a Web services application:

  • Reduce the Web services requests by using a few highly functional APIs, rather than several simple APIs.

  • Design your WSDL file interface to limit the size and complexity of SOAP messages.

  • Use the document/literal style argument when you generate the WSDL file.

  • Leverage the caching capabilities offered for WebSphere Application Server.

  • Test the performance of your Web service.

 

Additional Web services performance features that one can

leverage

  • In-process optimizations for Web services to optimize communication path between a Web services client application and a Web container that are located in the same application server process. For details and enabling this feature see Web services client to Web container optimized communication

  • Access to Web services over multiple transport protocols extends existing JAX-RPC capabilities to support non-SOAP bindings such as RMI/IIOP and JMS. These alternative transports can improve performance and quality of service aspects for Web services. For more detailed information see RMI-IIOP using JAX-RPC.

  • The SOAP with Attachments API for Java (SAAJ) 1.2 provides a low-level programming model for Web services relative to JAX-RPC. The SAAJ 1.2 API provides features to create and process SOAP requests using a low-level XML API. SAAJ 1.2 supports just-in-time parsing and other internal algorithms. For information about SAAJ 1.2 or Web services programming see SOAP with Attachments API for Java.

  • The Web services tooling generates higher performance custom deserializers for all JAX-RPC beans. Redeploying a V5.x application into the V6 runtime can decrease the processing time for large messages.

  • Serialization and deserialization runtime is enhanced to cache frequently used serializers and deserializers. This can decrease the processing time for large messages.

  • The performance of WS-security encryption and digital signature validation is improved because of the use of the SAAJ 1.2 implementation.

IBM provides considerable documentation and best practices for Web services application design and development that details these items and more. For a list of key Web sites that discuss performance best practices, see Web services: Resources for learning.