Check for a behavior change in SOAP Action set on outbound messages

The behavior has changed in WebSphere Application Server V8 in how the SOAP Action setting is determined on outbound messages for JAX-WS Dispatch clients. In releases previous to V8, if a SOAP Action is not provided by the Dispatch client application, the JAX-WS runtime environment does not send the correct SOAP Action on the outbound message. Instead, it sets the action to an anonymous operation. Now in V8, if the SOAP Action is not provided by the client application, the JAX-WS runtime environment will parse the outgoing message to determine the operation being invoked and use that to determine the appropriate value for SOAP Action.

This rule flags calls to create a Dispatch client when:

Best coding practices for WebSphere Application Server traditional and Liberty is for the client application to provide a SOAP Action with the JAX-WS javax.xml.ws.BindingProvider properties SOAPACTION_USE_PROPERTY and the SOAPACTION_URI_PROPERTY . The provided SOAP Action will be used and parsing of the outbound message will not occur regardless of the setting of the DISPATCH_CLIENT_OUTBOUND_RESOLUTION property.

This example shows best practice code with the SOAP Action set on the request context. If the SOAPACTION_URI_PROPERTY is not set or if SOAPACTION_USE_PROPERTY is set to false , the call to the createDispatch() method will be flagged by this rule.

Example:

//Create a dispatch instance
Dispatch<SOAPMessage> dispatch =
service.createDispatch(portName, SOAPMessage.class, Service.Mode.MESSAGE);

// Use Dispatch as BindingProvider
BindingProvider bp = (BindingProvider) dispatch;

// Configure RequestContext to send SOAPAction HTTP Header
Map<String, Object> rc = bp.getRequestContext();
rc.put(BindingProvider.SOAPACTION_USE_PROPERTY, Boolean.TRUE);
rc.put(BindingProvider.SOAPACTION_URI_PROPERTY, "hello");

Since this parsing can be expensive, a property can be set on WebSphere Application Server traditional at the System level (to always disable the parsing) or on the JAX-WS Request Message Context (to disable parsing on a per-message basis). If parsing is disabled, the SOAP Action in the outbound message will continue to be set to an anonymous operation as before. The disabling property is defined as constant org.apache.axis2.jaxws.Constants.DISPATCH_CLIENT_OUTBOUND_RESOLUTION with a String value of jaxws.dispatch.outbound.operation.resolution.enable . If the property is not set, it is interpreted as the String true , enabling the outbound operation resolution. Setting the property to false will disable the outbound operation resolution.

For additional information see: