svn commit r17963 - trunk/wsf/javascript/rhino/message_receiver/src/org/wso2/javascript/rhino

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

svn commit r17963 - trunk/wsf/javascript/rhino/message_receiver/src/org/wso2/javascript/rhino

Keith Chapman-4
Author: keith
Date: Thu Jun  5 00:24:43 2008
New Revision: 17963
URL: http://wso2.org/svn/browse/wso2?view=rev&revision=17963

Log:
Fixing Mashup-845


Modified:
   trunk/wsf/javascript/rhino/message_receiver/src/org/wso2/javascript/rhino/JavaScriptEngineUtils.java

Modified: trunk/wsf/javascript/rhino/message_receiver/src/org/wso2/javascript/rhino/JavaScriptEngineUtils.java
URL: http://wso2.org/svn/browse/wso2/trunk/wsf/javascript/rhino/message_receiver/src/org/wso2/javascript/rhino/JavaScriptEngineUtils.java?rev=17963&r1=17962&r2=17963&view=diff
==============================================================================
--- trunk/wsf/javascript/rhino/message_receiver/src/org/wso2/javascript/rhino/JavaScriptEngineUtils.java (original)
+++ trunk/wsf/javascript/rhino/message_receiver/src/org/wso2/javascript/rhino/JavaScriptEngineUtils.java Thu Jun  5 00:24:43 2008
@@ -109,18 +109,19 @@
     }
 
     public static void loadGlobalPropertyObjects(JavaScriptEngine engine,
-                                                 AxisConfiguration axisConfig, String serviceName) {
+                                                 AxisConfiguration axisConfig, String serviceName,
+                                                 boolean allowHttpAccess) {
         Parameter propertyObjectParameter = axisConfig
                 .getParameter("javascript.global.propertyobjects");
         if ((propertyObjectParameter != null) &&
                 (propertyObjectParameter.getParameterType() == 2)) {
             OMElement paraElement = propertyObjectParameter.getParameterElement();
-            loadGlobalProperties(paraElement, engine, serviceName);
+            loadGlobalProperties(paraElement, engine, serviceName, allowHttpAccess);
         }
     }
 
     private static void loadGlobalProperties(OMElement hostObjectElement, JavaScriptEngine engine,
-                                             String serviceName) {
+                                             String serviceName, boolean allowHttpAccess) {
         Iterator iterator = hostObjectElement.getChildrenWithName(new QName("global.property"));
         while (iterator.hasNext()) {
             OMElement element = (OMElement) iterator.next();
@@ -146,9 +147,17 @@
                         // The Mashup server may be running behind a proxy so the best way to get
                         // the http address would be to get it from the http transport listener
                         // cause its configured correctly if its behind a proxy
-                        TransportInDescription inDescription =
-                                configuration
+
+                        // If httpAccess is allowed we take the http transport else we switch to the
+                        // https transport
+                        TransportInDescription inDescription;
+                        if (allowHttpAccess) {
+                            inDescription = configuration
                                         .getTransportIn("http");
+                        } else {
+                            inDescription = configuration
+                                        .getTransportIn("https");
+                        }
 
                         // As this is a mashup service it would have the name in the form of
                         // authorName-serviceName and this service is not added to the axisConfig as

_______________________________________________
Wsf-javascript-dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/wsf-javascript-dev
Loading...