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 da...@apache.org on 2008/11/11 09:46:27 UTC

svn commit: r712997 - in /webservices/axis2/trunk/c: axiom/src/soap/ samples/ samples/client/ samples/client/version/ samples/server/ samples/server/version/ util/src/

Author: damitha
Date: Tue Nov 11 00:46:26 2008
New Revision: 712997

URL: http://svn.apache.org/viewvc?rev=712997&view=rev
Log:
Applying patch in AXIS2C-1277

Added:
    webservices/axis2/trunk/c/samples/client/version/
    webservices/axis2/trunk/c/samples/client/version/Makefile.am
    webservices/axis2/trunk/c/samples/client/version/axis2_version_stub.c
    webservices/axis2/trunk/c/samples/client/version/axis2_version_stub.h
    webservices/axis2/trunk/c/samples/client/version/services.xml
    webservices/axis2/trunk/c/samples/client/version/test.xml
    webservices/axis2/trunk/c/samples/client/version/version_client.c
    webservices/axis2/trunk/c/samples/server/version/
    webservices/axis2/trunk/c/samples/server/version/Makefile.am
    webservices/axis2/trunk/c/samples/server/version/services.xml
    webservices/axis2/trunk/c/samples/server/version/version.c
    webservices/axis2/trunk/c/samples/server/version/version.h
    webservices/axis2/trunk/c/samples/server/version/version_skel.c
Modified:
    webservices/axis2/trunk/c/axiom/src/soap/soap_header.c
    webservices/axis2/trunk/c/samples/client/Makefile.am
    webservices/axis2/trunk/c/samples/configure.ac
    webservices/axis2/trunk/c/samples/server/Makefile.am
    webservices/axis2/trunk/c/util/src/error.c

Modified: webservices/axis2/trunk/c/axiom/src/soap/soap_header.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/src/soap/soap_header.c?rev=712997&r1=712996&r2=712997&view=diff
==============================================================================
--- webservices/axis2/trunk/c/axiom/src/soap/soap_header.c (original)
+++ webservices/axis2/trunk/c/axiom/src/soap/soap_header.c Tue Nov 11 00:46:26 2008
@@ -18,6 +18,7 @@
 
 #include  "_axiom_soap_envelope.h"
 #include "_axiom_soap_header.h"
+#include "_axiom_soap_body.h"
 #include <axiom_soap_header_block.h>
 #include <axutil_hash.h>
 #include <axiom_soap_const.h>
@@ -37,6 +38,8 @@
     int hbnumber;
 
     axiom_soap_builder_t *soap_builder;
+    
+    axiom_soap_envelope_t *soap_envelope;
 
     axutil_array_list_t *header_block_keys;
 };
@@ -64,6 +67,7 @@
     }
 
     soap_header->om_ele_node = NULL;
+    soap_header->soap_envelope = NULL;
     soap_header->hbnumber = 0;
     soap_header->header_blocks = NULL;
 
@@ -88,13 +92,13 @@
 {
     axiom_soap_header_t *soap_header = NULL;
 
-    axiom_element_t *this_ele = NULL;
-    axiom_node_t *this_node = NULL;
+    /*axiom_element_t *this_ele = NULL;
+    axiom_node_t *this_node = NULL;*/
     axiom_node_t *body_node = NULL;
     axiom_node_t *parent_node = NULL;
     axiom_element_t *parent_ele = NULL;
 
-    axiom_namespace_t *parent_ns = NULL;
+    /*axiom_namespace_t *parent_ns = NULL;*/
 
     AXIS2_PARAM_CHECK(env->error, envelope, NULL);
 
@@ -128,7 +132,7 @@
         axiom_node_detach(body_node, env);
     }
 
