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 pr...@apache.org on 2008/02/11 12:32:48 UTC

svn commit: r620464 - /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java

Author: pradine
Date: Mon Feb 11 03:32:34 2008
New Revision: 620464

URL: http://svn.apache.org/viewvc?rev=620464&view=rev
Log:
Fix for AXIS2-3503.

Modified:
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java?rev=620464&r1=620463&r2=620464&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java Mon Feb 11 03:32:34 2008
@@ -39,7 +39,6 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 import java.util.Vector;
 
 import javax.wsdl.Definition;
@@ -1087,7 +1086,9 @@
             attribute = nodeMap.item(i);
             if (attribute.getNodeName().equals("schemaLocation")) {
                 attributeValue = attribute.getNodeValue();
-                attribute.setNodeValue(this.name + "?xsd=" + attributeValue);
+                if (!attributeValue.startsWith("http")) {
+                    attribute.setNodeValue(this.name + "?xsd=" + attributeValue);
+                }
             }
         }
     }
@@ -2323,15 +2324,17 @@
                                       Hashtable importedScheams,
                                       Hashtable sourceURIToNewLocationMap) {
         if (s != null) {
-
-            String newscheamlocation = customSchemaNamePrefix == null ?
-                    //use the default mode
-                    (getName() + "?xsd=" + getScheamLocationWithDot(sourceURIToNewLocationMap, s)) :
-                    //custom prefix is present - add the custom prefix
-                    (customSchemaNamePrefix + getScheamLocationWithDot(sourceURIToNewLocationMap, s));
             String schemaLocation = xmlSchemaExternal.getSchemaLocation();
-            xmlSchemaExternal.setSchemaLocation(newscheamlocation);
-            importedScheams.put(schemaLocation, newscheamlocation);
+            
+            if (!schemaLocation.startsWith("http")) {
+                String newscheamlocation = customSchemaNamePrefix == null ?
+                        //use the default mode
+                        (getName() + "?xsd=" + getScheamLocationWithDot(sourceURIToNewLocationMap, s)) :
+                            //custom prefix is present - add the custom prefix
+                            (customSchemaNamePrefix + getScheamLocationWithDot(sourceURIToNewLocationMap, s));
+                xmlSchemaExternal.setSchemaLocation(newscheamlocation);
+                importedScheams.put(schemaLocation, newscheamlocation);
+            }
         }
     }
 



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


Re: svn commit: r620464 - /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java

Posted by Brian De Pradine <PR...@uk.ibm.com>.
Hi Dims,

It seemed like a reasonable fix at the time, plus I was reusing the fix 
that currently applies to ?wsdl for this same problem. Your solution is 
probably better though and should be applied to ?xsd and ?wsdl. I will 
apply this change to both.

Cheers

Brian DePradine
Web Services Development
IBM Hursley
External  +44 (0) 1962 816319         Internal 246319

If you can't find the time to do it right the first time, where will you 
find the time to do it again?


Davanum Srinivas <da...@gmail.com> wrote on 11/02/2008 11:43:45:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Brian,
> 
> Why are we special casing just http? would this work better?
> 
>          if (attributeValue.indexOf("://")!=-1){
>             attribute.setNodeValue(this.name + "?xsd=" + 
attributeValue);
>          }
> 
> thanks,
> dims
> 
> pradine@apache.org wrote:
> | Author: pradine
> | Date: Mon Feb 11 03:32:34 2008
> | New Revision: 620464
> |
> | URL: http://svn.apache.org/viewvc?rev=620464&view=rev
> | Log:
> | Fix for AXIS2-3503.
> |
> | Modified:
> | 
> 
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.
> java
> |
> | Modified: 
> 
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.
> java
> | URL:
> http://svn.apache.
> 
org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.
> java?rev=620464&r1=620463&r2=620464&view=diff
> | 
> 
==============================================================================
> | --- 
> 
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.
> java (original)
> | +++ 
> 
webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.
> java Mon Feb 11 03:32:34 2008
> | @@ -39,7 +39,6 @@
> |  import java.util.Iterator;
> |  import java.util.List;
> |  import java.util.Map;
> | -import java.util.Set;
> |  import java.util.Vector;
> |
> |  import javax.wsdl.Definition;
> | @@ -1087,7 +1086,9 @@
> |              attribute = nodeMap.item(i);
> |              if (attribute.getNodeName().equals("schemaLocation")) {
> |                  attributeValue = attribute.getNodeValue();
> | -                attribute.setNodeValue(this.name + "?xsd=" + 
> attributeValue);
> | +                if (!attributeValue.startsWith("http")) {
> | +                    attribute.setNodeValue(this.name + "?xsd=" + 
> attributeValue);
> | +                }
> |              }
> |          }
> |      }
> | @@ -2323,15 +2324,17 @@
> |                                        Hashtable importedScheams,
> |                                        Hashtable 
> sourceURIToNewLocationMap) {
> |          if (s != null) {
> | -
> | -            String newscheamlocation = customSchemaNamePrefix == null 
?
> | -                    //use the default mode
> | -                    (getName() + "?xsd=" + 
> getScheamLocationWithDot(sourceURIToNewLocationMap, s)) :
> | -                    //custom prefix is present - add the custom 
prefix
> | -                    (customSchemaNamePrefix + 
> getScheamLocationWithDot(sourceURIToNewLocationMap, s));
> |              String schemaLocation = 
xmlSchemaExternal.getSchemaLocation();
> | -            xmlSchemaExternal.setSchemaLocation(newscheamlocation);
> | -            importedScheams.put(schemaLocation, newscheamlocation);
> | +
> | +            if (!schemaLocation.startsWith("http")) {
> | +                String newscheamlocation = customSchemaNamePrefix== 
null ?
> | +                        //use the default mode
> | +                        (getName() + "?xsd=" + 
> getScheamLocationWithDot(sourceURIToNewLocationMap, s)) :
> | +                            //custom prefix is present - add the 
> custom prefix
> | +                            (customSchemaNamePrefix + 
> getScheamLocationWithDot(sourceURIToNewLocationMap, s));
> | + xmlSchemaExternal.setSchemaLocation(newscheamlocation);
> | +                importedScheams.put(schemaLocation, 
newscheamlocation);
> | +            }
> |          }
> |      }
> |
> |
> |
> |
> | ---------------------------------------------------------------------
> | To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
> | For additional commands, e-mail: axis-cvs-help@ws.apache.org
> |
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.5 (Cygwin)
> 
> iD8DBQFHsDTxgNg6eWEDv1kRAkApAKDmSQde7Of/CGouRvFttoXjDYLlqACfRQJK
> h19aWV8tdRiqT0gxNNkKp6A=
> =kpTQ
> -----END PGP SIGNATURE-----
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-dev-help@ws.apache.org
> 






Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 
741598. 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU






