Author: asankha
Date: Mon Aug 20 23:24:14 2007
New Revision: 567973

URL: http://svn.apache.org/viewvc?rev=567973&view=rev
Log:
fix SYNAPSE-117
and AXIS2-3104 when Synapse nhttp code is merged with Axis2 before the next 
Axis2 release

Modified:
    
webservices/synapse/trunk/java/modules/transports/src/org/apache/axis2/transport/nhttp/HttpCoreNIOListener.java
    
webservices/synapse/trunk/java/modules/transports/src/org/apache/axis2/transport/nhttp/NhttpConstants.java

Modified: 
webservices/synapse/trunk/java/modules/transports/src/org/apache/axis2/transport/nhttp/HttpCoreNIOListener.java
URL: 
http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/transports/src/org/apache/axis2/transport/nhttp/HttpCoreNIOListener.java?rev=567973&r1=567972&r2=567973&view=diff
==============================================================================
--- 
webservices/synapse/trunk/java/modules/transports/src/org/apache/axis2/transport/nhttp/HttpCoreNIOListener.java
 (original)
+++ 
webservices/synapse/trunk/java/modules/transports/src/org/apache/axis2/transport/nhttp/HttpCoreNIOListener.java
 Mon Aug 20 23:24:14 2007
@@ -151,7 +151,12 @@
         sslContext = getSSLContext(transprtIn);
         sslIOSessionHandler = getSSLIOSessionHandler(transprtIn);
 
-        serviceEPRPrefix = getServiceEPRPrefix(cfgCtx, host, port);
+        param = transprtIn.getParameter(NhttpConstants.WSDL_EPR_PREFIX);
+        if (param != null) {
+            serviceEPRPrefix = getServiceEPRPrefix(cfgCtx, (String) 
param.getValue());
+        } else {
+            serviceEPRPrefix = getServiceEPRPrefix(cfgCtx, host, port);
+        }
     }
 
     /**
@@ -164,6 +169,18 @@
             cfgCtx.getServiceContextPath() +
             (!cfgCtx.getServiceContextPath().endsWith("/") ? "/" : "");
     }
+
+    /**
+     * Return the EPR prefix for services made available over this transport
+     * @return
+     */
+    protected String getServiceEPRPrefix(ConfigurationContext cfgCtx, String 
wsdlEPRPrefix) {
+        return wsdlEPRPrefix +
+            (!cfgCtx.getServiceContextPath().startsWith("/") ? "/" : "") +
+            cfgCtx.getServiceContextPath() +
+            (!cfgCtx.getServiceContextPath().endsWith("/") ? "/" : "");
+    }
+
 
     /**
      * Create the SSLContext to be used by this listener

Modified: 
webservices/synapse/trunk/java/modules/transports/src/org/apache/axis2/transport/nhttp/NhttpConstants.java
URL: 
http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/transports/src/org/apache/axis2/transport/nhttp/NhttpConstants.java?rev=567973&r1=567972&r2=567973&view=diff
==============================================================================
--- 
webservices/synapse/trunk/java/modules/transports/src/org/apache/axis2/transport/nhttp/NhttpConstants.java
 (original)
+++ 
webservices/synapse/trunk/java/modules/transports/src/org/apache/axis2/transport/nhttp/NhttpConstants.java
 Mon Aug 20 23:24:14 2007
@@ -23,4 +23,6 @@
     public static final String SC_ACCEPTED = "SC_ACCEPTED";
     public static final String SENDING_FAULT = "sending_fault";
     public static final String FORCE_HTTP_1_0 = "FORCE_HTTP_1.0";
+
+    public static final String WSDL_EPR_PREFIX = "WSDLEPRPrefix";
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to