ws-axis-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kei...@apache.org
Subject svn commit: r584130 - in /webservices/axis2/branches/java/1_3_post_mods/modules/kernel/src/org/apache/axis2/description: WSDL20ToAllAxisServicesBuilder.java WSDL20ToAxisServiceBuilder.java
Date Fri, 12 Oct 2007 11:06:38 GMT
Author: keithc
Date: Fri Oct 12 04:06:38 2007
New Revision: 584130

URL: http://svn.apache.org/viewvc?rev=584130&view=rev
Log:
Committing 582773r to branch


Modified:
    webservices/axis2/branches/java/1_3_post_mods/modules/kernel/src/org/apache/axis2/description/WSDL20ToAllAxisServicesBuilder.java
    webservices/axis2/branches/java/1_3_post_mods/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java

Modified: webservices/axis2/branches/java/1_3_post_mods/modules/kernel/src/org/apache/axis2/description/WSDL20ToAllAxisServicesBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_3_post_mods/modules/kernel/src/org/apache/axis2/description/WSDL20ToAllAxisServicesBuilder.java?rev=584130&r1=584129&r2=584130&view=diff
==============================================================================
--- webservices/axis2/branches/java/1_3_post_mods/modules/kernel/src/org/apache/axis2/description/WSDL20ToAllAxisServicesBuilder.java
(original)
+++ webservices/axis2/branches/java/1_3_post_mods/modules/kernel/src/org/apache/axis2/description/WSDL20ToAllAxisServicesBuilder.java
Fri Oct 12 04:06:38 2007
@@ -24,6 +24,7 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.woden.wsdl20.Endpoint;
 import org.apache.woden.wsdl20.Service;
+import org.apache.woden.WSDLException;
 
 import java.io.InputStream;
 import java.util.ArrayList;
@@ -46,6 +47,11 @@
      */
     public WSDL20ToAllAxisServicesBuilder(InputStream in) {
         super(in, null, null);
+        axisServices = new ArrayList();   // create an empty ArrayList
+    }
+
+    public WSDL20ToAllAxisServicesBuilder(String wsdlUri, String endpointName) throws WSDLException
{
+        super(wsdlUri, null, endpointName);
         axisServices = new ArrayList();   // create an empty ArrayList
     }
 

Modified: webservices/axis2/branches/java/1_3_post_mods/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_3_post_mods/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java?rev=584130&r1=584129&r2=584130&view=diff
==============================================================================
--- webservices/axis2/branches/java/1_3_post_mods/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java
(original)
+++ webservices/axis2/branches/java/1_3_post_mods/modules/kernel/src/org/apache/axis2/description/WSDL20ToAxisServiceBuilder.java
Fri Oct 12 04:06:38 2007
@@ -18,6 +18,7 @@
  */
 package org.apache.axis2.description;
 
+import com.ibm.wsdl.util.xml.DOM2Writer;
 import org.apache.axiom.soap.SOAP11Constants;
 import org.apache.axiom.soap.SOAP12Constants;
 import org.apache.axis2.AxisFault;
@@ -32,12 +33,12 @@
 import org.apache.woden.WSDLReader;
 import org.apache.woden.WSDLSource;
 import org.apache.woden.internal.DOMWSDLFactory;
+import org.apache.woden.internal.wsdl20.BindingFaultImpl;
+import org.apache.woden.internal.wsdl20.BindingOperationImpl;
 import org.apache.woden.internal.wsdl20.extensions.InterfaceOperationExtensionsImpl;
 import org.apache.woden.internal.wsdl20.extensions.http.HTTPBindingExtensionsImpl;
 import org.apache.woden.internal.wsdl20.extensions.http.HTTPHeaderImpl;
 import org.apache.woden.internal.wsdl20.extensions.soap.SOAPBindingExtensionsImpl;
-import org.apache.woden.internal.wsdl20.BindingFaultImpl;
-import org.apache.woden.internal.wsdl20.BindingOperationImpl;
 import org.apache.woden.schema.Schema;
 import org.apache.woden.wsdl20.Binding;
 import org.apache.woden.wsdl20.BindingFault;
@@ -66,10 +67,11 @@
 import org.apache.woden.wsdl20.extensions.soap.SOAPEndpointExtensions;
 import org.apache.woden.wsdl20.extensions.soap.SOAPHeaderBlock;
 import org.apache.woden.wsdl20.extensions.soap.SOAPModule;
+import org.apache.woden.wsdl20.extensions.soap.SOAPBindingExtensions;
 import org.apache.woden.wsdl20.xml.DescriptionElement;
-import org.apache.woden.wsdl20.xml.TypesElement;
-import org.apache.woden.wsdl20.xml.DocumentationElement;
 import org.apache.woden.wsdl20.xml.DocumentableElement;
