Performance Problems in Java Applications due to Serialization of many Items with xs:nil value of true
Java applications may take a long time to run due to the serialization of a large number of items that have the xs:nil attribute value of true
.
To solve this issue in applications that use Axis 1.4, add the following code (for each service used) to the application:
AxisEngine e = <sdkServiceLocator>.getEngine();
e.setOption(AxisEngine.PROP_SEND_NIL, Boolean.FALSE);
To disable suppression of null values, change the setOption
setting from Boolean.FALSE
to Boolean.TRUE
.
An example of the code to suppress elements in contentManagerService
requests is
shown here.
import org.apache.axis.AxisEngine;
...
private ContentManagerService_ServiceLocator cmServiceLocator = null;
private ContentManagerService_PortType cmService = null;
cmServiceLocator = new ContentManagerService_ServiceLocator();
cmService = cmServiceLocator.getcontentManagerService(serverURL);
...
cmServiceLocator = new ContentManagerService_ServiceLocator();
cmService = cmServiceLocator.getcontentManagerService(serverURL);
...
AxisEngine e = cmServiceLocator.getEngine();
e.setOption(AxisEngine.PROP_SEND_NIL, Boolean.FALSE);
With this modification, SOAP elements like the following will be suppressed:
<dataEncoding xsi:type="ns5:encodingEnum" xsi:nil="true"/>