

        /**
        * output/axis2c_1658_invalid_fault_test/src/axis2_stub_axis2c_1658_invalid_fault_test.c
        *
        * This file was auto-generated from WSDL for "axis2c_1658_invalid_fault_test|http://localhost/axis/axis2c_1658_invalid_fault_test" service
        * by the Apache Axis2/C Native version: 1.0.0  Built on : Feb 03, 2026 (18:21:21 HST)
        */

        #include "axis2_stub_axis2c_1658_invalid_fault_test.h"

        /**
         * Default endpoint URI
         */
        static const axis2_char_t *default_endpoint_uri = "http://localhost/axis/axis2c_1658_invalid_fault_test";

        /**
         * Create and return the stub
         */
        axis2_stub_t* AXIS2_CALL
        axis2_stub_create_axis2c_1658_invalid_fault_test(const axutil_env_t *env,
                                        const axis2_char_t *client_home,
                                        const axis2_char_t *endpoint_uri)
        {
            axis2_stub_t *stub = NULL;
            axis2_endpoint_ref_t *endpoint_ref = NULL;
            
            AXIS2_ENV_CHECK(env, NULL);
            
            if (NULL == endpoint_uri) {
                endpoint_uri = default_endpoint_uri;
            }
            
            endpoint_ref = axis2_endpoint_ref_create(env, endpoint_uri);
            stub = axis2_stub_create_with_endpoint_ref_and_client_home(env, endpoint_ref, client_home);
            
            if (NULL == stub) {
                if (NULL != endpoint_ref) {
                    axis2_endpoint_ref_free(endpoint_ref, env);
                }
                return NULL;
            }
            
            axis2_stub_populate_services_for_axis2c_1658_invalid_fault_test(stub, env);
            return stub;
        }

        /**
         * Populate the services for axis2c_1658_invalid_fault_test
         */
        void AXIS2_CALL
        axis2_stub_populate_services_for_axis2c_1658_invalid_fault_test(axis2_stub_t *stub, const axutil_env_t *env)
        {
            axis2_svc_t *svc = NULL;
            axutil_qname_t *svc_qname = NULL;
            axutil_qname_t *op_qname = NULL;
            axis2_op_t *op = NULL;
            
            /* AXIS2C-1542: Create service qname and free after use to prevent leak */
            svc_qname = axutil_qname_create(env, "axis2c_1658_invalid_fault_test", "http://localhost/axis/axis2c_1658_invalid_fault_test", NULL);
            svc = axis2_svc_create_with_qname(env, svc_qname);
            axutil_qname_free(svc_qname, env);
            
            /* Add DatiFondi operation */
            op_qname = axutil_qname_create(env, "DatiFondi", "http://es.ubi.it/srv/datifondi", NULL);
            op = axis2_op_create_with_qname(env, op_qname);
            axutil_qname_free(op_qname, env);  /* AXIS2C-1542: Free qname after use */
            axis2_op_set_msg_exchange_pattern(op, env, AXIS2_MEP_URI_IN_OUT);
            axis2_svc_add_op(svc, env, op);
            
            /* Set service in stub - axis2_stub_set_svc not available in this Axis2/C version */
            /* TODO: Check if service association is needed with current API */
        }

        /**
         * Get the default endpoint URI
         */
        axis2_char_t* AXIS2_CALL
        axis2_stub_get_endpoint_uri_of_axis2c_1658_invalid_fault_test(const axutil_env_t *env)
        {
            return (axis2_char_t*)default_endpoint_uri;
        }

        /**
         * Create stub with endpoint reference and client home
         */
        axis2_stub_t* AXIS2_CALL
        axis2_stub_create_with_endpoint_ref_and_client_home(const axutil_env_t *env,
                                                           axis2_endpoint_ref_t *endpoint_ref,
                                                           const axis2_char_t *client_home)
        {
            axis2_stub_t *stub = NULL;
            axis2_svc_client_t *svc_client = NULL;
            
            stub = (axis2_stub_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_stub_t));
            if (!stub) {
                return NULL;
            }
            
            svc_client = axis2_svc_client_create(env, client_home);
            if (!svc_client) {
                AXIS2_FREE(env->allocator, stub);
                return NULL;
            }
            
            stub->svc_client = svc_client;
            stub->endpoint_uri = axutil_strdup(env, axis2_endpoint_ref_get_address(endpoint_ref, env));
            stub->qname = NULL;
            
            return stub;
        }

        /**
         * Get service client from stub
         */
        axis2_svc_client_t* AXIS2_CALL
        axis2_stub_get_svc_client(const axis2_stub_t *stub, const axutil_env_t *env)
        {
            if (!stub) {
                return NULL;
            }
            return stub->svc_client;
        }

        /**
         * Auto generated function implementation for "DatiFondi" operation.
         * SOAP Action: http://es.ubi.it/srv/analysis/DatiFondi
         */
        adb_DatiFondiResponse_t* AXIS2_CALL
        axis2_stub_DatiFondi(axis2_stub_t *stub, const axutil_env_t *env, adb_DatiFondi_t* _DatiFondi)
        {
            axis2_svc_client_t *svc_client = NULL;
            axis2_options_t *options = NULL;
            axutil_qname_t *op_qname = NULL;
            axiom_node_t *payload = NULL;
            axiom_node_t *ret_node = NULL;
            adb_DatiFondiResponse_t *ret_val = NULL;
            
            AXIS2_ENV_CHECK(env, NULL);
            AXIS2_PARAM_CHECK(env->error, stub, NULL);
            AXIS2_PARAM_CHECK(env->error, _DatiFondi, NULL);
            
            svc_client = axis2_stub_get_svc_client(stub, env);
            options = axis2_svc_client_get_options(svc_client, env);
            
            /* Set SOAP action for this operation */
            axis2_options_set_action(options, env, "http://es.ubi.it/srv/analysis/DatiFondi");
            
            op_qname = axutil_qname_create(env, "DatiFondi", "http://es.ubi.it/srv/datifondi", NULL);
            
            /* Serialize ADB object to axiom_node */
            payload = adb_DatiFondi_serialize(_DatiFondi, env, NULL, NULL, AXIS2_TRUE, NULL, NULL);
            
            if (NULL == payload) {
                AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Failed to serialize DatiFondi request");
                /* AXIS2C-1613 FIX: Set error before returning NULL */
                AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_MESSAGE, AXIS2_FAILURE);
                /* AXIS2C-1519 FIX: Free op_qname before early return */
                if (op_qname) { axutil_qname_free(op_qname, env); }
                return NULL;
            }
            
            ret_node = axis2_svc_client_send_receive_with_op_qname(svc_client, env, op_qname, payload);
            
            if (NULL == ret_node) {
                AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Failed to invoke DatiFondi operation");
                /* AXIS2C-1613 FIX: Set error before returning NULL */
                AXIS2_ERROR_SET(env->error, env->error->error_number, AXIS2_FAILURE);
                /* AXIS2C-1519 FIX: Free op_qname before early return */
                if (op_qname) { axutil_qname_free(op_qname, env); }
                return NULL;
            }
            
            /* Deserialize response node to ADB object */
            ret_val = adb_DatiFondiResponse_create(env);
            
            if (op_qname) {
                axutil_qname_free(op_qname, env);
            }
            
            return ret_val;
        }