-    parent_ns = axiom_element_get_namespace(parent_ele, env, parent_node);
+    /*parent_ns = axiom_element_get_namespace(parent_ele, env, parent_node);
     this_ele = axiom_element_create(env, parent_node,
                                     AXIOM_SOAP_HEADER_LOCAL_NAME, parent_ns,
                                     &this_node);
@@ -138,13 +142,17 @@
         return NULL;
     }
 
-    soap_header->om_ele_node = this_node;
+    soap_header->om_ele_node = this_node;*/
+
     axiom_soap_envelope_set_header(envelope, env, soap_header);
 
     if (body_node)
     {
         axiom_node_add_child(parent_node, env, body_node);
     }
+    
+    soap_header->soap_envelope = envelope;
+
     return soap_header;
 }
 
@@ -363,6 +371,52 @@
     axiom_soap_header_t * soap_header,
     const axutil_env_t * env)
 {
+    if(!soap_header->om_ele_node)
+    {
+        axiom_node_t *parent_node = NULL;
+        axiom_element_t *parent_ele = NULL;
+        axiom_namespace_t *parent_ns = NULL;
+        axiom_element_t *this_ele = NULL;
+        axiom_node_t *this_node = NULL;
+        axiom_soap_body_t *soap_body  = NULL;
+        axiom_node_t *body_node = NULL;
+
+        parent_node = axiom_soap_envelope_get_base_node(soap_header->soap_envelope, env);
+
+        if (!parent_node ||
+            axiom_node_get_node_type(parent_node, env) != AXIOM_ELEMENT)
+        {
+            axiom_soap_header_free(soap_header, env);
+            return NULL;
+        }
+
+        parent_ele = (axiom_element_t *)
+            axiom_node_get_data_element(parent_node, env);
+        if (!parent_ele)
+        {
+            axiom_soap_header_free(soap_header, env);
+            return NULL;
+        }
+
+        soap_body = axiom_soap_envelope_get_body(soap_header->soap_envelope, env);
+        if(soap_body)
+        {
+            body_node = axiom_soap_body_get_base_node(soap_body, env);
+        }
+
+        parent_ns = axiom_element_get_namespace(parent_ele, env, parent_node);
+        this_ele = axiom_element_create(env, NULL, AXIOM_SOAP_HEADER_LOCAL_NAME, parent_ns,
+                                        &this_node);
+        if (!this_ele)
+        {
+            axiom_soap_header_free(soap_header, env);
+            return NULL;
+        }
+
+        axiom_node_insert_sibling_before(body_node, env, this_node);
+        soap_header->om_ele_node = this_node;
+    }
+
     return soap_header->om_ele_node;
 }
 

Modified: webservices/axis2/trunk/c/samples/client/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/samples/client/Makefile.am?rev=712997&r1=712996&r2=712997&view=diff
==============================================================================
--- webservices/axis2/trunk/c/samples/client/Makefile.am (original)
+++ webservices/axis2/trunk/c/samples/client/Makefile.am Tue Nov 11 00:46:26 2008
@@ -1,2 +1,2 @@
-SUBDIRS = echo math google notify mtom yahoo amqp
+SUBDIRS = echo math google notify mtom yahoo amqp version
 EXTRA_DIST= Makefile.am

Added: webservices/axis2/trunk/c/samples/client/version/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/samples/client/version/Makefile.am?rev=712997&view=auto
==============================================================================
--- webservices/axis2/trunk/c/samples/client/version/Makefile.am (added)
+++ webservices/axis2/trunk/c/samples/client/version/Makefile.am Tue Nov 11 00:46:26 2008
@@ -0,0 +1,19 @@
+prgbindir=$(prefix)/bin/samples
+prgbin_PROGRAMS = version
+noinst_HEADERS = axis2_version_stub.h
+version_SOURCES = axis2_version_stub.c \
+                version_client.c
+
+version_LDADD   =  \
+                -L$(AXIS2C_HOME)/lib \
+					-laxutil \
+                    -laxis2_axiom \
+                    -laxis2_engine \
+                    -laxis2_parser \
+                    -lpthread \
+                    -laxis2_http_sender \
+                    -laxis2_http_receiver \
+                    $(GUTHTHILA_LIBS)
+
+INCLUDES = @AXIS2INC@
+

