Author: manjula
Date: Thu Sep 18 22:39:08 2008
New Revision: 696925

URL: http://svn.apache.org/viewvc?rev=696925&view=rev
Log:
Changing the samples to add policy.

Added:
    webservices/sandesha/trunk/c/samples/policy/
    webservices/sandesha/trunk/c/samples/policy/rm10-policy.xml
    webservices/sandesha/trunk/c/samples/policy/rm11-policy.xml
Removed:
    webservices/sandesha/trunk/c/samples/rm_echo_1_0/policy.xml
    webservices/sandesha/trunk/c/samples/rm_ping_1_0/policy.xml
Modified:
    webservices/sandesha/trunk/c/samples/build.sh
    webservices/sandesha/trunk/c/samples/rm_echo_1_0/rm_echo.c
    webservices/sandesha/trunk/c/samples/rm_echo_1_0_large_sequence/rm_echo.c
    webservices/sandesha/trunk/c/samples/rm_echo_1_1/rm_echo_1_1.c
    webservices/sandesha/trunk/c/samples/rm_echo_single_1_0/rm_echo_single.c
    
webservices/sandesha/trunk/c/samples/rm_echo_single_1_0_large_sequence/rm_echo_single.c
    webservices/sandesha/trunk/c/samples/rm_echo_single_1_1/rm_echo_single_1_1.c
    webservices/sandesha/trunk/c/samples/rm_mtom_1_0/rm_mtom_1_0.c
    webservices/sandesha/trunk/c/samples/rm_ping_1_0/rm_ping_1_0.c
    webservices/sandesha/trunk/c/samples/rm_ping_1_1/rm_ping_1_1.c

Modified: webservices/sandesha/trunk/c/samples/build.sh
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/samples/build.sh?rev=696925&r1=696924&r2=696925&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/samples/build.sh (original)
+++ webservices/sandesha/trunk/c/samples/build.sh Thu Sep 18 22:39:08 2008
@@ -1,7 +1,19 @@
 #!/bin/bash
+POLICY_DIR="$AXIS2C_HOME/bin/samples/sandesha2/policy"
 
 ./autogen.sh
 
 ./configure --prefix=${AXIS2C_HOME} 
--with-axis2=${AXIS2C_HOME}/include/axis2-1.5.0
 make -j30
 make install
