Web services performance best practices

Learn about best practices for the performance of web services applications.

Web services are developed and deployed based on standards provided by the Web Services for Java™ Platform, Enterprise Edition (Java EE) specification and the Java API for XML-Based Web Services (JAX-WS) and Java Architecture for XML Binding (JAXB) programming models, and is the mechanism used to access a web service. Performance considerations for web services supported by this specification are explained.

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 Server runtime, the SOAP message is translated based on the Java EE request. The Java EE-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 the information on monitoring the performance of Web services applications to learn more about analyzing and tuning Web services.

If you are using a web service application that was developed for a WebSphere Application Server version prior to Version 6, you can achieve better performance by running the wsdeploy command. The wsdeploy command regenerates web services artifact classes to increase the serialization and deserialization performance.

The wsdeploy command is supported by Java API for XML-based RPC (JAX-RPC) applications. The Java API for XML-Based Web Services (JAX-WS) programming model that is implemented by the application server does not support the wsdeploy command. If your web services application contains only JAX-WS endpoints, you do not need to run the wsdeploy command, as this command is used to process only JAX-RPC endpoints.

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.

Optimize JAX-WS web services performance for WebSphere Application Server

Depending on your web services usage scenario, you can use the following JVM custom properties to optimize JAX-WS web services performance. After you change the values of these JVM custom properties, WebSphere Application Server must be restarted for the changes to take effect.

  • In WebSphere Application Server 8.5.5.2 or later, use the following custom property for JAXB performance optimization:
    com.ibm.websphere.webservices.jaxwsOptimizeLevelOne
    Configure this custom property to true to turn on JAX-WS performance optimization at level one.
    The default value is false.
    Note: When this custom property is enabled, some non-specification JAXB behavior might be changed. Disable the property if your application has a dependency on such non-specification behavior and you find that it causes your application to run unsuccessfully.
    Note: You might find that the order of XML tags in a SOAP message is different from previous versions.
  • In WebSphere Application Server 8.5.5.0 or later, use the following custom properties for JAX-WS engine global handlers performance optimization. Be careful when you enable the following custom properties. Otherwise, the corresponding web services function will not work. In addition, the following JVM properties will not impact the user-defined JAX-WS handlers.
    com.ibm.ws.websvcs.disableWSDMHandler
    Use this property to control whether to disable web services JAX-WS engine handlers for the WSDM (Web Services Distributed Management) function. The default value is false.
    com.ibm.ws.websvcs.disableWSSecurityHandler
    Use this property to control whether to disable web services JAX-WS engine handlers for the WS-Security function. The default value is false.
    com.ibm.ws.websvcs.disableWSTXHandler
    Use this property to control whether to disable web services JAX-WS engine handlers for the WS-Transaction function. The default value is false.
    com.ibm.ws.websvcs.disableWSRMHandler
    Use this property to control whether to disable web services JAX-WS engine handlers for the WS-RM function. The default value is false.
    com.ibm.ws.websvcs.disablePMIHandler
    Use this property to control whether to disable web services JAX-WS engine handlers for the web service PMI data collection function. The default value is false.
    com.ibm.ws.websvcs.disablePMIRMHandler
    Use this property to control whether to disable web services JAX-WS engine handlers for the web service PMI data collection for the WS-RM function. The default value is false.
    com.ibm.ws.websvcs.disableAddressingHandler
    Use this property to control whether to disable web services JAX-WS engine handlers for the WS-Addressing function. The default value is false.
    com.ibm.ws.websvcs.disableDefaultGlobalHandlers
    Use this property to control whether to disable all default web services JAX-WS engine handlers. If this property was configured to true, then it overrides the value of the following custom properties and sets their values to true.
    • com.ibm.ws.websvcs.disableWSDMHandler
    • com.ibm.ws.websvcs.disableWSSecurityHandler
    • com.ibm.ws.websvcs.disableWSTXHandler
    • com.ibm.ws.websvcs.disableWSRMHandler
    • com.ibm.ws.websvcs.disablePMIHandler
    • com.ibm.ws.websvcs.disablePMIRMHandler
    • com.ibm.ws.websvcs.disableAddressingHandler
    The default value of this custom property is false.

Additional web services performance features that you can leverage

  • In-process optimizations for web services to optimize the communication path between a web services client application and a web container that are located in the same application server process. For details about enabling this feature, see the web services client to web container optimized communication information.
  • Access to web services over multiple transport protocols extends existing Java API for XML-based remote procedure call (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 the RMI-IIOP using JAX-RPC information.
  • SOAP with Attachments API for Java (SAAJ) Version 1.2 provides a programming model for web services relative to JAX-RPC. The SAAJ API provides features to create and process SOAP requests using an XML API. SAAJ supports just-in-time parsing and other internal algorithms. For information about SAAJ or web services programming, see the SOAP with Attachments API for Java information.

    SAAJ 1.3 provides support for web services that are developed and implemented based on the Java API for XML Web Services (JAX-WS) programming model.

  • 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.

IBM® provides considerable documentation and best practices for web services application design and development that details these items and more.