You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by di...@apache.org on 2006/10/26 07:39:25 UTC
svn commit: r467875 - in /webservices/axis2/trunk/c: ChangeLog NEWS
xdocs/docs/axis2c_manual.html xdocs/index.html
Author: dinesh
Date: Wed Oct 25 22:39:25 2006
New Revision: 467875
URL: http://svn.apache.org/viewvc?view=rev&rev=467875
Log:
axis2_manual code snippets formatted
Modified:
webservices/axis2/trunk/c/ChangeLog
webservices/axis2/trunk/c/NEWS
webservices/axis2/trunk/c/xdocs/docs/axis2c_manual.html
webservices/axis2/trunk/c/xdocs/index.html
Modified: webservices/axis2/trunk/c/ChangeLog
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/ChangeLog?view=diff&rev=467875&r1=467874&r2=467875
==============================================================================
--- webservices/axis2/trunk/c/ChangeLog (original)
+++ webservices/axis2/trunk/c/ChangeLog Wed Oct 25 22:39:25 2006
@@ -1,7 +1,7 @@
Axis2-C (0.95)
* Major Memory leak fixes
* Many Bug Fixes
- * Documentation improvements
+ * Improved Documentation
-- Axis2-C team <ax...@ws.apache.org> Thu, 26 October 2006
Axis2-C (0.94)
Modified: webservices/axis2/trunk/c/NEWS
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/NEWS?view=diff&rev=467875&r1=467874&r2=467875
==============================================================================
--- webservices/axis2/trunk/c/NEWS (original)
+++ webservices/axis2/trunk/c/NEWS Wed Oct 25 22:39:25 2006
@@ -28,10 +28,12 @@
19. Guththila pull parser support
20. WSDL2C code generation tool- with schema code generation
21. TCP Monitor - C implementation
+ 22. Axis2/C Manual - New
Major Changes Since Last Release
1. Major Memory leak fixes
2. Many Bug Fixes
+ 3. Improved Documentation
TODOs Remaining for 1.0
1. Complete API documentation and API improvements
Modified: webservices/axis2/trunk/c/xdocs/docs/axis2c_manual.html
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/xdocs/docs/axis2c_manual.html?view=diff&rev=467875&r1=467874&r2=467875
==============================================================================
--- webservices/axis2/trunk/c/xdocs/docs/axis2c_manual.html (original)
+++ webservices/axis2/trunk/c/xdocs/docs/axis2c_manual.html Wed Oct 25 22:39:25 2006
@@ -519,9 +519,9 @@
such as service group name, service name, set of operations for each service
etc.</p>
-<a name="svc_api"></a><h1>3. Service API</h1>
+<a name="svc_api"></a><h1>3. Service API</H1>
-<p>We have already seen how to write a service in quick start guide section
+<P>We have already seen how to write a service in quick start guide section
of this manual. This section would cover the service API of Axis2/C in a bit
more detail.</p>
@@ -566,128 +566,58 @@
<br>
-<p><font color="#800000">int</font>Â <font
-color="#000000">AXIS2_CALL</font><br>
-<font color="#000000">math_free</font>(<font
-color="#000000">axis2_svc_skeleton_t</font>Â *<font
-color="#000000">svc_skeleton</font>,<br>
-Â Â Â Â Â Â Â Â <font color="#800000">const</font>Â <font
-color="#000000">axis2_env_t</font>Â *<font color="#000000">env</font>)<br>
-{<br>
-Â Â Â Â <font color="#000000"><b>if</b></font>Â (<font
-color="#000000">svc_skeleton</font>-><font color="#000000">ops</font>)<br>
-Â Â Â Â {<br>
-Â Â Â Â Â Â Â Â <font color="#000000">AXIS2_FREE</font>(<font
-color="#000000">env</font>-><font color="#000000">allocator</font>, <font
-color="#000000">svc_skeleton</font>-><font color="#000000">ops</font>);<br>
-Â Â Â Â Â Â Â Â <font color="#000000">svc_skeleton</font>-><font
-color="#000000">ops</font>Â =Â <font color="#000000">NULL</font>;<br>
-Â Â Â Â }<br>
-<br>
-Â Â Â Â <font color="#000000"><b>if</b></font>Â (<font
-color="#000000">svc_skeleton</font>)<br>
-Â Â Â Â {<br>
-Â Â Â Â Â Â Â Â <font color="#000000">AXIS2_FREE</font>(<font
-color="#000000">env</font>-><font color="#000000">allocator</font>, <font
-color="#000000">svc_skeleton</font>);<br>
-Â Â Â Â Â Â Â Â <font color="#000000">svc_skeleton</font>Â =Â <font
-color="#000000">NULL</font>;<br>
-Â Â Â Â }<br>
-Â Â Â Â <font color="#000000"><b>return</b></font>Â <font
-color="#000000">AXIS2_SUCCESS</font>;<br>
-}<br>
-</p>
-<br>
-
+<pre>int AXIS2_CALL
+math_free (axis2_svc_skeleton_t *svc_skeleton, const axis2_env_t *env
+{
+    if (svc_skeleton->ops)
+Â Â Â Â {
+        AXIS2_FREE(env->allocator, svc_skeleton->ops);
+        svc_skeleton-> ops = NULL;
+Â Â Â Â }
+Â Â Â Â if(svc_skeleton)
+Â Â Â Â {
+Â Â Â Â Â Â AXIS2_FREE (env->allocator, svc_skeleton ->ops);
+ svc_skeleton -> NULL;
+Â Â Â Â }
+Â Â Â Â return AXIS2_SUCCESS;
+}
+</pre>
<p>The above code shows the free method implementation of the math sample.</p>
-<p><br>
-<font color="#000000">axiom_node_t</font>*Â <font
-color="#000000">AXIS2_CALL</font><br>
-<font color="#000000">math_invoke</font>(<font
-color="#000000">axis2_svc_skeleton_t</font>Â *<font
-color="#000000">svc_skeleton</font>,<br>
-Â Â Â Â Â Â Â Â <font color="#800000">const</font>Â <font
-color="#000000">axis2_env_t</font>Â *<font color="#000000">env</font>,<br>
-Â Â Â Â Â Â Â Â <font color="#000000">axiom_node_t</font>Â *<font
-color="#000000">node</font>,<br>
-Â Â Â Â Â Â Â Â <font color="#000000">axis2_msg_ctx_t</font>Â *<font
-color="#000000">msg_ctx</font>)<br>
-{<br>
-Â Â Â Â <font color="#000000"><b>if</b></font>Â (<font
-color="#000000">node</font>)<br>
-Â Â Â Â {<br>
-Â Â Â Â Â Â Â Â <font color="#000000"><b>if</b></font>Â (<font
-color="#000000">AXIOM_NODE_GET_NODE_TYPE</font>(<font
-color="#000000">node</font>, <font color="#000000">env</font>) == <font
-color="#000000">AXIOM_ELEMENT</font>)<br>
-Â Â Â Â Â Â Â Â {<br>
-Â Â Â Â Â Â Â Â Â Â Â Â <font color="#000000">axiom_element_t</font>Â *<font
-color="#000000">element</font>Â =Â <font color="#000000">NULL</font>;<br>
-Â Â Â Â Â Â Â Â Â Â Â Â <font color="#000000">element</font>Â =Â (<font
-color="#000000">axiom_element_t</font>Â *)<font
-color="#000000">AXIOM_NODE_GET_DATA_ELEMENT</font>(<font
-color="#000000">node</font>, <font color="#000000">env</font>);<br>
-Â Â Â Â Â Â Â Â Â Â Â Â <font color="#000000"><b>if</b></font>Â (<font
-color="#000000">element</font>)<br>
-Â Â Â Â Â Â Â Â Â Â Â Â {<br>
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â <font
-color="#000000">axis2_char_t</font>Â *<font
-color="#000000">op_name</font>Â =Â <font
-color="#000000">AXIOM_ELEMENT_GET_LOCALNAME</font>(<font
-color="#000000">element</font>, <font color="#000000">env</font>);<br>
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â <font
-color="#000000"><b>if</b></font>Â (<font color="#000000">op_name</font>)<br>
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â {<br>
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â <font
-color="#000000"><b>if</b></font>Â (<font
-color="#000000">AXIS2_STRCMP</font>(<font
-color="#000000">op_name</font>, <font
-color="#FF0000">"add"</font>)Â ==Â <font color="#0000FF">0</font>)<br>
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â <font
-color="#000000"><b>return</b></font>Â <font
-color="#000000">axis2_math_add</font>(<font
-color="#000000">env</font>, <font color="#000000">node</font>);<br>
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â <font
-color="#000000"><b>if</b></font>Â (<font
-color="#000000">AXIS2_STRCMP</font>(<font
-color="#000000">op_name</font>, <font
-color="#FF0000">"sub"</font>)Â ==Â <font color="#0000FF">0</font>)<br>
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â <font
-color="#000000"><b>return</b></font>Â <font
-color="#000000">axis2_math_sub</font>(<font
-color="#000000">env</font>, <font color="#000000">node</font>);<br>
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â <font
-color="#000000"><b>if</b></font>Â (<font
-color="#000000">AXIS2_STRCMP</font>(<font
-color="#000000">op_name</font>, <font
-color="#FF0000">"mul"</font>)Â ==Â <font color="#0000FF">0</font>)<br>
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â <font
-color="#000000"><b>return</b></font>Â <font
-color="#000000">axis2_math_mul</font>(<font
-color="#000000">env</font>, <font color="#000000">node</font>);<br>
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â <font
-color="#000000"><b>if</b></font>Â (<font
-color="#000000">AXIS2_STRCMP</font>(<font
-color="#000000">op_name</font>, <font
-color="#FF0000">"div"</font>)Â ==Â <font color="#0000FF">0</font>)<br>
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â <font
-color="#000000"><b>return</b></font>Â <font
-color="#000000">axis2_math_div</font>(<font
-color="#000000">env</font>, <font color="#000000">node</font>);<br>
-Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â }<br>
-Â Â Â Â Â Â Â Â Â Â Â Â }<br>
-Â Â Â Â Â Â Â Â }<br>
-Â Â Â Â }<br>
-<br>
-Â Â Â Â <font color="#000000">printf</font>(<font
-color="#FF0000">"Math service ERROR: invalid operation invoked\n"</font>);<br>
-<br>
-Â Â Â Â <font color="#000000"><b>return</b></font>Â <font
-color="#000000">node</font>;<br>
-}<br>
-</p>
+<pre>
+axiom_node_t* AXIS2_CALL
+math_invoke(axis2_svc_skeleton_t *svc_skeleton,
+        const axis2_env_t *env,
+        axiom_node_t *node,
+        axis2_msg_ctx_t *msg_ctx)
+{
+Â Â Â Â <b>if</b>Â (node)
+Â Â Â Â {
+        <b>if</b> (AXIOM_NODE_GET_NODE_TYPE(node, env) == AXIOM_ELEMENT)
+Â Â Â Â Â Â Â Â {
+            axiom_element_t *element = NULL;
+            element = (axiom_element_t *)AXIOM_NODE_GET_DATA_ELEMENT(node, env);
+Â Â Â Â Â Â Â Â Â Â Â Â <b>if</b>Â (element)
+Â Â Â Â Â Â Â Â Â Â Â Â {
+                axis2_char_t *op_name = AXIOM_ELEMENT_GET_LOCALNAME(element, env);
+Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â <b>if</b>Â (op_name)
+Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â {
+                    <b>if</b> (AXIS2_STRCMP(op_name, "add") == 0)
+                        <b>return</b> axis2_math_add(env, node);
+                    <b>if</b> (AXIS2_STRCMP(op_name, "sub") == 0)
+                        <b>return</b> axis2_math_sub(env, node);
+                    <b>if</b> (AXIS2_STRCMP(op_name, "mul") == 0)
+                        <b>return</b> axis2_math_mul(env, node);
+                    <b>if</b> (AXIS2_STRCMP(op_name, "div") == 0)
+                        <b>return</b> axis2_math_div(env, node);
+Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â }
+Â Â Â Â Â Â Â Â Â Â Â Â }
+Â Â Â Â Â Â Â Â }
+Â Â Â Â }
+    printf("Math service ERROR: invalid operation invoked\n");
+Â Â Â Â <b>return</b>node;
+}</pre>
<p>The above code fragment from math sample shows how the correct method to
be invoked could be picked from the operation name that comes in the message
@@ -700,51 +630,29 @@
shared library. The engine also looks to a function named
axis2_remove_instance for clean up purposes in the shared library.</p>
-<p><font color="#000000">AXIS2_EXPORT</font>Â <font
-color="#800000">int</font>Â <font
-color="#000000">axis2_get_instance</font>(<font
-color="#000000"><b>struct</b></font>Â <font
-color="#000000">axis2_svc_skeleton</font>Â **<font
-color="#000000">inst</font>,<br>
-Â Â Â Â Â Â Â Â <font color="#800000">const</font>Â <font
-color="#000000">axis2_env_t</font>Â *<font color="#000000">env</font>)<br>
-{<br>
-Â Â Â Â *<font color="#000000">inst</font>Â =Â <font
-color="#000000">axis2_math_create</font>(<font
-color="#000000">env</font>);<br>
-Â Â Â Â <font color="#000000"><b>if</b></font>Â (!(*<font
-color="#000000">inst</font>))<br>
-Â Â Â Â {<br>
-Â Â Â Â Â Â Â Â <font color="#000000"><b>return</b></font>Â <font
-color="#000000">AXIS2_FAILURE</font>;<br>
-Â Â Â Â }<br>
-<br>
-Â Â Â Â <font color="#000000"><b>return</b></font>Â <font
-color="#000000">AXIS2_SUCCESS</font>;<br>
-}<br>
-<br>
-<font color="#000000">AXIS2_EXPORT</font>Â <font
-color="#800000">int</font>Â <font
-color="#000000">axis2_remove_instance</font>(<font
-color="#000000">axis2_svc_skeleton_t</font>Â *<font
-color="#000000">inst</font>,<br>
-Â Â Â Â Â Â Â Â <font color="#800000">const</font>Â <font
-color="#000000">axis2_env_t</font>Â *<font color="#000000">env</font>)<br>
-{<br>
-Â Â Â Â <font color="#000000">axis2_status_t</font>Â <font
-color="#000000">status</font>Â =Â <font
-color="#000000">AXIS2_FAILURE</font>;<br>
-Â Â Â Â <font color="#000000"><b>if</b></font>Â (<font
-color="#000000">inst</font>)<br>
-Â Â Â Â {<br>
-Â Â Â Â Â Â Â Â <font color="#000000">status</font>Â =Â <font
-color="#000000">AXIS2_SVC_SKELETON_FREE</font>(<font
-color="#000000">inst</font>, <font color="#000000">env</font>);<br>
-Â Â Â Â }<br>
-Â Â Â Â <font color="#000000"><b>return</b></font>Â <font
-color="#000000">status</font>;<br>
-}<br>
-</p>
+<pre>AXIS2_EXPORT int axis2_get_instance(struct axis2_svc_skeleton **inst,
+        const axis2_env_t *env)
+{
+    *inst = axis2_math_create(env);
+Â Â Â Â if>Â (!(*inst))
+Â Â Â Â {
+        return AXIS2_FAILURE;
+Â Â Â Â }
+
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_EXPORT int axis2_remove_instance(axis2_svc_skeleton_t *inst,
+        const axis2_env_t *env)
+{
+    axis2_status_t status = AXIS2_FAILURE;
+    if (inst)
+Â Â Â Â {
+        status = AXIS2_SVC_SKELETON_FREE(inst, env);
+Â Â Â Â }
+    return status;
+}
+</pre>
<p>Note that service instantiation happens per request. That means for each
request, the create method would be called and a new axis2_svc_skeleton
Modified: webservices/axis2/trunk/c/xdocs/index.html
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/xdocs/index.html?view=diff&rev=467875&r1=467874&r2=467875
==============================================================================
--- webservices/axis2/trunk/c/xdocs/index.html (original)
+++ webservices/axis2/trunk/c/xdocs/index.html Wed Oct 25 22:39:25 2006
@@ -67,16 +67,16 @@
<li>Dynamic invocation support (based on XML schema and WSDL
implementations)</li>
<li>Guththila pull parser support</li>
- <li>WSDL2C code generation tool- with schema code generation (experimental)
- - <strong>New</strong></li>
- <li>TCP Monitor - C implementation (experimental) -
- <strong>New</strong></li>
+ <li>WSDL2C code generation tool- with schema code generation (experimental)</li>
+ <li>TCP Monitor - C implementation (experimental)</li>
+ <li>Axis2/C Manual - <strong>New</strong></li>
</ol>
<h4>Major Changes Since Last Release</h4>
<ol>
<li>Major Memory leak fixes</li>
<li>Many Bug Fixes</li>
+ <li>Improved Documentation </li>
</ol>
<h4>TODOs Remaining for 1.0</h4>
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org