+
+if [ -d  $POLICY_DIR];
+then
+    echo "$POLICY_DIR exists. "
+else
+    #Create Policy Dir
+    echo "Deploying Policies"
+    mkdir $POLICY_DIR
+fi
+
+cp policy/* $POLICY_DIR/

Added: webservices/sandesha/trunk/c/samples/policy/rm10-policy.xml
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/samples/policy/rm10-policy.xml?rev=696925&view=auto
==============================================================================
--- webservices/sandesha/trunk/c/samples/policy/rm10-policy.xml (added)
+++ webservices/sandesha/trunk/c/samples/policy/rm10-policy.xml Thu Sep 18 
22:39:08 2008
@@ -0,0 +1,20 @@
+<wsp:Policy wsu:Id="RmPolicy" 
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"; 
xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm/policy"; 
xmlns:sanc="http://ws.apache.org/sandesha2/c/policy"; 
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";>
+    <wsp:ExactlyOne>
+        <wsp:All>
+            <wsrm:RMAssertion>
+                <wsrm:InactivityTimeout Milliseconds="600000"/>
+                <wsrm:AcknowledgementInterval Milliseconds="200"/>
+                <wsrm:BaseRetransmissionInterval Milliseconds="8"/>
+                <wsrm:ExponentialBackoff/>
+                <sanc:InactivityTimeout>64</sanc:InactivityTimeout>
+                <sanc:StorageManager>persistent</sanc:StorageManager>
+                <sanc:MessageTypesToDrop>none</sanc:MessageTypesToDrop>
+                <sanc:MaxRetransCount>10</sanc:MaxRetransCount>
+                <sanc:SenderSleepTime>1</sanc:SenderSleepTime><!--In seconds-->
+                <sanc:InvokerSleepTime>1</sanc:InvokerSleepTime>
+                <sanc:PollingWaitTime>4</sanc:PollingWaitTime>
+                <sanc:TerminateDelay>4</sanc:TerminateDelay>
+            </wsrm:RMAssertion>
+        </wsp:All>
+    </wsp:ExactlyOne>
+</wsp:Policy>

Added: webservices/sandesha/trunk/c/samples/policy/rm11-policy.xml
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/samples/policy/rm11-policy.xml?rev=696925&view=auto
==============================================================================
--- webservices/sandesha/trunk/c/samples/policy/rm11-policy.xml (added)
+++ webservices/sandesha/trunk/c/samples/policy/rm11-policy.xml Thu Sep 18 
22:39:08 2008
@@ -0,0 +1,26 @@
+<wsp:Policy wsu:Id="RmPolicy" 
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"; 
xmlns:wsrmp="http://docs.oasis-open.org/ws-rx/wsrmp/200702"; 
xmlns:sanc="http://ws.apache.org/sandesha2/c/policy"; 
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";>
+    <wsp:ExactlyOne>
+        <wsp:All>
+            <wsrmp:RMAssertion>
+                <wsp:Policy>
+                    <wsrmp:DeliveryAssurance>
+                        <wsp:Policy>
+                            <wsrmp:ExactlyOnce/>
+                            <!--wsrmp:InOrder/-->
+                        </wsp:Policy>
+                    </wsrmp:DeliveryAssurance>
+                </wsp:Policy>
+                <sanc:InactivityTimeout>600000</sanc:InactivityTimeout>
+                
<sanc:AcknowledgementInterval>200</sanc:AcknowledgementInterval>
+                
<sanc:BaseRetransmissionInterval>8</sanc:BaseRetransmissionInterval>
+                <sanc:StorageManager>persistent</sanc:StorageManager>
+                <sanc:MessageTypesToDrop>none</sanc:MessageTypesToDrop>
+                <sanc:MaxRetransCount>10</sanc:MaxRetransCount>
+                <sanc:SenderSleepTime>1</sanc:SenderSleepTime><!--In seconds-->
+                <sanc:InvokerSleepTime>1</sanc:InvokerSleepTime>
+                <sanc:PollingWaitTime>4</sanc:PollingWaitTime>
+                <sanc:TerminateDelay>4</sanc:TerminateDelay>
+            </wsrmp:RMAssertion>
+        </wsp:All>
+    </wsp:ExactlyOne>
+</wsp:Policy>

Modified: webservices/sandesha/trunk/c/samples/rm_echo_1_0/rm_echo.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/samples/rm_echo_1_0/rm_echo.c?rev=696925&r1=696924&r2=696925&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/samples/rm_echo_1_0/rm_echo.c (original)
+++ webservices/sandesha/trunk/c/samples/rm_echo_1_0/rm_echo.c Thu Sep 18 
22:39:08 2008
@@ -152,7 +152,7 @@
     }
 
      /*Create the policy, from file*/
-    policy = neethi_util_create_policy_from_file(env, "policy.xml");
+    policy = neethi_util_create_policy_from_file(env, 
"policy/rm10-policy.xml");
     if(!policy)
     {
         printf("\nPolicy creation failed from the file");

Modified: 
webservices/sandesha/trunk/c/samples/rm_echo_1_0_large_sequence/rm_echo.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/samples/rm_echo_1_0_large_sequence/rm_echo.c?rev=696925&r1=696924&r2=696925&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/samples/rm_echo_1_0_large_sequence/rm_echo.c 
(original)
+++ webservices/sandesha/trunk/c/samples/rm_echo_1_0_large_sequence/rm_echo.c 
Thu Sep 18 22:39:08 2008
@@ -28,6 +28,8 @@
 #include <sandesha2_client.h>
 #include <platforms/axutil_platform_auto_sense.h>
 #include <ctype.h>
+#include <neethi_policy.h>
+#include <neethi_util.h>
 
 #define SANDESHA2_MAX_COUNT 8
 
@@ -70,7 +72,9 @@
     axis2_char_t *offered_seq_id = NULL;
     int c;
     int i = 0;
-   
+    neethi_policy_t *policy = NULL;
+    axis2_status_t status = AXIS2_FAILURE;  
+ 
     /* Set up the environment */
     env = axutil_env_create_all("rm_echo_1_0.log", 
             AXIS2_LOG_LEVEL_TRACE);
@@ -146,6 +150,21 @@
             AXIS2_ERROR_GET_MESSAGE(env->error));
         return -1;
     }
