Disable Web Services Addressing support
The Web Services Addressing (WS-Addressing) support provides mechanisms to address web services and provide addressing information in messages. WS-Addressing support is disabled by default on clients. The method for disabling WS-Addressing support on servers depends on whether the application is based on JAX-RPC or JAX-WS.
You do not have to disable WS-Addressing support even if the application does not require it, because in most cases WS-Addressing support does not have a negative impact on the running of applications. For JAX-RPC applications, disabling WS-Addressing support can be risky as this action also disables support for other specifications such as Web Services Atomic Transactions.
Tasks
- Disable WS-Addressing support for JAX-WS service providers using one of the following ways:
- Use both the Addressing and SubmissionAddressing annotations in the service code, with the enabled parameter set to false; for example:
import javax.xml.ws.soap.Addressing; @Addressing(enabled=false) @SubmissionAddressing(enabled=false) @WebService(...)- Use the <webservice-description>/<port-component>/<addressing> deployment descriptor element in the deployment descriptor for the service application; for example:
<port-component> <port-component-name>MyPort1</port-component-name> <addressing> <enabled>false</enabled> </addressing> <service-impl-bean> <servlet-link>MyPort1ImplBean</servlet-link> </service-impl-bean> </port-component>
- You do not have to take any action to disable WS-Addressing support for JAX-WS clients, because WS-Addressing support is disabled by default. However, we can programmatically specify that WS-Addressing is disabled using one of the following ways:
- Use both the AddressingFeature and SubmissionAddressingFeature classes in the client code, with the enabled parameter set to false; for example:
AddressingFeature feat = new AddressingFeature(false); SubmissionAddressingFeature feat = new AddressingFeature(false);- Use the Addressing annotation for an injected web services proxy reference; for example:
public class MyClientApplication { // Disable Addressing for a port-component-ref resource injection. @Addressing(enabled=false) @WebServiceRef(MyService.class) private MyPortType myPort; ... }- Use the <service>/<port-component>/<addressing> deployment descriptor; for example:
<service-ref> <service-ref-name>service/MyPortComponentRef</service-ref-name> <service-interface>com.example.MyService</service-ref-interface> <port-component-ref> <service-endpoint-interface>com.example.MyPortType</service-endpoint-interface> <addressing> <enabled>false</enabled> </addressing> </port-component-ref> </service-ref>
- To disable WS-Addressing support for JAX-RPC service providers or clients, set the com.ibm.ws.wsaddressingAndDependentsDisabled system property to true. For example:
java -Dcom.ibm.ws.wsaddressingAndDependentsDisabled=true ... application_nameUse this property with care because applications might require WS-Addressing message addressing properties to function correctly. Setting this property also disables support for the following specifications, which depend on the WS-Addressing support: Web Services Atomic Transactions, Web Services Business Agreement, Web Services Notification and Web Services Reliable Messaging.
By completing this task, you disabled the WS-Addressing support. Disabling WS-Addressing on clients prevents WebSphere Application Server sending WS-Addressing message addressing properties in the SOAP header of outbound web service messages. Disabling WS-Addressing on servers additionally prevents WAS processing WS-Addressing MAPs in incoming SOAP headers.
Related:
Web Services Addressing annotations Enable Web Services Addressing support for JAX-WS applications