axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ami...@apache.org
Subject svn commit: r600469 - /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java
Date Mon, 03 Dec 2007 10:29:34 GMT
Author: amilas
Date: Mon Dec  3 02:29:34 2007
New Revision: 600469

URL: http://svn.apache.org/viewvc?rev=600469&view=rev
Log:
select the http port addreess if available

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

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java?rev=600469&r1=600468&r2=600469&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java
Mon Dec  3 02:29:34 2007
@@ -908,18 +908,28 @@
      */
     private Port findPort(Map ports) {
         Port port;
+        Port returnPort = null;
         for (Iterator portsIterator = ports.values().iterator(); portsIterator.hasNext();)
{
             port = (Port) portsIterator.next();
             List extensibilityElements = port.getExtensibilityElements();
             for (int i = 0; i < extensibilityElements.size(); i++) {
                 Object extElement = extensibilityElements.get(i);
                 if (extElement instanceof SOAP12Address) {
-                    // SOAP 1.2 address found - return that port and we are done
-                    return port;
+                    // SOAP 1.2 address found - keep this and loop until http address is
found
+                    returnPort = port;
+                    String location = ((SOAP12Address)extElement).getLocationURI().trim();
+                    if ((location != null) && location.startsWith("http:")){
+                        // i.e we have found an http port so return from here
+                       break;
+                    }
                 }
             }
         }
 
+        if (returnPort != null){
+            return returnPort;
+        }
+
         for (Iterator portsIterator = ports.values().iterator(); portsIterator
                 .hasNext();) {
             port = (Port) portsIterator.next();
@@ -927,12 +937,21 @@
             for (int i = 0; i < extensibilityElements.size(); i++) {
                 Object extElement = extensibilityElements.get(i);
                 if (extElement instanceof SOAPAddress) {
-                    // SOAP 1.1 address found - return that port and we are done
-                    return port;
+                    // SOAP 1.1 address found - keep this and loop until http address is
found
+                    returnPort = port;
+                    String location = ((SOAPAddress)extElement).getLocationURI().trim();
+                    if ((location != null) && location.startsWith("http:")){
+                        // i.e we have found an http port so return from here
+                       break;
+                    }
                 }
             }
         }
 
+        if (returnPort != null){
+            return returnPort;
+        }
+
         for (Iterator portsIterator = ports.values().iterator(); portsIterator
                 .hasNext();) {
             port = (Port) portsIterator.next();
@@ -940,13 +959,17 @@
             for (int i = 0; i < extensibilityElements.size(); i++) {
                 Object extElement = extensibilityElements.get(i);
                 if (extElement instanceof HTTPAddress) {
-                    // SOAP 1.1 address found - return that port and we are done
-                    return port;
+                    // HTTP address found - keep this and loop until http address is found
+                    returnPort = port;
+                    String location = ((HTTPAddress)extElement).getLocationURI().trim();
+                    if ((location != null) && location.startsWith("http:")){
+                        // i.e we have found an http port so return from here
+                       break;
+                    }
                 }
             }
         }
-        // None found - just return null.
-        return null;
+        return returnPort;
     }
 
     private Operation findOperation(PortType portType,



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