+
+    policy = neethi_util_create_policy_from_file(env, 
"policy/rm10-policy.xml");
+    if(!policy)
+    {
+        printf("\nPolicy creation failed from the file");
+        return 0;
+    }
+
+    status = axis2_svc_client_set_policy(svc_client, env, policy);
+
+    if(status == AXIS2_FAILURE)
+    {
+        printf("Policy setting failed\n");
+    }
+
     axis2_options_set_soap_version(options, env, AXIOM_SOAP11);
 
     /* Offer sequence */

Modified: webservices/sandesha/trunk/c/samples/rm_echo_1_1/rm_echo_1_1.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/samples/rm_echo_1_1/rm_echo_1_1.c?rev=696925&r1=696924&r2=696925&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/samples/rm_echo_1_1/rm_echo_1_1.c (original)
+++ webservices/sandesha/trunk/c/samples/rm_echo_1_1/rm_echo_1_1.c Thu Sep 18 
22:39:08 2008
@@ -29,6 +29,8 @@
 #include <axis2_addr.h>
 #include <platforms/axutil_platform_auto_sense.h>
 #include <ctype.h>
+#include <neethi_util.h>
+#include <neethi_policy.h>
 
 #define SANDESHA2_MAX_COUNT 4
 
@@ -71,6 +73,8 @@
     axis2_bool_t offer = AXIS2_TRUE;
     axis2_char_t *seq_key = NULL;
     int c;
+    neethi_policy_t *policy = NULL;
+    axis2_status_t status = AXIS2_FAILURE;
    
     /* Set up the environment */
     env = axutil_env_create_all("rm_echo_1_1.log", AXIS2_LOG_LEVEL_TRACE);
@@ -153,6 +157,22 @@
         return -1;
     }
 
+    /*Create the policy, from file*/
+    policy = neethi_util_create_policy_from_file(env, 
"policy/rm11-policy.xml");
+    if(!policy)
+    {
+        printf("\nPolicy creation failed from the file");
+        return 0;
+    }
+
+    status = axis2_svc_client_set_policy(svc_client, env, policy);
+
+    if(status == AXIS2_FAILURE)
+    {
+        printf("Policy setting failed\n");
+    }
+
+
     /* Set service client options */
     axis2_svc_client_set_options(svc_client, env, options);    
     

Modified: 
webservices/sandesha/trunk/c/samples/rm_echo_single_1_0/rm_echo_single.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/samples/rm_echo_single_1_0/rm_echo_single.c?rev=696925&r1=696924&r2=696925&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/samples/rm_echo_single_1_0/rm_echo_single.c 
(original)
+++ webservices/sandesha/trunk/c/samples/rm_echo_single_1_0/rm_echo_single.c 
Thu Sep 18 22:39:08 2008
@@ -28,6 +28,8 @@
 #include <axis2_addr.h>
 #include <axis2_options.h>
 #include <ctype.h>
+#include <neethi_policy.h>
+#include <neethi_util.h>
 
 #define SANDESHA2_MAX_COUNT 2
 
@@ -49,6 +51,8 @@
     axiom_node_t *result = NULL;
     axutil_string_t *soap_action = NULL;
     axis2_char_t *seq_key = NULL;
+    axis2_status_t status = AXIS2_FAILURE;
+    neethi_policy_t *policy = NULL;
     int c, i;
    
     /* Set up the environment */
@@ -124,6 +128,20 @@
         return -1;
     }
 
+    policy = neethi_util_create_policy_from_file(env, 
"policy/rm10-policy.xml");
+    if(!policy)
+    {
+        printf("\nPolicy creation failed from the file");
+        return 0;
+    }
+
+    status = axis2_svc_client_set_policy(svc_client, env, policy);
+
+    if(status == AXIS2_FAILURE)
+    {
+        printf("Policy setting failed\n");
+    }
+
     /* Set service client options */
     axis2_svc_client_set_options(svc_client, env, options);    
     

