ws-axis-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r627598 - /webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/JAXWSRIWSDLGenerator.java
Date Wed, 13 Feb 2008 22:00:21 GMT
Author: dims
Date: Wed Feb 13 14:00:15 2008
New Revision: 627598

URL: http://svn.apache.org/viewvc?rev=627598&view=rev
Log:
If the schemas are already present then don't generate them

Modified:
    webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/JAXWSRIWSDLGenerator.java

Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/JAXWSRIWSDLGenerator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/JAXWSRIWSDLGenerator.java?rev=627598&r1=627597&r2=627598&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/JAXWSRIWSDLGenerator.java
(original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/JAXWSRIWSDLGenerator.java
Wed Feb 13 14:00:15 2008
@@ -3,6 +3,7 @@
 import com.sun.tools.ws.spi.WSToolsObjectFactory;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
+import org.apache.axis2.util.SchemaUtil;
 import org.apache.axis2.dataretrieval.SchemaSupplier;
 import org.apache.axis2.dataretrieval.WSDLSupplier;
 import org.apache.axis2.description.AxisService;
@@ -321,6 +322,27 @@
     }
 
     public XmlSchema getSchema(AxisService service, String xsd) throws AxisFault {
+        Parameter wsdlParameter = service.getParameter(WSDLConstants.WSDL_4_J_DEFINITION);
+        if (wsdlParameter != null) {
+            ArrayList list = service.getSchema();
+            if (list.size() > 0) {
+                if (xsd == null || xsd.length() == 0) {
+                    return (XmlSchema) list.get(0);
+                }
+
+                for (Iterator iterator = list.iterator(); iterator.hasNext();) {
+                    XmlSchema schema = (XmlSchema) iterator.next();
+                    XmlSchema[] schemas = SchemaUtil.getAllSchemas(schema);
+                    for (int i = 0; i < schemas.length; i++) {
+                        String uri = schemas[i].getSourceURI();
+                        if (uri != null && uri.endsWith(xsd)) {
+                            return schema;
+                        }
+                    }
+                }
+                return (XmlSchema) list.get(0);
+            }
+        }
         initialize();
         XmlSchema schema = docMap.get(xsd);
         if (schema == null) {



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


Mime
View raw message