Author: keith
Date: Tue Jul 15 01:49:25 2008
New Revision: 19305
URL: http://wso2.org/svn/browse/wso2?view=rev&revision=19305

Log:
Fixing Mashup-941


Modified:
   trunk/mashup/java/modules/patches/wsas/resources/wsas-patches.txt
   
trunk/mashup/java/modules/patches/wsas/src/org/wso2/wsas/admin/service/SecurityScenarioConfigAdmin.java

Modified: trunk/mashup/java/modules/patches/wsas/resources/wsas-patches.txt
URL: 
http://wso2.org/svn/browse/wso2/trunk/mashup/java/modules/patches/wsas/resources/wsas-patches.txt?rev=19305&r1=19304&r2=19305&view=diff
==============================================================================
--- trunk/mashup/java/modules/patches/wsas/resources/wsas-patches.txt   
(original)
+++ trunk/mashup/java/modules/patches/wsas/resources/wsas-patches.txt   Tue Jul 
15 01:49:25 2008
@@ -1,4 +1,5 @@
 JIRA issues that this patch address
 
 https://wso2.org/jira/browse/WSAS-798
-https://wso2.org/jira/browse/MASHUP-940
\ No newline at end of file
+https://wso2.org/jira/browse/MASHUP-940
+https://wso2.org/jira/browse/MASHUP-941
\ No newline at end of file

Modified: 
trunk/mashup/java/modules/patches/wsas/src/org/wso2/wsas/admin/service/SecurityScenarioConfigAdmin.java
URL: 
http://wso2.org/svn/browse/wso2/trunk/mashup/java/modules/patches/wsas/src/org/wso2/wsas/admin/service/SecurityScenarioConfigAdmin.java?rev=19305&r1=19304&r2=19305&view=diff
==============================================================================
--- 
trunk/mashup/java/modules/patches/wsas/src/org/wso2/wsas/admin/service/SecurityScenarioConfigAdmin.java
     (original)
+++ 
trunk/mashup/java/modules/patches/wsas/src/org/wso2/wsas/admin/service/SecurityScenarioConfigAdmin.java
     Tue Jul 15 01:49:25 2008
@@ -21,6 +21,7 @@
 import org.apache.axiom.om.impl.builder.StAXOMBuilder;
 import org.apache.axiom.om.xpath.AXIOMXPath;
 import org.apache.axis2.AxisFault;
+import org.apache.axis2.Constants;
 import org.apache.axis2.description.AxisModule;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.engine.AxisConfiguration;
@@ -203,15 +204,18 @@
 //            serviceAdmin.setPolicy(serviceName,
 //                                   ServiceIdentifierDO.EMPTY_SERVICE_VERSION,
 //                                   baos.toString());
-            serviceAdmin.setSoap11BindingPolicy(serviceName,
-                                       
ServiceIdentifierDO.EMPTY_SERVICE_VERSION, baos.toString());
-            serviceAdmin.setSoap12BindingPolicy(serviceName,
-                                       
ServiceIdentifierDO.EMPTY_SERVICE_VERSION, baos.toString());
             if ("scenario1".equals(scenarioId)){
                 serviceAdmin.setHttpBindingPolicy(serviceName,
                                                   
ServiceIdentifierDO.EMPTY_SERVICE_VERSION,
                                                   baos.toString());
+                axisService.addParameter(Constants.Configuration.DISABLE_REST, 
Boolean.FALSE);
+            } else {
+                axisService.addParameter(Constants.Configuration.DISABLE_REST, 
Boolean.TRUE);
             }
+            serviceAdmin.setSoap11BindingPolicy(serviceName,
+                                       
ServiceIdentifierDO.EMPTY_SERVICE_VERSION, baos.toString());
+            serviceAdmin.setSoap12BindingPolicy(serviceName,
+                                       
ServiceIdentifierDO.EMPTY_SERVICE_VERSION, baos.toString());
             
         } catch (Exception e) {
             throw new AxisFault("Could not load security policy", e);
@@ -267,6 +271,8 @@
 
     private void removeAllSecurityScenarioPolicies(ServiceAdmin serviceAdmin,
                                                    String serviceName) throws 
AxisFault {
+        AxisService axisService = getAxisConfig().getService(serviceName);
+        axisService.addParameter(Constants.Configuration.DISABLE_REST, 
Boolean.FALSE);
         File scDir = new File(scenarioDir);
         File[] policyFiles = scDir.listFiles(new FileFilter() {
             public boolean accept(File pathname) {
@@ -288,7 +294,7 @@
                     throw new AxisFault("The policy ID in the policy file " +
                                         policyFile.getAbsolutePath() + " is 
null");
                 }
-                
+
                 String policyID = idAtt.getAttributeValue();
                 if ("UTOverTransport".equals(policyID)) {
                     serviceAdmin.removeHttpBindingPolicy(serviceName,

_______________________________________________
Mashup-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/mashup-dev

Reply via email to