Added: webservices/axis2/trunk/c/samples/client/version/axis2_version_stub.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/samples/client/version/axis2_version_stub.c?rev=712997&view=auto
==============================================================================
--- webservices/axis2/trunk/c/samples/client/version/axis2_version_stub.c (added)
+++ webservices/axis2/trunk/c/samples/client/version/axis2_version_stub.c Tue Nov 11 00:46:26 2008
@@ -0,0 +1,114 @@
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "axis2_version_stub.h"
+
+axis2_stub_t *
+axis2_version_stub_create_with_endpoint_ref_and_client_home(
+    const axutil_env_t * env,
+    axis2_endpoint_ref_t * endpoint_ref,
+    axis2_char_t * client_home)
+{
+    axis2_stub_t *stub = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+
+    stub = (axis2_stub_t *)
+        axis2_stub_create_with_endpoint_ref_and_client_home(env, endpoint_ref,
+                                                            client_home);
+    if (!stub)
+    {
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+    axis2_populate_axis_service(stub, env);
+    return stub;
+}
+
+void
+axis2_populate_axis_service(
+    axis2_stub_t * stub,
+    const axutil_env_t * env)
+{
+    axis2_svc_client_t *svc_client = NULL;
+    axutil_qname_t *op_qname = NULL;
+    axis2_svc_t *svc = NULL;
+    axis2_op_t *op = NULL;
+
+    /*Modifying the Service */
+    svc_client = axis2_stub_get_svc_client(stub, env);
+    svc = axis2_svc_client_get_svc(svc_client, env);
+
+    /*creating the operations */
+
+    op_qname = axutil_qname_create(env, "GetVersion", "", NULL);
+    op = axis2_op_create_with_qname(env, op_qname);
+    axis2_op_set_msg_exchange_pattern(op, env, AXIS2_MEP_URI_OUT_IN);
+    axis2_svc_add_op(svc, env, op);
+    axutil_qname_free(op_qname, env);
+
+}
+
+axis2_stub_t *
+axis2_version_stub_create_with_endpoint_uri_and_client_home(
+    const axutil_env_t * env,
+    const axis2_char_t * endpoint_uri,
+    const axis2_char_t * client_home)
+{
+    axis2_stub_t *stub = NULL;
+
+    AXIS2_ENV_CHECK(env, NULL);
+
+    stub = (axis2_stub_t *)
+        axis2_stub_create_with_endpoint_uri_and_client_home(env, endpoint_uri,
+                                                            client_home);
+    if (!stub)
+    {
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+        return NULL;
+    }
+
+    axis2_populate_axis_service(stub, env);
+
+    return stub;
+}
+
+/***************************Function implementation****************************/
+
+axiom_node_t *
+axis2_version_stub_get_version(
+    axis2_stub_t * stub,
+    const axutil_env_t * env,
+    axiom_node_t * node)
+{
+    axis2_svc_client_t *svc_client = NULL;
+    axiom_node_t *ret_node = NULL;
+    axutil_qname_t *op_qname = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+    svc_client = axis2_stub_get_svc_client(stub, env);
+    op_qname = axutil_qname_create(env, "GetVersion", "", NULL);
+    ret_node =
+        axis2_svc_client_send_receive_with_op_qname(svc_client, env, op_qname,
+                                                    node);
+    axutil_qname_free(op_qname, env);
+
+    return ret_node;
+}
+

Added: webservices/axis2/trunk/c/samples/client/version/axis2_version_stub.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/samples/client/version/axis2_version_stub.h?rev=712997&view=auto
==============================================================================
--- webservices/axis2/trunk/c/samples/client/version/axis2_version_stub.h (added)
+++ webservices/axis2/trunk/c/samples/client/version/axis2_version_stub.h Tue Nov 11 00:46:26 2008
@@ -0,0 +1,71 @@
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef AXIS2_VERSION_STUB_H
+#define AXIS2_VERSION_STUB_H
+
+/**
+ * @file axis2_version_stub.h
+ * @brief axis2 version stub interface
+ */
+
+#include <axis2_stub.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+    axiom_node_t *axis2_version_stub_get_version(
+        axis2_stub_t * stub,
+        const axutil_env_t * env,
+        axiom_node_t * node);
+
+    /**
+     * populate services
+     */
+    void axis2_populate_axis_service(
+        axis2_stub_t * stub,
+        const axutil_env_t * env);
+
+    /**
+     * Creates axis2_stub struct
+     * @param endpoint reference
+     * @return pointer to newly created axis2_stub struct
+     */
+    axis2_stub_t *axis2_version_stub_create_with_endpoint_ref_and_client_home(
+        const axutil_env_t * env,
+        axis2_endpoint_ref_t * endpoint_ref,
+        axis2_char_t * client_home);
+
+    /**
+     * Creates axis2_stub struct
+     * @param endpoint uri
+     * @return pointer to newly created axis2_stub struct
+     */
+    axis2_stub_t *axis2_version_stub_create_with_endpoint_uri_and_client_home(
+        const axutil_env_t * env,
+        const axis2_char_t * endpoint_uri,
+        const axis2_char_t * client_home);
+
+    /** @} */
+
+#ifdef __cplusplus
+}
+#endif
+#endif                          /* AXIS2_VERSION_STUB_H */

