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 ke...@apache.org on 2006/11/28 09:55:30 UTC

svn commit: r479955 - in /webservices/axis2/branches/java/WSDL_2_0/modules: adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java

Author: keithc
Date: Tue Nov 28 00:55:30 2006
New Revision: 479955

URL: http://svn.apache.org/viewvc?view=rev&rev=479955
Log:
Added support to select service name and endpoint for codegeneration

Modified:
    webservices/axis2/branches/java/WSDL_2_0/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java
    webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java

Modified: webservices/axis2/branches/java/WSDL_2_0/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/WSDL_2_0/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java?view=diff&rev=479955&r1=479954&r2=479955
==============================================================================
--- webservices/axis2/branches/java/WSDL_2_0/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java (original)
+++ webservices/axis2/branches/java/WSDL_2_0/modules/adb-codegen/src/org/apache/axis2/schema/SchemaCompiler.java Tue Nov 28 00:55:30 2006
@@ -921,7 +921,6 @@
      * Writes a complex type
      * @param complexType
      * @param metaInfHolder
-     * @param fullyQualifiedClassName the name returned by makeFullyQualifiedClassName() or null if it wasn't called
      * @throws SchemaCompilationException
      */
     private void writeComplexType(XmlSchemaComplexType complexType, BeanWriterMetaInfoHolder metaInfHolder)

Modified: webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java?view=diff&rev=479955&r1=479954&r2=479955
==============================================================================
--- webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java (original)
+++ webservices/axis2/branches/java/WSDL_2_0/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java Tue Nov 28 00:55:30 2006
@@ -190,16 +190,38 @@
     private void processEndpoints() throws AxisFault {
         Endpoint [] endpoints = wsdlService.getEndpoints();
 
-        if (endpoints == null) {
+        if (endpoints.length == 0) {
             throw new AxisFault("No endpoints found in the WSDL");
         }
 
         processedBindings = new HashMap();
 
+        if (this.interfaceName != null) {
+
+            Endpoint endpoint = null;
+
+            for (int i = 0; i < endpoints.length; ++i) {
+                if (this.interfaceName.equals(endpoints[i].getName().toString())) {
+                    endpoint = endpoints[i];
+                    break;  // found it.  Stop looking
+                }
+            }
+            if (endpoint == null) {
+                throw new AxisFault("No endpoint found for the given name :"
+                        + this.interfaceName);
+            }
+
+            axisService
+                    .addEndpoit(endpoint.getName().toString(), processEndpoint(endpoint));
+        }
+        else{
+
+
         for (int i = 0; i < endpoints.length; i++) {
             axisService
                     .addEndpoit(endpoints[i].getName().toString(), processEndpoint(endpoints[i]));
         }
+        }
 
 
     }
@@ -211,8 +233,23 @@
             throw new AxisFault("No wsdlService found in the WSDL");
         }
 
+        if (serviceName != null) {
+            for (int i = 0; i < services.length; i++) {
+                if (serviceName.equals(services[i].getName())) {
+                    wsdlService = services[i];
+                    break;  // found it. Stop looking.
+                }
+            }
+            if (wsdlService == null) {
+                throw new AxisFault("Service with the specified name not found in the WSDL : "
+                        + serviceName.getLocalPart());
+            }
+        }
+
         wsdlService = services[0];
 
+        axisService.setName(wsdlService.getName().getLocalPart().toString());
+
         processInterface(wsdlService.getInterface());
 
         processEndpoints();
@@ -230,15 +267,15 @@
             axisEndpoint.setBinding(processBinding(endpoint.getBinding()));
         }
 
-        HTTPEndpointExtensions httpEndpointExtensions = null;
+        SOAPEndpointExtensions soapEndpointExtensions = null;
         try {
-            httpEndpointExtensions = (HTTPEndpointExtensions)endpoint.getComponentExtensionsForNamespace(new URI(WSDL2Constants.URI_WSDL2_HTTP));
+            soapEndpointExtensions = (SOAPEndpointExtensions)endpoint.getComponentExtensionsForNamespace(new URI(WSDL2Constants.URI_WSDL2_SOAP));
         } catch (URISyntaxException e) {
             throw new AxisFault("HTTP Binding Extention not found");
         }
 
-        axisEndpoint.setProperty(WSDL2Constants.ATTR_WHTTP_AUTHENTICATION_TYPE,httpEndpointExtensions.getHttpAuthenticationScheme());
-        axisEndpoint.setProperty(WSDL2Constants.ATTR_WHTTP_AUTHENTICATION_REALM,httpEndpointExtensions.getHttpAuthenticationRealm());
+//        axisEndpoint.setProperty(WSDL2Constants.ATTR_WHTTP_AUTHENTICATION_TYPE,soapEndpointExtensions.getHttpAuthenticationScheme());
+//        axisEndpoint.setProperty(WSDL2Constants.ATTR_WHTTP_AUTHENTICATION_REALM,soapEndpointExtensions.getHttpAuthenticationRealm());
 
         return axisEndpoint;
 



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