Re: svn commit: r620464 - /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java

Posted by Davanum Srinivas <da...@gmail.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Brian,

Why are we special casing just http? would this work better?

			if (attributeValue.indexOf("://")!=-1){
				attribute.setNodeValue(this.name + "?xsd=" + attributeValue);
			}

thanks,
dims

pradine@apache.org wrote:
| Author: pradine
| Date: Mon Feb 11 03:32:34 2008
| New Revision: 620464
|
| URL: http://svn.apache.org/viewvc?rev=620464&view=rev
| Log:
| Fix for AXIS2-3503.
|
| Modified:
|     webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java
|
| Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java
| URL:
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java?rev=620464&r1=620463&r2=620464&view=diff
| ==============================================================================
| --- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java (original)
| +++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java Mon Feb 11 03:32:34 2008
| @@ -39,7 +39,6 @@
|  import java.util.Iterator;
|  import java.util.List;
|  import java.util.Map;
| -import java.util.Set;
|  import java.util.Vector;
|
|  import javax.wsdl.Definition;
| @@ -1087,7 +1086,9 @@
|              attribute = nodeMap.item(i);
|              if (attribute.getNodeName().equals("schemaLocation")) {
|                  attributeValue = attribute.getNodeValue();
| -                attribute.setNodeValue(this.name + "?xsd=" + attributeValue);
| +                if (!attributeValue.startsWith("http")) {
| +                    attribute.setNodeValue(this.name + "?xsd=" + attributeValue);
| +                }
|              }
|          }
|      }
| @@ -2323,15 +2324,17 @@
|                                        Hashtable importedScheams,
|                                        Hashtable sourceURIToNewLocationMap) {
|          if (s != null) {
| -
| -            String newscheamlocation = customSchemaNamePrefix == null ?
| -                    //use the default mode
| -                    (getName() + "?xsd=" + getScheamLocationWithDot(sourceURIToNewLocationMap, s)) :
| -                    //custom prefix is present - add the custom prefix
| -                    (customSchemaNamePrefix + getScheamLocationWithDot(sourceURIToNewLocationMap, s));
|              String schemaLocation = xmlSchemaExternal.getSchemaLocation();
| -            xmlSchemaExternal.setSchemaLocation(newscheamlocation);
| -            importedScheams.put(schemaLocation, newscheamlocation);
| +
| +            if (!schemaLocation.startsWith("http")) {
| +                String newscheamlocation = customSchemaNamePrefix == null ?
| +                        //use the default mode
| +                        (getName() + "?xsd=" + getScheamLocationWithDot(sourceURIToNewLocationMap, s)) :
| +                            //custom prefix is present - add the custom prefix
| +                            (customSchemaNamePrefix + getScheamLocationWithDot(sourceURIToNewLocationMap, s));
| +                xmlSchemaExternal.setSchemaLocation(newscheamlocation);
| +                importedScheams.put(schemaLocation, newscheamlocation);
| +            }
|          }
|      }
|
|
|
|
| ---------------------------------------------------------------------
| To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
| For additional commands, e-mail: axis-cvs-help@ws.apache.org
|
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)

iD8DBQFHsDTxgNg6eWEDv1kRAkApAKDmSQde7Of/CGouRvFttoXjDYLlqACfRQJK
h19aWV8tdRiqT0gxNNkKp6A=
=kpTQ
-----END PGP SIGNATURE-----

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