Added: webservices/axis2/trunk/c/samples/client/version/services.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/samples/client/version/services.xml?rev=712997&view=auto
==============================================================================
--- webservices/axis2/trunk/c/samples/client/version/services.xml (added)
+++ webservices/axis2/trunk/c/samples/client/version/services.xml Tue Nov 11 00:46:26 2008
@@ -0,0 +1,9 @@
+<service name="version">
+    <parameter name="ServiceClass" locked="xsd:false">version</parameter>
+    <description>
+      This is a testing service, named 'version' to test multiple operations in the same service
+    </description>
+    <operation name="get_version">
+      <!--messageReceiver class="axis2_receivers" /-->
+    </operation>
+</service>

Added: webservices/axis2/trunk/c/samples/client/version/test.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/samples/client/version/test.xml?rev=712997&view=auto
==============================================================================
--- webservices/axis2/trunk/c/samples/client/version/test.xml (added)
+++ webservices/axis2/trunk/c/samples/client/version/test.xml Tue Nov 11 00:46:26 2008
@@ -0,0 +1,5 @@
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="http://localhost:80/axisae/aewebservices71.wsdl">
+    <SOAP-ENV:Body>
+        <GetVersion xmlns="urn:aewebservices71" />
+    </SOAP-ENV:Body>
+</SOAP-ENV:Envelope> 

