Affects Version/s: 2.2.8
Fix Version/s: None
com.sun.xml.ws.model.JavaMethodImpl throws Exception complaining @Action (addressing action) and @WebMethod.action (SOAPAction) does not match".
The requirement of SOAPAction and wsa:Action being equivalent appears in the following specs:
Web Services Addressing 1.0 - SOAP Binding, section 4.2
Basic Profile Version 2.0, section 4.10, R2901
This issue is filed to request removing the Exception to allow these two 'action' to have different values. Following are the reasons that they don't have to be the same.
1. SOAPAction on the WSDL is described as soap:operation@soapAction attribute. SOAPAction when used with SOAP on HTTP binding is a HTTP header. The addressing action on the WSDL is described as wsdl:input@wsa:Action and wsdl:output@wsa:Action attributes on wsdl portType operation input and output. And the addressing action in a SOAP message is a soap Header. They are two different pieces in a SOAP on HTTP message described by two different artifacts on the WSDL; so they can be and should be considered two different things. Requiring them to be the same could be problematic in that one of them is a http/transport information but the other is in the soap(entity body of http).
2. When a webservice is developed from JAVA, there are different JAVA code annotations to specify SOAPAction and wsa:Action. This is well mapped to how these two actions are described on the WSDL.
3. The wsimport, the jaxws-ri tool for WSDL to JAVA code generation, does allow or does not complain when the SOAPAction and wsa:Action are different on an operation.
4. Non of the web services specification describe how the SOAPAction and wsa:Action should be used. In most of webservices implementation, the SOAPAction and wsa:Action are used for dispatching the message or resolving the targeting wsdl:operation. No matter SOAPAction or wsa:Action is used or which one is used first for dispatching, the SOAPAction, wsa:Action, and the dispatching target, which is for most cases a wsdl:operation, must have 1 to 1 to 1 mapping such that each of the SOAPAction or wsa:Action within a wsdl:portType has an unique value to map to the targeting operation. In other words, SOAPAction and wsa:Action of a wsdl:operation do NOT have to be the same, but they should map to the same targeting wsdl:operation.
5. From a practical view, there are lots of existing WSDLs produced before the Web Services Addressing 1.0 or the Basic Profile Version 2.0 were invented. Those WSDLs and their services and clients do use SOAPAction and they are working. The Web Services Addressing 1.0 and the Basic Profile Version 2.0 come in latter but impose new requirements on the existing soap:operation@soapAction of the WSDL and SOAPAction HTTP header. That means if a WSDL/service want to enable addressing, it will likely have to change some existing soapAction values on the WSDL.
An alternative is to require SOAPAction and wsa:Action have unique 1 to 1 mapping as described in #2 instead just simply being equivalent.