You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by ba...@apache.org on 2008/01/11 19:40:11 UTC

svn commit: r611255 - in /webservices/axis2/trunk/java/modules: jaxws/test/org/apache/axis2/jaxws/spi/ metadata/src/org/apache/axis2/jaxws/description/impl/

Author: barrettj
Date: Fri Jan 11 10:40:08 2008
New Revision: 611255

URL: http://svn.apache.org/viewvc?rev=611255&view=rev
Log:
Fix for adding an extra "/" on path names on *IX systems.

Modified:
    webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/spi/ClientMetadataTest.java
    webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/DescriptionFactoryImpl.java
    webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java

Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/spi/ClientMetadataTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/spi/ClientMetadataTest.java?rev=611255&r1=611254&r2=611255&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/spi/ClientMetadataTest.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/spi/ClientMetadataTest.java Fri Jan 11 10:40:08 2008
@@ -524,7 +524,16 @@
         // If the wsdlLocation in the composite specifies a protocol (like file: or http:) then
         // it should be used as-is.  Otherwise (as shown by the other tests), it is treated as
         // a path on the local filesystem.
-        String fullWsdlLocation = "file:/" + getWsdlLocation(overridenWsdl);
+        String wsdlLocation = getWsdlLocation(overridenWsdl);
+        // This check is necessary because Unix/Linux file paths begin
+        // with a '/'. When adding the prefix 'jar:file:/' we may end
+        // up with '//' after the 'file:' part. This causes the URL 
+        // object to treat this like a remote resource
+        if(wsdlLocation.indexOf("/") == 0) {
+            wsdlLocation = wsdlLocation.substring(1, wsdlLocation.length());
+        }
+
+        String fullWsdlLocation = "file:/" + wsdlLocation;
         WebServiceClientAnnot wsClientAnno = WebServiceClientAnnot.createWebServiceClientAnnotImpl(null, null, fullWsdlLocation);
         composite.setWebServiceClientAnnot(wsClientAnno);
         ServiceDelegate.setServiceMetadata(composite);
@@ -565,7 +574,16 @@
      */
     public void testInvalidWsdlLocationOverrideWithProtocol() {
         DescriptionBuilderComposite composite = new DescriptionBuilderComposite();
-        String fullWsdlLocation = "http:/" + getWsdlLocation("InvalidFileName.wsdl");
+        String wsdlLocation = getWsdlLocation("InvalidFileName.wsdl");
+        // This check is necessary because Unix/Linux file paths begin
+        // with a '/'. When adding the prefix 'jar:file:/' we may end
+        // up with '//' after the 'file:' part. This causes the URL 
+        // object to treat this like a remote resource
+        if(wsdlLocation.indexOf("/") == 0) {
+            wsdlLocation = wsdlLocation.substring(1, wsdlLocation.length());
+        }
+
+        String fullWsdlLocation = "http:/" + wsdlLocation;
         
         WebServiceClientAnnot wsClientAnno = WebServiceClientAnnot.createWebServiceClientAnnotImpl(null, null, fullWsdlLocation);
         composite.setWebServiceClientAnnot(wsClientAnno);

Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/DescriptionFactoryImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/DescriptionFactoryImpl.java?rev=611255&r1=611254&r2=611255&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/DescriptionFactoryImpl.java (original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/DescriptionFactoryImpl.java Fri Jan 11 10:40:08 2008
@@ -120,7 +120,7 @@
                         log.debug("Client-side service description created with service class: " + serviceClass
                                   + ", Service QN: " + serviceQName
                                   + ", and DBC: " + sparseComposite);
-                        log.debug(serviceDesc.toString());
+                        log.debug(serviceDescImpl.toString());
                     }
 
                 } else {

Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java?rev=611255&r1=611254&r2=611255&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java (original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java Fri Jan 11 10:40:08 2008
@@ -168,10 +168,16 @@
         // If there's a WSDL URL specified in the sparse composite, that is a override, for example
         // from a JSR-109 deployment descriptor, and that's the one to use.
         if (sparseCompositeWsdlURL != null) {
+            if (log.isDebugEnabled()) {
+                log.debug("Wsdl location overriden by sparse composite; overriden value: " + this.wsdlURL);
+            }
             this.wsdlURL = sparseCompositeWsdlURL;
         } else {
             this.wsdlURL = wsdlURL;
         }
+        if (log.isDebugEnabled()) {
+            log.debug("Wsdl Location value used: " + this.wsdlURL);
+        }
         // TODO: The serviceQName needs to be verified between the argument/WSDL/Annotation
         this.serviceQName = serviceQName;
 
@@ -199,6 +205,13 @@
                     wsdlUrl = createWsdlURL(wsdlLocation);
                 }
                 if (wsdlUrl == null) {
+                    // This check is necessary because Unix/Linux file paths begin
+                    // with a '/'. When adding the prefix 'jar:file:/' we may end
+                    // up with '//' after the 'file:' part. This causes the URL 
+                    // object to treat this like a remote resource
+                    if(wsdlLocation.indexOf("/") == 0) {
+                        wsdlLocation = wsdlLocation.substring(1, wsdlLocation.length());
+                    }
                     wsdlUrl = createWsdlURL("file:/" + wsdlLocation);
                 }
                 



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