Web services performance is affected primarily by these characteristics of the XML documents that are sent to Web services:
<primaryObject> <groupObject> <singleObject/> <singleObject/> </groupObject> </primaryObject>
In addition, a Web services engine contains three major pressure points that define the performance of Web services:
Web services best practices
To optimize Web services performance, follow these general guidelines:
Use WebSphere Application Server - Express Web services instead of SOAP
The WebSphere Application Server - Express Web services implementation performs better than the SOAP implementation based on Apache SOAP. WebSphere Application Server - Express includes support for the Apache SOAP implementation so that you can run existing Web services applications.
Avoid large or complex XML documents
The performance of Web services is directly related to the size and complexity of the XML document that is transferred. As input documents increase in size or number of elements, they require more processing for parsing and deserialization. As output documents increase in size or number of elements, they require more processing for serialization.
Avoid small, frequent requests
By definition, every Web services request is a remote request. These requests usually involve the Web container in addition to the XML overhead of parsing and deserialization. If you need to send or retrieve a 50K object that has 10 properties that are each 5K long, you can retrieve the object in several ways, such as:
Because of the overhead associated with the Web container, it is more efficient to transfer a single 50K request than several smaller requests.
Limit the level of nesting in XML documents
Increasing the level of object nesting results in an increase in the number of objects that are deserialized and created when a request is processed. An object that is composed only of primitive types or strings is processed more efficiently than an object of a similar size that is composed of deeply nested Java objects.
Use WebSphere Application Server - Express custom serializers
The WebSphere Application Server - Express Web services engine provides serialization and deserialization helpers that improve runtime performance for business objects. These custom serializer and deserializer helpers specifically describe an object's properties. As a result, the Web services runtime consumes fewer resources to obtain information about the object.
When possible, use literal encoding instead of SOAP encoding
Literal and SOAP encoding are alternate forms for encoding Web services requests and responses. Each element in the SOAP body includes the XML schema definition type of the data element. SOAP encoding requires this information to make the XML document self-defining. SOAP encoding with the embedded data types increases the amount of data transferred in the Web services request.
Use descriptive but short property names
Web services is an XML text-based exchange protocol, and the names of variables and properties are included in the XML for the SOAP body portion of the message. Longer property names increase the size of the XML document.