Modified: 
webservices/sandesha/trunk/c/samples/rm_echo_single_1_0_large_sequence/rm_echo_single.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/samples/rm_echo_single_1_0_large_sequence/rm_echo_single.c?rev=696925&r1=696924&r2=696925&view=diff
==============================================================================
--- 
webservices/sandesha/trunk/c/samples/rm_echo_single_1_0_large_sequence/rm_echo_single.c
 (original)
+++ 
webservices/sandesha/trunk/c/samples/rm_echo_single_1_0_large_sequence/rm_echo_single.c
 Thu Sep 18 22:39:08 2008
@@ -28,6 +28,8 @@
 #include <axis2_addr.h>
 #include <axis2_options.h>
 #include <ctype.h>
+#include <neethi_policy.h>
+#include <neethi_util.h>
 
 #define SANDESHA2_MAX_COUNT 4
 
@@ -52,7 +54,9 @@
     axis2_char_t *seq_key = NULL;
     int c;
     int i = 1;
-   
+    neethi_policy_t *policy = NULL;
+    axis2_status_t status = AXIS2_FAILURE;  
+ 
     /* Set up the environment */
     env = axutil_env_create_all("rm_echo_single_1_0.log", 
             AXIS2_LOG_LEVEL_TRACE);
@@ -121,6 +125,21 @@
         return -1;
     }
 
+    policy = neethi_util_create_policy_from_file(env, 
"policy/rm10-policy.xml");
+    if(!policy)
+    {
+        printf("\nPolicy creation failed from the file");
+        return 0;
+    }
+
+    status = axis2_svc_client_set_policy(svc_client, env, policy);
+
+    if(status == AXIS2_FAILURE)
+    {
+        printf("Policy setting failed\n");
+    }
+
+
     /* Set service client options */
     axis2_svc_client_set_options(svc_client, env, options);    
     

Modified: 
webservices/sandesha/trunk/c/samples/rm_echo_single_1_1/rm_echo_single_1_1.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/samples/rm_echo_single_1_1/rm_echo_single_1_1.c?rev=696925&r1=696924&r2=696925&view=diff
==============================================================================
--- 
webservices/sandesha/trunk/c/samples/rm_echo_single_1_1/rm_echo_single_1_1.c 
(original)
+++ 
webservices/sandesha/trunk/c/samples/rm_echo_single_1_1/rm_echo_single_1_1.c 
Thu Sep 18 22:39:08 2008
@@ -29,6 +29,8 @@
 #include <sandesha2_client.h>
 #include <axis2_addr.h>
 #include <ctype.h>
+#include <neethi_util.h>
+#include <neethi_policy.h>
 
 #define SANDESHA2_SLEEP 4
 
@@ -51,8 +53,9 @@
     axis2_char_t *offered_seq_id = NULL;
     axis2_char_t *seq_key = NULL;
     int c;
-    /*axis2_status_t status = AXIS2_FAILURE;*/
+    axis2_status_t status = AXIS2_FAILURE;
     axiom_node_t *result = NULL;
+    neethi_policy_t *policy = NULL;
    
     /* Set up the environment */
     env = axutil_env_create_all("rm_echo_single_1_1.log", 
AXIS2_LOG_LEVEL_TRACE);
@@ -131,6 +134,21 @@
         return -1;
     }
 
+    policy = neethi_util_create_policy_from_file(env, 
"policy/rm11-policy.xml");
+    if(!policy)
+    {
+        printf("\nPolicy creation failed from the file");
+        return 0;
+    }
+
+    status = axis2_svc_client_set_policy(svc_client, env, policy);
+
+    if(status == AXIS2_FAILURE)
+    {
+        printf("Policy setting failed\n");
+    }
+
+
     /* Set service client options */
     axis2_svc_client_set_options(svc_client, env, options);    
     

Modified: webservices/sandesha/trunk/c/samples/rm_mtom_1_0/rm_mtom_1_0.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/samples/rm_mtom_1_0/rm_mtom_1_0.c?rev=696925&r1=696924&r2=696925&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/samples/rm_mtom_1_0/rm_mtom_1_0.c (original)
+++ webservices/sandesha/trunk/c/samples/rm_mtom_1_0/rm_mtom_1_0.c Thu Sep 18 
22:39:08 2008
@@ -28,6 +28,8 @@
 #include <sandesha2_constants.h>
 #include <sandesha2_client_constants.h>
 #include <ctype.h>
