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 ve...@apache.org on 2009/08/08 22:25:28 UTC

svn commit: r802447 - in /webservices/axis2/trunk/java/modules: kernel/src/org/apache/axis2/description/ transport/http/src/org/apache/axis2/transport/http/

Author: veithen
Date: Sat Aug  8 20:25:28 2009
New Revision: 802447

URL: http://svn.apache.org/viewvc?rev=802447&view=rev
Log:
AXIS2-3784: Applied patch submitted by Boris Milanov.

Modified:
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java
    webservices/axis2/trunk/java/modules/transport/http/src/org/apache/axis2/transport/http/HTTPWorker.java
    webservices/axis2/trunk/java/modules/transport/http/src/org/apache/axis2/transport/http/ListingAgent.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=802447&r1=802446&r2=802447&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 Sat Aug  8 20:25:28 2009
@@ -1018,6 +1018,11 @@
 
 	public void printUserWSDL(OutputStream out, String wsdlName)
 			throws AxisFault {
+			printUserWSDL(out, wsdlName, null);
+	}
+
+	public void printUserWSDL(OutputStream out, String wsdlName, String ip)
+			throws AxisFault {
 		Definition definition = null;
 		// first find the correct wsdl definition
 		Parameter wsdlParameter = getParameter(WSDLConstants.WSDL_4_J_DEFINITION);
@@ -1028,7 +1033,7 @@
 		if (definition != null) {
 			try {
 				printDefinitionObject(getWSDLDefinition(definition, wsdlName),
-						out, null);
+						out, ip);
 			} catch (WSDLException e) {
 				throw AxisFault.makeFault(e);
 			}
@@ -1303,7 +1308,7 @@
 	public void printWSDL(OutputStream out, String requestIP) throws AxisFault {
 		// If we're looking for pre-existing WSDL, use that.
 		if (isUseUserWSDL()) {
-			printUserWSDL(out, null);
+			printUserWSDL(out, null, requestIP);
 			return;
 		}
 
@@ -1371,7 +1376,7 @@
 							if (endpoint != null) {
 								((SOAPAddress) extensibilityEle)
 										.setLocationURI(endpoint
-												.calculateEndpointURL());
+												.calculateEndpointURL(requestIP));
 							} else {
 								((SOAPAddress) extensibilityEle)
 										.setLocationURI(getEPRs()[0]);
@@ -1391,7 +1396,7 @@
 								if (endpoint != null) {
 									((SOAPAddress) extensibilityEle)
 											.setLocationURI(endpoint
-													.calculateEndpointURL());
+													.calculateEndpointURL(requestIP));
 								} else {
 									((SOAPAddress) extensibilityEle)
 											.setLocationURI(getLocationURI(
@@ -1418,7 +1423,7 @@
 							if (endpoint != null) {
 								((SOAP12Address) extensibilityEle)
 										.setLocationURI(endpoint
-												.calculateEndpointURL());
+												.calculateEndpointURL(requestIP));
 							} else {
 								((SOAP12Address) extensibilityEle)
 										.setLocationURI(getLocationURI(
@@ -1444,7 +1449,7 @@
 							if (endpoint != null) {
 								((HTTPAddress) extensibilityEle)
 										.setLocationURI(endpoint
-												.calculateEndpointURL());
+												.calculateEndpointURL(requestIP));
 							} else {
 								((HTTPAddress) extensibilityEle)
 										.setLocationURI(getLocationURI(

Modified: webservices/axis2/trunk/java/modules/transport/http/src/org/apache/axis2/transport/http/HTTPWorker.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/transport/http/src/org/apache/axis2/transport/http/HTTPWorker.java?rev=802447&r1=802446&r2=802447&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/transport/http/src/org/apache/axis2/transport/http/HTTPWorker.java (original)
+++ webservices/axis2/trunk/java/modules/transport/http/src/org/apache/axis2/transport/http/HTTPWorker.java Sat Aug  8 20:25:28 2009
@@ -223,12 +223,12 @@
             if (uri.indexOf("?wsdl2=") > 0) {
                 String serviceName =
                         uri.substring(uri.lastIndexOf("/") + 1, uri.lastIndexOf("?wsdl2="));
-                if (processInternalWSDL(uri, configurationContext, serviceName, response)) return;
+                if (processInternalWSDL(uri, configurationContext, serviceName, response, getHost(request))) return;
             }
             if (uri.indexOf("?wsdl=") > 0) {
                 String serviceName =
                         uri.substring(uri.lastIndexOf("/") + 1, uri.lastIndexOf("?wsdl="));
-                if (processInternalWSDL(uri, configurationContext, serviceName, response)) return;
+                if (processInternalWSDL(uri, configurationContext, serviceName, response, getHost(request))) return;
             }
 
             String contentType = null;
@@ -325,7 +325,7 @@
     }
 
     private boolean processInternalWSDL(String uri, ConfigurationContext configurationContext, 
-                                        String serviceName, AxisHttpResponse response) 
+                                        String serviceName, AxisHttpResponse response, String ip) 
     throws IOException {
         String wsdlName = uri.substring(uri.lastIndexOf("=") + 1);
 
@@ -335,7 +335,7 @@
         if (service != null) {
             response.setStatus(HttpStatus.SC_OK);
             response.setContentType("text/xml");
-            service.printUserWSDL(response.getOutputStream(), wsdlName);
+            service.printUserWSDL(response.getOutputStream(), wsdlName, ip);
             response.getOutputStream().flush();
             return true;
 

Modified: webservices/axis2/trunk/java/modules/transport/http/src/org/apache/axis2/transport/http/ListingAgent.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/transport/http/src/org/apache/axis2/transport/http/ListingAgent.java?rev=802447&r1=802446&r2=802447&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/transport/http/src/org/apache/axis2/transport/http/ListingAgent.java (original)
+++ webservices/axis2/trunk/java/modules/transport/http/src/org/apache/axis2/transport/http/ListingAgent.java Sat Aug  8 20:25:28 2009
@@ -263,7 +263,7 @@
                     String wsdlName = req.getParameter("wsdl");
 
                     if (wsdlName != null && wsdlName.length()>0) {
-                        axisService.printUserWSDL(out, wsdlName);
+                        axisService.printUserWSDL(out, wsdlName, ip);
                         out.flush();
                         out.close();
                     } else {