axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r709019 - /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java
Date Wed, 29 Oct 2008 21:43:15 GMT
Author: gawor
Date: Wed Oct 29 14:43:14 2008
New Revision: 709019

URL: http://svn.apache.org/viewvc?rev=709019&view=rev
Log:
use simpler service addresses if service has a single endpoint

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

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java?rev=709019&r1=709018&r2=709019&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java
Wed Oct 29 14:43:14 2008
@@ -1336,6 +1336,16 @@
 		printWSDL(out, null);
 	}
 
+        private AxisEndpoint getAxisEndpoint(String port) {
+            // if service has a single endpoint, this will cause the [serviceName] address
+            // to be used in wsdl instead of the [serviceName].[endpointName]
+            if (endpointMap.size() == 1 && endpointMap.containsKey(getEndpointName()))
{
+                return null;
+            } else {
+                return (AxisEndpoint)endpointMap.get(port);
+            }
+        }
+
 	private void setPortAddress(Definition definition, String requestIP)
 			throws AxisFault {
 		Iterator serviceItr = definition.getServices().values().iterator();
@@ -1344,8 +1354,7 @@
 			Iterator portItr = serviceElement.getPorts().values().iterator();
 			while (portItr.hasNext()) {
 				Port port = (Port) portItr.next();
-				AxisEndpoint endpoint = (AxisEndpoint) endpointMap.get(port
-						.getName());
+				AxisEndpoint endpoint = getAxisEndpoint(port.getName());
 				List list = port.getExtensibilityElements();
 				for (int i = 0; i < list.size(); i++) {
 					Object extensibilityEle = list.get(i);



Mime
View raw message