You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by di...@apache.org on 2006/08/08 18:42:15 UTC

svn commit: r429722 - in /webservices/axis2/trunk/java/modules: codegen/src/org/apache/axis2/wsdl/codegen/ core/src/org/apache/axis2/description/

Author: dims
Date: Tue Aug  8 09:42:14 2006
New Revision: 429722

URL: http://svn.apache.org/viewvc?rev=429722&view=rev
Log:
Localize references to woden to just one class - WSDL20ToAxisServiceBuilder. Next step is to decide if we should create an instanceof this class via reflection. If we do that, then we can ship Axis2 1.1 w/o woden jar since woden is still under incubation

Modified:
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenerationEngine.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService2WSDL2.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/WSDL2Constants.java

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenerationEngine.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenerationEngine.java?rev=429722&r1=429721&r2=429722&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenerationEngine.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenerationEngine.java Tue Aug  8 09:42:14 2006
@@ -30,7 +30,6 @@
 import org.apache.axis2.wsdl.util.ConfigPropertyFileLoader;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.woden.wsdl20.xml.DescriptionElement;
 import org.w3c.dom.Document;
 import org.xml.sax.SAXException;
 
@@ -88,21 +87,11 @@
 
             if(CommandLineOptionConstants.WSDL2JavaConstants.WSDL_VERSION_2.
                     equals(configuration.getWSDLVersion())){
-
-                //its WSDL 2.0
-                org.apache.woden.WSDLReader wsdlReader = org.apache.woden.WSDLFactory.newInstance().newWSDLReader();
-                //TODO Check whether this does the networ downloading
-                DescriptionElement description = wsdlReader.readWSDL(wsdlUri);
-                QName serviceQname = null;
-                if (configuration.getServiceName()!=null){
-                    serviceQname = new QName(description.getTargetNamespace().toString(), configuration.getServiceName());
-                }
                 configuration.setAxisService(
-                        new WSDL20ToAxisServiceBuilder(description,
-                                serviceQname,
+                        new WSDL20ToAxisServiceBuilder(wsdlUri,
+                                configuration.getServiceName(),
                                 configuration.getPortName()).
                                 populateService());
-
             }else{
                 //It'll be WSDL 1.1
                 Definition wsdl4jDef = readInTheWSDLFile(wsdlUri);

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService2WSDL2.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService2WSDL2.java?rev=429722&r1=429721&r2=429722&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService2WSDL2.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService2WSDL2.java Tue Aug  8 09:42:14 2006
@@ -8,7 +8,6 @@
 import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axis2.namespace.Constants;
 import org.apache.axis2.wsdl.WSDLConstants;
-import org.apache.woden.wsdl20.enumeration.MessageLabel;
 import org.apache.ws.commons.schema.XmlSchema;
 
 import javax.xml.namespace.QName;
@@ -211,9 +210,9 @@
 
                 String direction = faultMessage.getDirection();
                 OMElement faultElement = null;
-                if (MessageLabel.OUT.toString().equalsIgnoreCase(direction)) {
+                if (MESSAGE_LABEL_OUT.equalsIgnoreCase(direction)) {
                   faultElement = fac.createOMElement(OUT_FAULT, null, operationElement);
-                }else if (MessageLabel.IN.toString().equalsIgnoreCase(direction)) {
+                }else if (MESSAGE_LABEL_IN.equalsIgnoreCase(direction)) {
                   faultElement = fac.createOMElement(IN_FAULT, null, operationElement);
                 } else {
                     return;

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java?rev=429722&r1=429721&r2=429722&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java Tue Aug  8 09:42:14 2006
@@ -34,7 +34,6 @@
 import org.apache.ws.policy.util.PolicyFactory;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
-import org.xml.sax.InputSource;
 
 import javax.xml.namespace.QName;
 import javax.xml.parsers.DocumentBuilder;
@@ -88,13 +87,18 @@
         setPolicyRegistryFromService(axisService);
     }
 
-    public WSDL20ToAxisServiceBuilder(DescriptionElement descriptionElement,
-                                      QName serviceName, String interfaceName) {
+    public WSDL20ToAxisServiceBuilder(String wsdlUri,
+                                      String name, String interfaceName)  throws Exception  {
+        WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader();
+        DescriptionElement descriptionElement = wsdlReader.readWSDL(wsdlUri);
         savedTargetNamespace = descriptionElement.getTargetNamespace()
                 .toString();
         namespacemap = descriptionElement.getNamespaces();
         this.description = descriptionElement.toComponent();
-        this.serviceName = serviceName;
+        this.serviceName = null;
+        if(name != null) {
+            serviceName = new QName(descriptionElement.getTargetNamespace().toString(), name);
+        }
         this.interfaceName = interfaceName;
         this.axisService = new AxisService();
         setPolicyRegistryFromService(axisService);

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/WSDL2Constants.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/WSDL2Constants.java?rev=429722&r1=429721&r2=429722&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/WSDL2Constants.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/WSDL2Constants.java Tue Aug  8 09:42:14 2006
@@ -46,4 +46,7 @@
     String SOAP_BINDING_PREFIX = "SOAPBinding";
     String HTTP_PROTOCAL = "http://www.w3.org/2003/05/soap/bindings/HTTP";
     String SERVICE_LOCAL_NAME = "service";
+    
+    String MESSAGE_LABEL_IN = "In";
+    String MESSAGE_LABEL_OUT = "Out";
 }



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