You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@axis.apache.org by ba...@apache.org on 2010/11/08 17:16:10 UTC
svn commit: r1032619 - in /axis/axis2/java/core/trunk/modules:
jaxws-integration/test/org/apache/axis2/jaxws/dispatch/
jaxws/src/org/apache/axis2/jaxws/message/
metadata/src/org/apache/axis2/jaxws/description/builder/
metadata/src/org/apache/axis2/jaxw...
Author: barrettj
Date: Mon Nov 8 16:16:10 2010
New Revision: 1032619
URL: http://svn.apache.org/viewvc?rev=1032619&view=rev
Log:
AXIS2-4855. Patch contributed by Phil Adams with some additional comments and test change by Jeff Barrett. Change the JMS namespace to the value defined in the JMS spec.
Modified:
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/dispatch/SOAP12DispatchTest.java
axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/message/Protocol.java
axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/builder/MDQConstants.java
axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/validator/EndpointDescriptionValidator.java
Modified: axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/dispatch/SOAP12DispatchTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/dispatch/SOAP12DispatchTest.java?rev=1032619&r1=1032618&r2=1032619&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/dispatch/SOAP12DispatchTest.java (original)
+++ axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/dispatch/SOAP12DispatchTest.java Mon Nov 8 16:16:10 2010
@@ -149,7 +149,19 @@ public class SOAP12DispatchTest extends
/**
* Test sending a SOAP 1.2 request in PAYLOAD mode using SOAP/JMS
*/
- public void testSOAP12JMSDispatchPayloadMode() throws Exception {
+ /*
+ * This test was shown to be invalid by the changes made under Jira AXIS2-4855. Basically, this test was passing
+ * based on a bug in modules/jaxws/src/org/apache/axis2/jaxws/message/Protocol.java creating the protocol table.
+ * There is only one JMS namespace defined by the JMS spec, and it is used for both SOAP11 and SOAP12. Therefore,
+ * when the SOAP12 protocol was registered after the SOAP11 protocol, it overwrote the previous value (since the namespace
+ * is used as the key).
+ *
+ * For a WSDL-based client or service, the SOAP version is determined by the SOAP namespace used on the
+ * binding. For a WSDL-less client or service, there is no JMS spec-defined way to determine the difference. For now
+ * JAX-WS will default to SOAP11, and SOAP12 is not registered as a protocol for the JMS namespace. See AXIS2-4855
+ * for more information.
+ */
+ public void _testSOAP12JMSDispatchPayloadMode() throws Exception {
// Create the JAX-WS client needed to send the request
Service service = Service.create(QNAME_SERVICE);
service.addPort(QNAME_PORT, MDQConstants.SOAP12JMS_BINDING, URL_ENDPOINT);
Modified: axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/message/Protocol.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/message/Protocol.java?rev=1032619&r1=1032618&r2=1032619&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/message/Protocol.java (original)
+++ axis/axis2/java/core/trunk/modules/jaxws/src/org/apache/axis2/jaxws/message/Protocol.java Mon Nov 8 16:16:10 2010
@@ -61,8 +61,12 @@ public enum Protocol {
protocolMappings.put(SOAPBinding.SOAP12HTTP_BINDING, Protocol.soap12);
protocolMappings.put(SOAPBinding.SOAP12HTTP_MTOM_BINDING, Protocol.soap12);
protocolMappings.put(HTTPBinding.HTTP_BINDING, Protocol.rest);
- protocolMappings.put(MDQConstants.SOAP12JMS_BINDING, Protocol.soap12);
- protocolMappings.put(MDQConstants.SOAP12JMS_MTOM_BINDING, Protocol.soap12);
+ // There is only one binding value declared by the spec; there is no differentiation
+ // between SOAP11 and SOAP12, unlike HTTP. This may be an issue in the spec. However,
+ // for now, since the values are the same, we can only register one protocol, so we
+ // use SOAP11 (above). See Jira AXIS2-4855 for more information.
+// protocolMappings.put(MDQConstants.SOAP12JMS_BINDING, Protocol.soap12);
+// protocolMappings.put(MDQConstants.SOAP12JMS_MTOM_BINDING, Protocol.soap12);
// Add each of the URLs with a "/" at the end for flexibility
Map<String, Protocol> updates = new HashMap<String, Protocol>();
Modified: axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/builder/MDQConstants.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/builder/MDQConstants.java?rev=1032619&r1=1032618&r2=1032619&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/builder/MDQConstants.java (original)
+++ axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/builder/MDQConstants.java Mon Nov 8 16:16:10 2010
@@ -80,13 +80,16 @@ public class MDQConstants {
*/
public static final String SERVICE_REF_NAME = "org.apache.axis2.jaxws.description.builder.SERVICE_REF_NAME";
- //Represent SOAP/JMS Bindings
- //REVIEW: SOAP-JMS may be using the same NS for SOAP11 and SOAP12,
- // if so we could remove some duplicate values below
- public static final String SOAP11JMS_BINDING = "http://www.example.org/2006/06/soap/bindings/JMS/";
- public static final String SOAP12JMS_BINDING = "http://www.example.org/2006/06/soap/bindings/JMS/";
- public static final String SOAP11JMS_MTOM_BINDING = "http://http://www.example.org/2006/06/soap/bindings/JMS/?mtom=true";
- public static final String SOAP12JMS_MTOM_BINDING = "http://http://www.example.org/2006/06/soap/bindings/JMS/?mtom=true";
+ // Represent SOAP/JMS Bindings
+ // Note that currently there is only a single namespace defined for the SOAP JMS binding in the JMS spec; there is no
+ // differentiation between JMS SOAP11 or SOAP12. For a WSDL-based client or service, the SOAP level is
+ // determine by the SOAP namespace used on the binding. For a WSDL-less client or service, there is currently
+ // no way to identify SOAP11 vs SOAP12, so we will default to SOAP11. See modules/jaxws/src/org/apache/axis2/jaxws/message/Protocol.java
+ // and Jira AXIS2-4855 for more information.
+ public static final String SOAP11JMS_BINDING = "http://www.w3.org/2010/soapjms/";
+ public static final String SOAP12JMS_BINDING = SOAP11JMS_BINDING;
+ public static final String SOAP11JMS_MTOM_BINDING = "http://www.w3.org/2010/soapjms/?mtom=true";
+ public static final String SOAP12JMS_MTOM_BINDING = SOAP11JMS_MTOM_BINDING;
public static final String SOAP_HTTP_BINDING ="SOAP_HTTP_BINDING";
public static final String USE_LEGACY_WEB_METHOD_RULES_SUN = "com.sun.xml.ws.model.RuntimeModeler.legacyWebMethod";
Modified: axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/validator/EndpointDescriptionValidator.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/validator/EndpointDescriptionValidator.java?rev=1032619&r1=1032618&r2=1032619&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/validator/EndpointDescriptionValidator.java (original)
+++ axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/validator/EndpointDescriptionValidator.java Mon Nov 8 16:16:10 2010
@@ -138,7 +138,9 @@ public class EndpointDescriptionValidato
// Validate that the WSDL value is valid
else if (!SOAPBinding.SOAP11HTTP_BINDING.equals(wsdlBindingType)
&& !SOAPBinding.SOAP12HTTP_BINDING.equals(wsdlBindingType)
- && !javax.xml.ws.http.HTTPBinding.HTTP_BINDING.equals(wsdlBindingType)) {
+ && !javax.xml.ws.http.HTTPBinding.HTTP_BINDING.equals(wsdlBindingType)
+ && !MDQConstants.SOAP11JMS_BINDING.equals(wsdlBindingType)
+ && !MDQConstants.SOAP12JMS_BINDING.equals(wsdlBindingType)) {
addValidationFailure(this, "Invalid wsdl binding value specified: "
+ DescriptionUtils.mapBindingTypeAnnotationToWsdl(wsdlBindingType));
isBindingValid = false;
@@ -156,6 +158,12 @@ public class EndpointDescriptionValidato
&& bindingType.equals(HTTPBinding.HTTP_BINDING)) {
isBindingValid = true;
}
+ else if (wsdlBindingType.equals(MDQConstants.SOAP11JMS_BINDING)&& bindingType.startsWith(MDQConstants.SOAP11JMS_BINDING)) {
+ isBindingValid = true;
+ }
+ else if (wsdlBindingType.equals(MDQConstants.SOAP12JMS_BINDING)&& bindingType.startsWith(MDQConstants.SOAP12JMS_BINDING)) {
+ isBindingValid = true;
+ }
// The HTTP binding is not valid on a Java Bean SEI-based endpoint; only on a Provider based one.
else if (wsdlBindingType.equals(HTTPBinding.HTTP_BINDING) &&
endpointDesc.isEndpointBased()) {