Added: webservices/axis2/trunk/c/samples/client/version/version_client.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/samples/client/version/version_client.c?rev=712997&view=auto
==============================================================================
--- webservices/axis2/trunk/c/samples/client/version/version_client.c (added)
+++ webservices/axis2/trunk/c/samples/client/version/version_client.c Tue Nov 11 00:46:26 2008
@@ -0,0 +1,188 @@
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "axis2_version_stub.h"
+#include <stdio.h>
+#include <axiom.h>
+#include <axis2_util.h>
+#include <axiom_soap.h>
+#include <axis2_client.h>
+
+axiom_node_t *build_om_programatically(
+    const axutil_env_t * env);
+
+int
+main(
+    int argc,
+    char **argv)
+{
+    axis2_stub_t *stub = NULL;
+    axiom_node_t *node = NULL;
+    axis2_status_t status = AXIS2_FAILURE;
+    const axutil_env_t *env = NULL;
+    const axis2_char_t *address = NULL;
+    const axis2_char_t *client_home = NULL;
+    axiom_node_t *ret_node = NULL;
+
+    const axis2_char_t *operation = "get_version";
+    const axis2_char_t *param1 = "40";
+    const axis2_char_t *param2 = "8";
+
+    env = axutil_env_create_all("version_blocking.log", AXIS2_LOG_LEVEL_TRACE);
+
+    client_home = AXIS2_GETENV("AXIS2C_HOME");
+    if (!client_home || !strcmp(client_home, ""))
+        client_home = "../..";
+
+    address = "http://localhost:9090/axis2/services/version";
+    if (argc > 1)
+        operation = argv[1];
+    if (axutil_strcmp(operation, "-h") == 0)
+    {
+        printf("Usage : %s [operation] [param1] [param2] [endpoint_url]\n",
+               argv[0]);
+        printf("use -h for help\n");
+        printf("default operation get_version\n");
+        printf("default param1 %s\n", param1);
+        printf("default param2 %s\n", param2);
+        printf("default endpoint_url %s\n", address);
+        printf
+            ("NOTE: command line arguments must appear in given order, with trailing ones being optional\n");
+        return 0;
+    }
+    if (argc > 2)
+        param1 = argv[2];
+    if (argc > 3)
+        param2 = argv[3];
+    if (argc > 4)
+        address = argv[4];
+
+    printf("Using endpoint : %s\n", address);
+    printf("\nInvoking operation %s\n", operation, param1,
+           param2);
+
+    node = build_om_programatically(env);
+    stub =
+        axis2_version_stub_create_with_endpoint_uri_and_client_home(env, address,
+                                                                 client_home);
+
+    /* create node and invoke version */
+    if (stub)
+    {
+        ret_node = axis2_version_stub_get_version(stub, env, node);
+    }
+
+    if (ret_node)
+    {
+        if (axiom_node_get_node_type(ret_node, env) == AXIOM_ELEMENT)
+        {
+            axis2_char_t *result = NULL;
+            axiom_element_t *result_ele =
+                (axiom_element_t *) axiom_node_get_data_element(ret_node, env);
+
+            result = axiom_element_get_text(result_ele, env, ret_node);
+            printf("\nResult = %s\n", result);
+        }
+        else
+        {
+            axiom_xml_writer_t *writer = NULL;
+            axiom_output_t *om_output = NULL;
+            axis2_char_t *buffer = NULL;
+            writer =
+                axiom_xml_writer_create_for_memory(env, NULL, AXIS2_TRUE, 0,
+                                                   AXIS2_XML_PARSER_TYPE_BUFFER);
+            om_output = axiom_output_create(env, writer);
+
+            axiom_node_serialize(ret_node, env, om_output);
+            buffer = (axis2_char_t *) axiom_xml_writer_get_xml(writer, env);
+            printf("\nReceived invalid OM as result : %s\n", buffer);
+            if (buffer)
+            {
+                AXIS2_FREE(env->allocator, buffer);
+                buffer = NULL;
+            }
+            if (om_output)
+            {
+                axiom_output_free(om_output, env);
+                om_output = NULL;
+            }
+            axiom_xml_writer_free(writer, env);
+        }
+    }
+    else
+    {
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+                        "Stub invoke FAILED: Error code:" " %d :: %s",
+                        env->error->error_number,
+                        AXIS2_ERROR_GET_MESSAGE(env->error));
+        printf("version stub invoke FAILED!\n");
+    }
+
+    if (stub)
+    {
+        axis2_stub_free(stub, env);
+    }
+
+    if (env)
+    {
+        axutil_env_free((axutil_env_t *) env);
+        env = NULL;
+    }
+
+    return status;
+}
+
+axiom_node_t *
+build_om_programatically(
+    const axutil_env_t * env)
+{
+    axiom_node_t *version_om_node = NULL;
+    axiom_element_t *version_om_ele = NULL;
+    axiom_node_t *text_om_node = NULL;
+    axiom_element_t *text_om_ele = NULL;
+    axiom_namespace_t *ns1 = NULL;
+
+    axiom_xml_writer_t *xml_writer = NULL;
+    axiom_output_t *om_output = NULL;
+    axis2_char_t *buffer = NULL;
+
+    ns1 =
+        axiom_namespace_create(env, "urn:aewebservices71",
+                               "ns1");
+
+    version_om_ele =
+        axiom_element_create(env, NULL, "GetVersion", ns1, &version_om_node);
+
+
+    xml_writer =
+        axiom_xml_writer_create_for_memory(env, NULL, AXIS2_FALSE, AXIS2_FALSE,
+                                           AXIS2_XML_PARSER_TYPE_BUFFER);
+    om_output = axiom_output_create(env, xml_writer);
+
+    axiom_node_serialize(version_om_node, env, om_output);
+    buffer = (axis2_char_t *) axiom_xml_writer_get_xml(xml_writer, env);
+    AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "\nSending OM node in XML : %s \n",
+                    buffer);
+    if (om_output)
+    {
+        axiom_output_free(om_output, env);
+        om_output = NULL;
+    }
+
+    return version_om_node;
+}

