You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by rf...@apache.org on 2006/10/12 20:04:52 UTC

svn commit: r463354 - /incubator/tuscany/java/sca/services/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/WebServiceBindingLoader.java

Author: rfeng
Date: Thu Oct 12 11:04:52 2006
New Revision: 463354

URL: http://svn.apache.org/viewvc?view=rev&rev=463354
Log:
Add check to make sure the WebServiceBinding is valid
If it returns null, it will confuse the composite loader to take it as bindingless

Modified:
    incubator/tuscany/java/sca/services/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/WebServiceBindingLoader.java

Modified: incubator/tuscany/java/sca/services/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/WebServiceBindingLoader.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/services/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/WebServiceBindingLoader.java?view=diff&rev=463354&r1=463353&r2=463354
==============================================================================
--- incubator/tuscany/java/sca/services/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/WebServiceBindingLoader.java (original)
+++ incubator/tuscany/java/sca/services/bindings/binding.axis2/src/main/java/org/apache/tuscany/binding/axis2/WebServiceBindingLoader.java Thu Oct 12 11:04:52 2006
@@ -81,16 +81,16 @@
     }
 
     @SuppressWarnings("unchecked")
-    private WebServiceBinding createBinding(String port, String portURI, String wsdlLocation, DeploymentContext deploymentContext)
-        throws WSDLException, IOException {
+    private WebServiceBinding createBinding(String uri, String endpoint, String wsdlLocation, DeploymentContext deploymentContext)
+        throws WSDLException, IOException, LoaderException {
         // Get the WSDL port namespace and name
-        if (port == null && portURI != null) {
-            int h = portURI.indexOf('#');
+        if (uri == null && endpoint != null) {
+            int h = endpoint.indexOf('#');
             String serviceName;
             String portName;
 
-            String namespace = portURI.substring(0, h);
-            String fragment = portURI.substring(h + 1);
+            String namespace = endpoint.substring(0, h);
+            String fragment = endpoint.substring(h + 1);
             if (fragment.startsWith("wsdl.endpoint(") && fragment.endsWith(")")) {
                 fragment = fragment.substring(14, fragment.length() - 1);
                 int slash = fragment.indexOf('/');
@@ -108,7 +108,7 @@
             // FIXME need to find out how to get wsdl and what context to use --- terrible hack attack!
             if (null == wsdlLocation) {
                 throw new Axis2BindingRunTimeException(
-                        "Failed to determin wsdl location on binding. Try specifying 'location' attribute on  binding.");
+                        "Failed to determine wsdl location on binding. Try specifying 'location' attribute on  binding.");
             }    
             Definition definition =
                     wsdlDefinitionRegistry.loadDefinition(namespace+" "+wsdlLocation, deploymentContext.getClassLoader());
@@ -130,13 +130,13 @@
                 }
             }
             if (thePort == null) {
-                throw new IllegalArgumentException("Cannot find WSDL port " + portURI);
+                throw new IllegalArgumentException("Cannot find WSDL port " + endpoint);
 
             }
-            return new WebServiceBinding(definition, thePort, port, portURI, service);
+            return new WebServiceBinding(definition, thePort, uri, endpoint, service);
         }
         // FIXME: Find the first port?
-        return null;
+        throw new LoaderException("Web Service endpoint cannot be resolved: " + endpoint);
 
     }
 



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