+import org.apache.woden.wsdl20.xml.DocumentationElement;
+import org.apache.woden.wsdl20.xml.TypesElement;
 import org.apache.woden.xml.XMLAttr;
 import org.apache.ws.commons.schema.XmlSchema;
 import org.apache.ws.commons.schema.utils.NamespaceMap;
@@ -84,14 +86,12 @@
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.util.ArrayList;
+import java.util.Comparator;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.TreeMap;
-import java.util.Comparator;
-
-import com.ibm.wsdl.util.xml.DOM2Writer;
 
 public class WSDL20ToAxisServiceBuilder extends WSDLToAxisServiceBuilder {
 
@@ -110,8 +110,11 @@
     private NamespaceMap stringBasedNamespaceMap;
 
     private boolean setupComplete = false;
+
     private Service wsdlService;
 
+    private boolean isAllPorts;
+
 //    As bindings are processed add it to this array so that we dont process the same binding
twice
     private Map processedBindings;
 
@@ -148,6 +151,12 @@
         setPolicyRegistryFromService(axisService);
     }
 
+    public WSDL20ToAxisServiceBuilder(String wsdlUri,
+                                      String name, String interfaceName, boolean isAllPorts)
throws WSDLException {
+        this(wsdlUri, name, interfaceName);
+        this.isAllPorts = isAllPorts;
+    }
+
     public WSDL20ToAxisServiceBuilder(String wsdlUri, QName serviceName) {
         super(null, serviceName);
         this.wsdlURI = wsdlUri;
@@ -158,6 +167,14 @@
         this.wsdlURI = wsdlUri;
     }
 
+    public boolean isAllPorts() {
+        return isAllPorts;
+    }
+
+    public void setAllPorts(boolean allPorts) {
+        isAllPorts = allPorts;
+    }
+
     public AxisService populateService() throws AxisFault {
 
         try {
@@ -239,6 +256,14 @@
         processedBindings = new HashMap();
         Endpoint endpoint = null;
 
+        // If the interface name is not null thats means that this is a call from the codegen
engine
+        // and we need to populate a single endpoint. Hence find the endpoint and populate
it.
+        // If that was not the case then we need to check whether the call is from the codegen
+        // engine with thw allports check false. If its so no need to populate all endpoints,
we
+        // select an enspoint accrding to the following criteria.
+        // 1. Find the first SOAP 1.2 endpoint
+        // 2. Find the first SOAP 1.1 endpoint
+        // 3. Use the first endpoint
         if (this.interfaceName != null) {
             for (int i = 0; i < endpoints.length; ++i) {
                 if (this.interfaceName.equals(endpoints[i].getName().toString())) {
@@ -252,7 +277,37 @@
             }
 
             axisService
-                    .addEndpoint(endpoint.getName().toString(), processEndpoint(endpoint,
serviceInterface));
+                    .addEndpoint(endpoint.getName().toString(),
+                                 processEndpoint(endpoint, serviceInterface));
+        } else if (this.isCodegen && !this.isAllPorts) {
+            Endpoint soap11Endpoint = null;
+            for (int i = 0; i < endpoints.length; ++i) {
+                Binding binding = endpoints[i].getBinding();
+                if (WSDL2Constants.URI_WSDL2_SOAP.equals(binding.getType().toString())) {
+                    SOAPBindingExtensions soapBindingExtensions;
+                    try {
+                        soapBindingExtensions = (SOAPBindingExtensionsImpl) binding
+                                .getComponentExtensionsForNamespace(
+                                        new URI(WSDL2Constants.URI_WSDL2_SOAP));
+                    } catch (URISyntaxException e) {
+                        throw new AxisFault("Soap Binding Extention not found");
+                    }
+                    if (!WSDL2Constants.SOAP_VERSION_1_1
+                            .equals(soapBindingExtensions.getSoapVersion())) {
+                        endpoint = endpoints[i];
+                        break;  // found it.  Stop looking
+                    } else if (soap11Endpoint == null){
+                        soap11Endpoint = endpoints[i];
+                    }
+                }
+            }
+            if (endpoint == null) {
+                endpoint = endpoints[0];
+            }
+
+            axisService
+                    .addEndpoint(endpoint.getName().toString(),
+                                 processEndpoint(endpoint, serviceInterface));
         } else {
             for (int i = 0; i < endpoints.length; i++) {
                 axisService
@@ -438,7 +493,7 @@
                 return (-1 * ((Comparable)o1).compareTo(o2));
             }
         });
-        SOAPBindingExtensionsImpl soapBindingExtensions;
+        SOAPBindingExtensions soapBindingExtensions;
         try {
             soapBindingExtensions = (SOAPBindingExtensionsImpl) binding
                     .getComponentExtensionsForNamespace(new URI(WSDL2Constants.URI_WSDL2_SOAP));



---------------------------------------------------------------------
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