Modified: webservices/axis2/trunk/c/samples/configure.ac
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/samples/configure.ac?rev=712997&r1=712996&r2=712997&view=diff
==============================================================================
--- webservices/axis2/trunk/c/samples/configure.ac (original)
+++ webservices/axis2/trunk/c/samples/configure.ac Tue Nov 11 00:46:26 2008
@@ -121,6 +121,7 @@
     server/Makefile \
     server/echo/Makefile \
     server/math/Makefile \
+    server/version/Makefile \
     server/Calculator/Makefile \
     server/notify/Makefile \
     server/sg_math/Makefile \
@@ -128,6 +129,7 @@
     client/Makefile \
     client/echo/Makefile \
     client/math/Makefile \
+    client/version/Makefile \
     client/mtom/Makefile \
     client/mtom/resources/Makefile \
     client/notify/Makefile \

Modified: webservices/axis2/trunk/c/samples/server/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/samples/server/Makefile.am?rev=712997&r1=712996&r2=712997&view=diff
==============================================================================
--- webservices/axis2/trunk/c/samples/server/Makefile.am (original)
+++ webservices/axis2/trunk/c/samples/server/Makefile.am Tue Nov 11 00:46:26 2008
@@ -1,3 +1,3 @@
-SUBDIRS = echo math notify sg_math mtom Calculator
+SUBDIRS = echo math notify sg_math mtom Calculator version
 EXTRA_DIST = axis2.xml 
 

Added: webservices/axis2/trunk/c/samples/server/version/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/samples/server/version/Makefile.am?rev=712997&view=auto
==============================================================================
--- webservices/axis2/trunk/c/samples/server/version/Makefile.am (added)
+++ webservices/axis2/trunk/c/samples/server/version/Makefile.am Tue Nov 11 00:46:26 2008
@@ -0,0 +1,8 @@
+prglibdir=$(prefix)/services/version
+prglib_LTLIBRARIES = libversion.la
+prglib_DATA=services.xml 
+noinst_HEADERS = version.h
+SUBDIRS =
+libversion_la_SOURCES = version.c version_skel.c
+libversion_la_LIBADD  =
+INCLUDES = @AXIS2INC@

Added: webservices/axis2/trunk/c/samples/server/version/services.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/samples/server/version/services.xml?rev=712997&view=auto
==============================================================================
--- webservices/axis2/trunk/c/samples/server/version/services.xml (added)
+++ webservices/axis2/trunk/c/samples/server/version/services.xml Tue Nov 11 00:46:26 2008
@@ -0,0 +1,9 @@
+<service name="version">
+    <parameter name="ServiceClass" locked="xsd:false">version</parameter>
+   <description>
+        This is a testing service, named 'version' to test multiple operations in the same service
+   </description>
+    <operation name="GetVersion">
+            <!--messageReceiver class="axis2_receivers" /-->
+    </operation>
+</service>

