summaryrefslogtreecommitdiffstats
path: root/samples
diff options
context:
space:
mode:
Diffstat (limited to 'samples')
-rw-r--r--samples/client/echo/echo.c11
-rw-r--r--samples/server/echo/echo.c11
-rw-r--r--samples/server/math/math.c17
-rw-r--r--samples/server/mtom/mtom.c12
-rw-r--r--samples/user_guide/clients/echo_util.c15
5 files changed, 27 insertions, 39 deletions
diff --git a/samples/client/echo/echo.c b/samples/client/echo/echo.c
index 94a0a20..6a06920 100644
--- a/samples/client/echo/echo.c
+++ b/samples/client/echo/echo.c
@@ -176,15 +176,12 @@ build_om_payload_for_echo_svc(
axiom_namespace_t *ns1 = NULL;
axis2_char_t *om_str = NULL;
- ns1 =
- axiom_namespace_create(env, "http://ws.apache.org/axis2/services/echo",
- "ns1");
- echo_om_ele =
- axiom_element_create(env, NULL, "echoString", ns1, &echo_om_node);
- text_om_ele =
- axiom_element_create(env, echo_om_node, "text", NULL, &text_om_node);
+ ns1 = axiom_namespace_create(env, "http://ws.apache.org/axis2/services/echo", "ns1");
+ echo_om_ele = axiom_element_create(env, NULL, "echoString", ns1, &echo_om_node);
+ text_om_ele = axiom_element_create(env, echo_om_node, "text", NULL, &text_om_node);
axiom_element_set_text(text_om_ele, env, "Hello World!", text_om_node);
om_str = axiom_node_to_string(echo_om_node, env);
+ axiom_namespace_free(ns1, env);
if (om_str)
{
diff --git a/samples/server/echo/echo.c b/samples/server/echo/echo.c
index 2ce6a08..bb3ec1d 100644
--- a/samples/server/echo/echo.c
+++ b/samples/server/echo/echo.c
@@ -95,14 +95,11 @@ build_om_programatically(
axiom_element_t *text_om_ele = NULL;
axiom_namespace_t *ns1 = NULL;
- ns1 =
- axiom_namespace_create(env, "http://ws.apache.org/axis2/c/samples",
- "ns1");
- echo_om_ele =
- axiom_element_create(env, NULL, "echoString", ns1, &echo_om_node);
- text_om_ele =
- axiom_element_create(env, echo_om_node, "text", NULL, &text_om_node);
+ ns1 = axiom_namespace_create(env, "http://ws.apache.org/axis2/c/samples", "ns1");
+ echo_om_ele = axiom_element_create(env, NULL, "echoString", ns1, &echo_om_node);
+ text_om_ele = axiom_element_create(env, echo_om_node, "text", NULL, &text_om_node);
axiom_element_set_text(text_om_ele, env, text, text_om_node);
+ axiom_namespace_free(ns1, env);
return echo_om_node;
}
diff --git a/samples/server/math/math.c b/samples/server/math/math.c
index c3236a2..505c5e5 100644
--- a/samples/server/math/math.c
+++ b/samples/server/math/math.c
@@ -132,10 +132,10 @@ axis2_math_add(
result = param1 + param2;
sprintf(result_str, "%ld", result);
- ns1 = axiom_namespace_create(env,
- "http://axis2/test/namespace1", "ns1");
+ ns1 = axiom_namespace_create(env, "http://axis2/test/namespace1", "ns1");
ele1 = axiom_element_create(env, NULL, "result", ns1, &node1);
text1 = axiom_text_create(env, node1, result_str, &node2);
+ axiom_namespace_free(ns1, env);
return node1;
}
@@ -261,11 +261,10 @@ axis2_math_sub(
result = param1 - param2;
sprintf(result_str, "%ld", result);
- ns1 = axiom_namespace_create(env,
- "http://axis2/test/namespace1", "ns1");
+ ns1 = axiom_namespace_create(env, "http://axis2/test/namespace1", "ns1");
ele1 = axiom_element_create(env, NULL, "result", ns1, &node1);
text1 = axiom_text_create(env, node1, result_str, &node2);
-
+ axiom_namespace_free(ns1, env);
return node1;
}
@@ -390,10 +389,10 @@ axis2_math_mul(
result = param1 * param2;
sprintf(result_str, "%ld", result);
- ns1 = axiom_namespace_create(env,
- "http://axis2/test/namespace1", "ns1");
+ ns1 = axiom_namespace_create(env, "http://axis2/test/namespace1", "ns1");
ele1 = axiom_element_create(env, NULL, "result", ns1, &node1);
text1 = axiom_text_create(env, node1, result_str, &node2);
+ axiom_namespace_free(ns1, env);
return node1;
}
@@ -521,10 +520,10 @@ axis2_math_div(
result = param1 / param2;
sprintf(result_str, "%ld", result);
- ns1 = axiom_namespace_create(env,
- "http://axis2/test/namespace1", "ns1");
+ ns1 = axiom_namespace_create(env,"http://axis2/test/namespace1", "ns1");
ele1 = axiom_element_create(env, NULL, "result", ns1, &node1);
text1 = axiom_text_create(env, node1, result_str, &node2);
+ axiom_namespace_free(ns1, env);
return node1;
}
diff --git a/samples/server/mtom/mtom.c b/samples/server/mtom/mtom.c
index f00b68b..3f10d70 100644
--- a/samples/server/mtom/mtom.c
+++ b/samples/server/mtom/mtom.c
@@ -245,14 +245,10 @@ axiom_node_t *build_response2(
axiom_node_t *text_node = NULL;
axiom_namespace_t *ns1 = NULL;
- ns1 =
- axiom_namespace_create(env, "http://ws.apache.org/axis2/c/samples",
- "ns1");
- mtom_om_ele =
- axiom_element_create(env, NULL, "response", ns1, &mtom_om_node);
-
- axiom_text_create_with_data_handler(env, mtom_om_node, data_handler,
- &text_node);
+ ns1 = axiom_namespace_create(env, "http://ws.apache.org/axis2/c/samples","ns1");
+ mtom_om_ele = axiom_element_create(env, NULL, "response", ns1, &mtom_om_node);
+ axiom_text_create_with_data_handler(env, mtom_om_node, data_handler, &text_node);
+ axiom_namespace_free(ns1, env);
return mtom_om_node;
}
diff --git a/samples/user_guide/clients/echo_util.c b/samples/user_guide/clients/echo_util.c
index a38158b..c3ede56 100644
--- a/samples/user_guide/clients/echo_util.c
+++ b/samples/user_guide/clients/echo_util.c
@@ -30,19 +30,18 @@ build_om_payload_for_echo_svc(
axiom_namespace_t *ns1 = NULL;
axis2_char_t *om_str = NULL;
- ns1 =
- axiom_namespace_create(env, "http://ws.apache.org/axis2/services/echo",
- "ns1");
- echo_om_ele =
- axiom_element_create(env, NULL, "echoString", ns1, &echo_om_node);
- text_om_ele =
- axiom_element_create(env, echo_om_node, "text", NULL, &text_om_node);
+ ns1 = axiom_namespace_create(env, "http://ws.apache.org/axis2/services/echo", "ns1");
+ echo_om_ele = axiom_element_create(env, NULL, "echoString", ns1, &echo_om_node);
+ text_om_ele = axiom_element_create(env, echo_om_node, "text", NULL, &text_om_node);
axiom_element_set_text(text_om_ele, env, "Hello World!", text_om_node);
+ axiom_namespace_free(ns1, env);
om_str = axiom_node_to_string(echo_om_node, env);
if (om_str)
+ {
printf("\nSending OM : %s\n", om_str);
- AXIS2_FREE(env->allocator, om_str);
+ AXIS2_FREE(env->allocator, om_str);
+ }
return echo_om_node;
}