+#include <neethi_policy.h>
+#include <neethi_util.h>
 
 #define SANDESHA2_MAX_COUNT 8
 void 
@@ -57,7 +59,9 @@
     axis2_char_t *seq_key = NULL;
     axis2_bool_t optimized = AXIS2_TRUE;
     axis2_char_t *offered_seq_id = NULL;
-   
+    neethi_policy_t *policy = NULL;
+    axis2_status_t status = AXIS2_FAILURE;  
+ 
     /* Set up the environment */
     env = axutil_env_create_all("rm_mtom_1_0.log", 
         AXIS2_LOG_LEVEL_TRACE);
@@ -125,6 +129,21 @@
         return -1;
     }
 
+    policy = neethi_util_create_policy_from_file(env, 
"policy/rm10-policy.xml");
+    if(!policy)
+    {
+        printf("\nPolicy creation failed from the file");
+        return 0;
+    }
+
+    status = axis2_svc_client_set_policy(svc_client, env, policy);
+
+    if(status == AXIS2_FAILURE)
+    {
+        printf("Policy setting failed\n");
+    }
+
+
     /* Set service client options */
     axis2_svc_client_set_options(svc_client, env, options);    
     

Modified: webservices/sandesha/trunk/c/samples/rm_ping_1_0/rm_ping_1_0.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/samples/rm_ping_1_0/rm_ping_1_0.c?rev=696925&r1=696924&r2=696925&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/samples/rm_ping_1_0/rm_ping_1_0.c (original)
+++ webservices/sandesha/trunk/c/samples/rm_ping_1_0/rm_ping_1_0.c Thu Sep 18 
22:39:08 2008
@@ -116,7 +116,7 @@
     }
 
     /*Create the policy, from file*/
-    policy = neethi_util_create_policy_from_file(env, "policy.xml");
+    policy = neethi_util_create_policy_from_file(env, 
"policy/rm10-policy.xml");
     if(!policy)
     {
         printf("\nPolicy creation failed from the file");

Modified: webservices/sandesha/trunk/c/samples/rm_ping_1_1/rm_ping_1_1.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/samples/rm_ping_1_1/rm_ping_1_1.c?rev=696925&r1=696924&r2=696925&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/samples/rm_ping_1_1/rm_ping_1_1.c (original)
+++ webservices/sandesha/trunk/c/samples/rm_ping_1_1/rm_ping_1_1.c Thu Sep 18 
22:39:08 2008
@@ -23,6 +23,8 @@
 #include <sandesha2_constants.h>
 #include <sandesha2_client.h>
 #include <ctype.h>
+#include <neethi_policy.h>
+#include <neethi_util.h>
 
 #define MAX_COUNT 2
 
@@ -46,9 +48,10 @@
     const axis2_char_t *client_home = NULL;
     axis2_svc_client_t* svc_client = NULL;
     axiom_node_t *payload = NULL;
-    axis2_status_t status = AXIS2_FAILURE;
     axutil_property_t *property = NULL;
     int c;
+    neethi_policy_t *policy = NULL;
+    axis2_status_t status = AXIS2_FAILURE;
    
     /* Set up the environment */
     env = axutil_env_create_all("rm_ping.log", AXIS2_LOG_LEVEL_TRACE);
@@ -111,6 +114,21 @@
             AXIS2_ERROR_GET_MESSAGE(env->error));
     }
 
+    /*Create the policy, from file*/
+    policy = neethi_util_create_policy_from_file(env, 
"policy/rm11-policy.xml");
+    if(!policy)
+    {
+        printf("\nPolicy creation failed from the file");
+        return 0;
+    }
+
+    status = axis2_svc_client_set_policy(svc_client, env, policy);
+
+    if(status == AXIS2_FAILURE)
+    {
+        printf("Policy setting failed\n");
+    }
+
     /* Set service client options */
     axis2_svc_client_set_options(svc_client, env, options);    
     



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

Reply via email to