Added: webservices/axis2/trunk/c/samples/server/version/version.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/samples/server/version/version.c?rev=712997&view=auto
==============================================================================
--- webservices/axis2/trunk/c/samples/server/version/version.c (added)
+++ webservices/axis2/trunk/c/samples/server/version/version.c Tue Nov 11 00:46:26 2008
@@ -0,0 +1,59 @@
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "version.h"
+#include <stdio.h>
+
+axiom_node_t *
+axis2_version_get_version(
+    const axutil_env_t * env,
+    axiom_node_t * node)
+{
+    if (!node)
+    {
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_SVC_SKEL_INPUT_OM_NODE_NULL,
+                        AXIS2_FAILURE);
+        printf("Math client request ERROR: input parameter NULL\n");
+        return NULL;
+    }
+    else
+    {
+        axis2_char_t result_str[255];
+
+        axiom_element_t *ele1 = NULL;
+        axiom_node_t *node1 = NULL,
+            *node2 = NULL;
+        axiom_namespace_t *ns1 = NULL;
+        axiom_text_t *text1 = NULL;
+
+        sprintf(result_str, "%s", "Version 1.0");
+
+        ns1 = axiom_namespace_create(env,
+                                     "urn:aewebservices71", "ns1");
+        ele1 = axiom_element_create(env, NULL, "result", ns1, &node1);
+        text1 = axiom_text_create(env, node1, result_str, &node2);
+
+        return node1;
+    }
+
+    AXIS2_ERROR_SET(env->error,
+                    AXIS2_ERROR_SVC_SKEL_INVALID_OPERATION_PARAMETERS_IN_SOAP_REQUEST,
+                    AXIS2_FAILURE);
+    printf("Math service ERROR: invalid parameters\n");
+    return NULL;
+}
+

Added: webservices/axis2/trunk/c/samples/server/version/version.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/samples/server/version/version.h?rev=712997&view=auto
==============================================================================
--- webservices/axis2/trunk/c/samples/server/version/version.h (added)
+++ webservices/axis2/trunk/c/samples/server/version/version.h Tue Nov 11 00:46:26 2008
@@ -0,0 +1,32 @@
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef MATH_H
+#define MATH_H
+
+#include <axis2_svc_skeleton.h>
+#include <axutil_log_default.h>
+#include <axutil_error_default.h>
+#include <axiom_text.h>
+#include <axiom_node.h>
+#include <axiom_element.h>
+
+axiom_node_t *axis2_version_get_version(
+    const axutil_env_t * env,
+    axiom_node_t * node);
+
+#endif                          /* MATH_H */

