axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dee...@apache.org
Subject svn commit: r506351 - /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java
Date Mon, 12 Feb 2007 07:40:44 GMT
Author: deepal
Date: Sun Feb 11 23:40:44 2007
New Revision: 506351

URL: http://svn.apache.org/viewvc?view=rev&rev=506351
Log:
applying the path in AXIS2-2122
 - Johan , Thx for the patch

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?view=diff&rev=506351&r1=506350&r2=506351
==============================================================================
--- 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
Sun Feb 11 23:40:44 2007
@@ -664,7 +664,9 @@
             if (wsld4jdefinition != null) {
                 try {
                     Definition definition = (Definition) wsld4jdefinition.getValue();
-                    setPortAddress(definition);
+                    if (isModifyUserWSDLPortAddress()) {
+						setPortAddress(definition);
+					}
                     WSDLWriter writer = WSDLFactory.newInstance().newWSDLWriter();
                     writer.writeWSDL(definition, out);
                 } catch (WSDLException e) {
@@ -766,7 +768,9 @@
             if (wsld4jdefinition != null) {
                 try {
                     Definition definition = (Definition) wsld4jdefinition.getValue();
-                    setPortAddress(definition);
+					if (isModifyUserWSDLPortAddress()){
+						setPortAddress(definition);
+					}
                     WSDLWriter writer = WSDLFactory.newInstance().newWSDLWriter();
                     writer.writeWSDL(definition, out);
                 } catch (WSDLException e) {
@@ -783,6 +787,10 @@
     }
 
     private void setPortAddress(Definition definition) throws AxisFault {
+		setPortAddress(definition,null);
+    }
+
+    private void setPortAddress(Definition definition,String requestIP) throws AxisFault
{
         Iterator serviceItr = definition.getServices().values().iterator();
         while (serviceItr.hasNext()) {
             Service serviceElement = (Service) serviceItr.next();
@@ -793,7 +801,11 @@
                 for (int i = 0; i < list.size(); i++) {
                     Object extensibilityEle = list.get(i);
                     if (extensibilityEle instanceof SOAPAddress) {
-                        ((SOAPAddress) extensibilityEle).setLocationURI(getEPRs()[0]);
+						if (requestIP==null) {
+							((SOAPAddress) extensibilityEle).setLocationURI(getEPRs()[0]);
+						} else {
+							((SOAPAddress) extensibilityEle).setLocationURI(getEPRs(requestIP)[0]);
+						}
                     }
                 }
             }
@@ -1850,6 +1862,22 @@
             }
         }
         return false;
+    }
+
+    /**
+     * By default the port address in user WSDLs is modified, set 
+     * the following parameter to override this behaviour	
+     * <parameter name="modifyUserWSDLPortAddress">false</parameter>
+     */
+    public boolean isModifyUserWSDLPortAddress() {
+        Parameter parameter = getParameter("modifyUserWSDLPortAddress");
+        if (parameter != null) {
+            String value = (String) parameter.getValue();
+            if ("false".equals(value)) {
+                return false;
+            }
+        }
+        return true;
     }
 
     public ServiceLifeCycle getServiceLifeCycle() {



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