Enable and disabling Web Services Addressing support
Web Services Addressing (WS-Addressing) is a Worldwide Web Consortium (W3C) specification that aids interoperability between Web services, by defining a standard way to address Web services and by providing addressing information in messages. To enable the WS-Addressing support, either configure the Web Services Description Language (WSDL) file for a service that runs on WAS, or use the WS-Addressing API or system programming interface (SPI) to add WS-Addressing properties in a WAS client.
Overview
Perform this task to enable the WS-Addressing support, either as a service provider or as a client of a service provided by another party. This task also describes how to disable the WS-Addressing support, which can improve performance for those applications that do not use WS-Addressing or any protocol that depends on the WS-Addressing support.
If you are creating a Web service, you can enable the WS-Addressing support during development of the service, by including the UsingAddressing extensibility element in the WSDL binding element for the service. This element contains a required attribute that has a value of either false, which specifies that WS-Addressing information is accepted but not required in incoming messages, or true, which specifies that WS-Addressing information is required in incoming messages. The default value is false. Messages from WAS V6.1 clients always include WS-Addressing information if your service WSDL file includes the UsingAddressing element, regardless of the value of the required attribute.
If you are creating a client application to use a service from another provider, you might not have access to the WSDL file for the service, or the service might use a version of WSDL that does not support the UsingAddressing element (if the service is not running on a current version of WAS). However, you can still enable WS-Addressing support, during run time, by setting WS-Addressing properties on the JAX-RPC Stub or Call object that you use to communicate with the service. The following table summarizes the behavior of the WS-Addressing support in each of the scenarios mentioned previously.
Table 1. The behavior of the WS-Addressing support in WAS The WSDL for the service specifies UsingAddressing required = "false" The WSDL for the service specifies UsingAddressing required = "true" The WSDL for the service does not specify UsingAddressing A client sends a message that contains WS-Addressing information The WS-Addressing information is processed by WebSphere Application Server. The WS-Addressing information is processed by WebSphere Application Server. The WS-Addressing information is processed by WebSphere Application Server. A non-WAS client sends a message that does not contain WS-Addressing information The message is accepted. The service returns a fault. The message is accepted. A WAS client sends a message, without specifying addressing properties The message automatically contains the mandatory WS-Addressing information, as defined in the WS-Addressing specification. The information is processed by WAS. The message automatically contains the mandatory WS-Addressing information, as defined in the WS-Addressing specification. The information is processed by WAS. WS-Addressing information is not added by WebSphere Application Server. The message is accepted.
Procedure
- Optional: To enable WS-Addressing support from the server by configuring the WSDL file, perform the following steps:
- Ensure that the WSDL file for the service contains the UsingAddressing extensibility element on the binding element. If you generated the WSDL file using the Java2WSDL tool, this element is automatically added for you. If you created the WSDL file yourself, for use with the WSDL2Java tool, add the extensibility element. The UsingAddressing element has a required attribute with a default value of false. For example:
<wsdl:binding name="TestServiceSoapBinding" type="intf:TestService"> <wsaw:UsingAddressing wsdl:required="false" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"/> <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <wsdl:operation name="invokeInstance"> ... </wsdl:operation> </wsdl:binding>This code indicates that the endpoint understands WS-Addressing information, but that this information is not required.
- Optional: To specify that WS-Addressing information is required, change the value of the required attribute to true. If the endpoint receives a message that does not contain the mandatory WS-Addressing elements within the message header, the endpoint returns a fault message, as defined in the WS-Addressing specification.
WebSphere Application Server clients and Proxy Server for IBM WebSphere Application Server always send WS-Addressing conformant messages to endpoints with bindings that specify the UsingAddressing element.
- Optional: To enable WS-Addressing support from a WAS client, use the WS-Addressing API or SPI provided to associate one or more WS-Addressing properties with the JAX-RPC Stub or Call object that is used to send messages to the endpoint.
These properties become message addressing properties (MAPs) in the SOAP message header. If the node that receives the message is a WAS node, it processes the incoming MAPs in accordance with the WS-Addressing specification, even if the service does not have a UsingAddressing element in its WSDL file.
Use this method when communicating with endpoints that use earlier versions of the WS-Addressing specification (for example:
UsingAddressing element, or when the WSDL file for the target endpoint is not available to the client.
Results
WS-Addressing properties are now included in the SOAP message header, and are processed by the server on receipt of the message. To disable WS-Addressing support, set the following system property:
com.ibm.ws.wsaddressingAndDependents.disabled=trueFor example:java -Dcom.ibm.ws.wsaddressingAndDependents.disabled=true ... applicationSetting this property in the client or server prevents WAS sending WS-Addressing message addressing properties (MAPs) in the SOAP header of outbound Web service messages. Setting this property in the server additionally prevents WAS processing WS-Addressing MAPs in incoming SOAP headers.Use this property with care because applications might require WS-Addressing MAPs to function correctly. Setting this property also disables WAS support for the following specifications, which depend on the WS-Addressing support: Web Services Atomic Transactions, Web Services Business Agreement and Web Services Notification.
Related tasks
Developing Applications that use Web Services Addressing
Related Reference
Web Services Addressing SPI