Author: samindaw
Date: Wed May 22 16:42:57 2013
New Revision: 1485280
URL: http://svn.apache.org/r1485280
Log:
updating for the https url to have the complete path for the service
Modified:
airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/ServiceUtils.java
Modified: airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/ServiceUtils.java
URL: http://svn.apache.org/viewvc/airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/ServiceUtils.java?rev=1485280&r1=1485279&r2=1485280&view=diff
==============================================================================
--- airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/ServiceUtils.java
(original)
+++ airavata/trunk/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/ServiceUtils.java
Wed May 22 16:42:57 2013
@@ -65,28 +65,28 @@ public class ServiceUtils {
//we will ignore this exception since the properties file will not contain the values
//when it is ok to retrieve them from the axis2 context
}
+ String protocol="http";
if(ServerSettings.getEnableHttp()){
- localAddress = "https://" + localAddress + ":" + port;
- }else{
- if (port == null) {
- TransportInDescription transportInDescription = context
- .getAxisConfiguration().getTransportsIn()
- .get("http");
- if (transportInDescription != null
- && transportInDescription.getParameter(PORT) != null) {
- port = (String) transportInDescription
- .getParameter(PORT).getValue();
- }
+ protocol="https";
+ }
+ if (port == null) {
+ TransportInDescription transportInDescription = context
+ .getAxisConfiguration().getTransportsIn()
+ .get(protocol);
+ if (transportInDescription != null
+ && transportInDescription.getParameter(PORT) != null) {
+ port = (String) transportInDescription
+ .getParameter(PORT).getValue();
}
- localAddress = "http://" + localAddress + ":" + port;
- localAddress = localAddress + "/"
- //We are not using axis2 config context to get the context root because it is invalid
- //+ context.getContextRoot() + "/"
- //FIXME: the context root will be correct after updating the web.xml
- + ServerSettings.getServerContextRoot() + "/"
- + context.getServicePath() + "/"
- + serviceName;
}
+ localAddress = protocol+"://" + localAddress + ":" + port;
+ localAddress = localAddress + "/"
+ //We are not using axis2 config context to get the context root because it is invalid
+ //+ context.getContextRoot() + "/"
+ //FIXME: the context root will be correct after updating the web.xml
+ + ServerSettings.getServerContextRoot() + "/"
+ + context.getServicePath() + "/"
+ + serviceName;
log.debug("Service Address Configured:" + localAddress);
return localAddress;
}
|