You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by an...@apache.org on 2007/02/28 17:05:23 UTC

svn commit: r512820 - /incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java

Author: antelder
Date: Wed Feb 28 08:05:22 2007
New Revision: 512820

URL: http://svn.apache.org/viewvc?view=rev&rev=512820
Log:
Fix services using no-args <binding.ws>

Modified:
    incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java

Modified: incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java?view=diff&rev=512820&r1=512819&r2=512820
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java (original)
+++ incubator/tuscany/branches/sca-java-integration/sca/extensions/axis2/binding/src/main/java/org/apache/tuscany/binding/axis2/Axis2BindingBuilder.java Wed Feb 28 08:05:22 2007
@@ -102,6 +102,16 @@
                 outboundContract.setDataBinding(OM_DATA_BINDING);
             }
 
+            // TODO: TUSCANY-xxx, <binding.ws> with no wsdl only works with <interface.wsdl>
+            if (wsBinding.getWSDLDefinition() == null) {
+                if (outboundContract instanceof WSDLServiceContract) {
+                    String ns = ((WSDLServiceContract)outboundContract).getPortType().getQName().getNamespaceURI();
+                    wsBinding.setWSDLDefinition(wsdlReg.getDefinition(ns));
+                } else {
+                    throw new IllegalStateException("<binding.ws> with no WSDL requires using <interface.wsdl>");
+                }
+            }
+
             // FIXME: We need to define how the WSDL PortType is honored in the case that
             // both the service.ws and interface.wsdl are in place.
             // The WSDL portType from the WSDL Port decides the incoming SOAP message format
@@ -154,9 +164,13 @@
             }
 
             // TODO: TUSCANY-xxx, <binding.ws> with no wsdl only works with <interface.wsdl>
-            if (wsBinding.getWSDLDefinition() == null && inboundContract instanceof WSDLServiceContract) {
-                String ns = ((WSDLServiceContract)inboundContract).getPortType().getQName().getNamespaceURI();
-                wsBinding.setWSDLDefinition(wsdlReg.getDefinition(ns));
+            if (wsBinding.getWSDLDefinition() == null) {
+                if (inboundContract instanceof WSDLServiceContract) {
+                    String ns = ((WSDLServiceContract)inboundContract).getPortType().getQName().getNamespaceURI();
+                    wsBinding.setWSDLDefinition(wsdlReg.getDefinition(ns));
+                } else {
+                    throw new IllegalStateException("<binding.ws> with no WSDL requires using <interface.wsdl>");
+                }
             }
 
             // FIXME: We need to define how the WSDL PortType is honored in the case that



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org