Added: webservices/axis2/trunk/c/samples/server/version/version_skel.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/samples/server/version/version_skel.c?rev=712997&view=auto
==============================================================================
--- webservices/axis2/trunk/c/samples/server/version/version_skel.c (added)
+++ webservices/axis2/trunk/c/samples/server/version/version_skel.c Tue Nov 11 00:46:26 2008
@@ -0,0 +1,151 @@
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include "axis2_svc_skeleton.h"
+#include "version.h"
+#include <axutil_array_list.h>
+#include <stdio.h>
+
+int AXIS2_CALL version_free(
+    axis2_svc_skeleton_t * svc_skeleton,
+    const axutil_env_t * env);
+
+/*
+ * This method invokes the right service method
+ */
+axiom_node_t *AXIS2_CALL version_invoke(
+    axis2_svc_skeleton_t * svc_skeleton,
+    const axutil_env_t * env,
+    axiom_node_t * node,
+    axis2_msg_ctx_t * msg_ctx);
+
+int AXIS2_CALL version_init(
+    axis2_svc_skeleton_t * svc_skeleton,
+    const axutil_env_t * env);
+
+static const axis2_svc_skeleton_ops_t version_svc_skeleton_ops_var = {
+    version_init,
+    version_invoke,
+    NULL,
+    version_free
+};
+
+AXIS2_EXTERN axis2_svc_skeleton_t *AXIS2_CALL
+version_create(
+    const axutil_env_t * env)
+{
+    axis2_svc_skeleton_t *svc_skeleton = NULL;
+    svc_skeleton = AXIS2_MALLOC(env->allocator, sizeof(axis2_svc_skeleton_t));
+
+    svc_skeleton->ops = &version_svc_skeleton_ops_var;
+
+    svc_skeleton->func_array = NULL;
+
+    return svc_skeleton;
+}
+
+int AXIS2_CALL
+version_init(
+    axis2_svc_skeleton_t * svc_skeleton,
+    const axutil_env_t * env)
+{
+    /* Any initialization stuff of version goes here */
+    return AXIS2_SUCCESS;
+}
+
+int AXIS2_CALL
+version_free(
+    axis2_svc_skeleton_t * svc_skeleton,
+    const axutil_env_t * env)
+{
+    if (svc_skeleton)
+    {
+        AXIS2_FREE(env->allocator, svc_skeleton);
+        svc_skeleton = NULL;
+    }
+    return AXIS2_SUCCESS;
+}
+
+/*
+ * This method invokes the right service method
+ */
+axiom_node_t *AXIS2_CALL
+version_invoke(
+    axis2_svc_skeleton_t * svc_skeleton,
+    const axutil_env_t * env,
+    axiom_node_t * node,
+    axis2_msg_ctx_t * msg_ctx)
+{
+    /* Depending on the function name invoke the
+     *  corresponding version method
+     */
+    if (node)
+    {
+        if (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);
+            if (element)
+            {
+                axis2_char_t *op_name =
+                    axiom_element_get_localname(element, env);
+                if (op_name)
+                {
+                    if (axutil_strcmp(op_name, "GetVersion") == 0)
+                        return axis2_version_get_version(env, node);
+                }
+            }
+        }
+    }
+
+    printf("Math service ERROR: invalid OM parameters in request\n");
+
+    /** Note: return a SOAP fault here */
+    return node;
+}
+
+/**
+ * Following block distinguish the exposed part of the dll.
+ */
+
+AXIS2_EXPORT int
+axis2_get_instance(
+    struct axis2_svc_skeleton **inst,
+    const axutil_env_t * env)
+{
+    *inst = version_create(env);
+    if (!(*inst))
+    {
+        return AXIS2_FAILURE;
+    }
+
+    return AXIS2_SUCCESS;
+}
+
+AXIS2_EXPORT int
+axis2_remove_instance(
+    axis2_svc_skeleton_t * inst,
+    const axutil_env_t * env)
+{
+    axis2_status_t status = AXIS2_FAILURE;
+    if (inst)
+    {
+        status = AXIS2_SVC_SKELETON_FREE(inst, env);
+    }
+    return status;
+}

Modified: webservices/axis2/trunk/c/util/src/error.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/src/error.c?rev=712997&r1=712996&r2=712997&view=diff
==============================================================================
--- webservices/axis2/trunk/c/util/src/error.c (original)
+++ webservices/axis2/trunk/c/util/src/error.c Tue Nov 11 00:46:26 2008
@@ -583,12 +583,17 @@
         else
         {
             if (error->message)
+            {
                 message = error->message;
+            }
             else if (error->error_number == AXIS2_ERROR_NONE)
+            {
                 message = axutil_error_messages[AXIS2_ERROR_NONE];
+            }
             else
-                message =
-                    "Undefined error returned by business logic implementation";
+            {
+                message = "Undefined error returned by business logic implementation";
+            }
         }
     }