Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 26421 invoked from network); 4 Jun 2006 02:40:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 4 Jun 2006 02:40:14 -0000 Received: (qmail 86616 invoked by uid 500); 4 Jun 2006 02:40:13 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 86371 invoked by uid 500); 4 Jun 2006 02:40:12 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 86359 invoked by uid 500); 4 Jun 2006 02:40:12 -0000 Delivered-To: apmail-ws-axis2-cvs@ws.apache.org Received: (qmail 86356 invoked by uid 99); 4 Jun 2006 02:40:12 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 Jun 2006 19:40:12 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 Jun 2006 19:40:10 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 799151A9842; Sat, 3 Jun 2006 19:39:50 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r411500 - in /webservices/axis2/trunk/c: include/axis2_msg.h modules/core/description/Makefile.am modules/core/description/msg.c modules/core/description/op.c Date: Sun, 04 Jun 2006 02:39:49 -0000 To: axis2-cvs@ws.apache.org From: samisa@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20060604023950.799151A9842@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: samisa Date: Sat Jun 3 19:39:49 2006 New Revision: 411500 URL: http://svn.apache.org/viewvc?rev=411500&view=rev Log: Adding message description initial implementation Added: webservices/axis2/trunk/c/include/axis2_msg.h webservices/axis2/trunk/c/modules/core/description/msg.c Modified: webservices/axis2/trunk/c/modules/core/description/Makefile.am webservices/axis2/trunk/c/modules/core/description/op.c Added: webservices/axis2/trunk/c/include/axis2_msg.h URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/include/axis2_msg.h?rev=411500&view=auto ============================================================================== --- webservices/axis2/trunk/c/include/axis2_msg.h (added) +++ webservices/axis2/trunk/c/include/axis2_msg.h Sat Jun 3 19:39:49 2006 @@ -0,0 +1,218 @@ +/* + * Copyright 2004,2005 The Apache Software Foundation. + * + * Licensed 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_MSG_H +#define AXIS2_MSG_H + +/** + * @file axis2_msg.h + * @brief axis2 msg interface + */ + +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +/** @defgroup axis2_op Message Description + * @ingroup axis2_core_description + * @{ + */ + +struct axis2_wsdl_op; +struct axis2_svc; +struct axis2_msg_recv; +struct axis2_param_container; +struct axis2_module_desc; +struct axis2_op; +struct axis2_wsdl_feature; +struct axis2_wsdl_property; +struct axis2_wsdl_fault_ref; +struct axis2_relates_to; +struct axis2_msg_ctx; +struct axis2_svc_ctx; +struct axis2_msg_ctx; +struct axis2_conf_ctx; +typedef struct axis2_msg_ops axis2_msg_ops_t; +typedef struct axis2_msg axis2_msg_t; + +/** + * @brief message ops struct + * Encapsulator struct for ops of axis2_msg + */ +AXIS2_DECLARE_DATA struct axis2_msg_ops +{ + axis2_status_t (AXIS2_CALL * + free)( + axis2_msg_t *msg, + const axis2_env_t *env); + + axis2_status_t (AXIS2_CALL * + add_param)( + axis2_msg_t *msg, + const axis2_env_t *env, + axis2_param_t *param); + + axis2_param_t *(AXIS2_CALL * + get_param)( + axis2_msg_t *msg, + const axis2_env_t *env, + axis2_char_t *name); + + axis2_array_list_t *(AXIS2_CALL * + get_params)( + axis2_msg_t *msg, + const axis2_env_t *env); + + axis2_bool_t (AXIS2_CALL * + is_param_locked)( + axis2_msg_t *msg, + const axis2_env_t *env, + axis2_char_t *param_name); + + axis2_status_t (AXIS2_CALL * + set_parent)( + axis2_msg_t *msg, + const axis2_env_t *env, + axis2_op_t *op); + + axis2_op_t *(AXIS2_CALL * + get_parent)( + axis2_msg_t *msg, + const axis2_env_t *env); + + axis2_array_list_t *(AXIS2_CALL * + get_flow)( + axis2_msg_t *msg, + const axis2_env_t *env); + + axis2_status_t (AXIS2_CALL * + set_flow)( + axis2_msg_t *msg, + const axis2_env_t *env, + axis2_array_list_t *flow); + + axis2_char_t *(AXIS2_CALL * + get_direction)( + axis2_msg_t *msg, + const axis2_env_t *env); + + axis2_status_t (AXIS2_CALL * + set_direction)( + axis2_msg_t *msg, + const axis2_env_t *env, + axis2_char_t *direction); + + axis2_qname_t *(AXIS2_CALL * + get_element_qname)( + axis2_msg_t *msg, + const axis2_env_t *env); + + axis2_status_t (AXIS2_CALL * + set_element_qname)( + axis2_msg_t *msg, + const axis2_env_t *env, + axis2_qname_t *element_qname); + + axis2_char_t *(AXIS2_CALL * + get_name)( + axis2_msg_t *msg, + const axis2_env_t *env); + + axis2_status_t (AXIS2_CALL * + set_name)( + axis2_msg_t *msg, + const axis2_env_t *env, + const axis2_char_t *name); +}; + +/** + * @brief message struct + * Axis2 message + */ +AXIS2_DECLARE_DATA struct axis2_msg +{ + axis2_msg_ops_t *ops; + struct axis2_param_container *param_container; +}; + +/** + * Creates msg struct + * @return pointer to newly created msg + */ +AXIS2_EXTERN axis2_msg_t * AXIS2_CALL +axis2_msg_create (const axis2_env_t *env); + +/************************** Start of function macros **************************/ + +#define AXIS2_MSG_FREE(msg, env) \ + ((msg)->ops->free (msg, env)) + +#define AXIS2_MSG_ADD_PARAM(msg, env, param) \ + ((msg)->ops->add_param (msg, env, param)) + +#define AXIS2_MSG_GET_PARAM(msg, env, key) \ + ((msg)->ops->get_param (msg, env, key)) + +#define AXIS2_MSG_GET_PARAMS(msg, env) \ + ((msg)->ops->get_params (msg, env)) + +#define AXIS2_MSG_IS_PARAM_LOCKED(msg, env, param_name) \ + ((msg)->ops->is_param_locked(msg, env, param_name)) + +#define AXIS2_MSG_SET_PARENT(msg, env, service_desc) \ + ((msg)->ops->set_parent (msg, env, service_desc)) + +#define AXIS2_MSG_GET_PARENT(msg, env) \ + ((msg)->ops->get_parent (msg, env)) + +#define AXIS2_MSG_GET_FLOW(msg, env) \ + ((msg)->ops->get_flow (msg, env)) + +#define AXIS2_MSG_SET_FLOW(msg, env, flow) \ + ((msg)->ops->set_flow (msg, env, flow)) + +#define AXIS2_MSG_GET_DIRECTION(msg, env) \ + ((msg)->ops->get_direction (msg, env)) + +#define AXIS2_MSG_SET_DIRECTION(msg, env, direction) \ + ((msg)->ops->set_direction (msg, env, direction)) + +#define AXIS2_MSG_GET_ELEMENT_QNAME(msg, env) \ + ((msg)->ops->get_element_qname(msg, env)) + +#define AXIS2_MSG_SET_ELEMENT_QNAME(msg, env, element_qname) \ + ((msg)->ops->set_element_qname(msg, env, element_qname)) + +#define AXIS2_MSG_GET_NAME(msg, env) \ + ((msg)->ops->get_name(msg, env)) + +#define AXIS2_MSG_SET_NAME(msg, env, name) \ + ((msg)->ops->set_name(msg, env, name)) + +/************************** End of function macros ****************************/ + +/** @} */ +#ifdef __cplusplus +} +#endif +#endif /* AXIS2_MSG_H */ Modified: webservices/axis2/trunk/c/modules/core/description/Makefile.am URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/description/Makefile.am?rev=411500&r1=411499&r2=411500&view=diff ============================================================================== --- webservices/axis2/trunk/c/modules/core/description/Makefile.am (original) +++ webservices/axis2/trunk/c/modules/core/description/Makefile.am Sat Jun 3 19:39:49 2006 @@ -12,7 +12,8 @@ flow.c \ flow_container.c \ transport_in_desc.c \ - transport_out_desc.c + transport_out_desc.c \ + msg.c INCLUDES = -I$(top_builddir)/include \ -I$(top_builddir)/modules/wsdl \ Added: webservices/axis2/trunk/c/modules/core/description/msg.c URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/description/msg.c?rev=411500&view=auto ============================================================================== --- webservices/axis2/trunk/c/modules/core/description/msg.c (added) +++ webservices/axis2/trunk/c/modules/core/description/msg.c Sat Jun 3 19:39:49 2006 @@ -0,0 +1,550 @@ +/* + * Copyright 2004,2005 The Apache Software Foundation. + * + * Licensed 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 +#include + +/** + * @brief Message struct impl + * Axis2 Messages + */ +typedef struct axis2_msg_impl +{ + axis2_msg_t msg; + /** parent operation */ + axis2_op_t *parent; + /** list of phases that represnt the flow */ + axis2_array_list_t *flow; + /** name of the message */ + axis2_char_t *name; + /** list of SOAP headers */ + axis2_array_list_t *soap_headers; + /** XML schema element qname */ + axis2_qname_t *element_qname; + /** direction of message */ + axis2_char_t *direction; +} axis2_msg_impl_t; + +#define AXIS2_INTF_TO_IMPL(msg) ((axis2_msg_impl_t *)msg) + +/*************************** Function headers *********************************/ + +axis2_status_t AXIS2_CALL +axis2_msg_free (axis2_msg_t *msg, + const axis2_env_t *env); + +axis2_status_t AXIS2_CALL +axis2_msg_add_param (axis2_msg_t *msg, + const axis2_env_t *env, + axis2_param_t *param); + +axis2_param_t * AXIS2_CALL +axis2_msg_get_param (axis2_msg_t *msg, + const axis2_env_t *env, + axis2_char_t *name); + +axis2_array_list_t * AXIS2_CALL +axis2_msg_get_params (axis2_msg_t *msg, + const axis2_env_t *env); + +axis2_bool_t AXIS2_CALL +axis2_msg_is_param_locked(axis2_msg_t *msg, + const axis2_env_t *env, + axis2_char_t *param_name); + +axis2_status_t AXIS2_CALL +axis2_msg_set_parent (axis2_msg_t *msg, + const axis2_env_t *env, + axis2_op_t *op); + +axis2_op_t * AXIS2_CALL +axis2_msg_get_parent (axis2_msg_t *msg, + const axis2_env_t *env); + +axis2_array_list_t *AXIS2_CALL +axis2_msg_get_flow(axis2_msg_t *msg, + const axis2_env_t *env); + +axis2_status_t AXIS2_CALL +axis2_msg_set_flow(axis2_msg_t *msg, + const axis2_env_t *env, + axis2_array_list_t *flow); + +axis2_char_t *AXIS2_CALL +axis2_msg_get_direction(axis2_msg_t *msg, + const axis2_env_t *env); + +axis2_status_t AXIS2_CALL +axis2_msg_set_direction(axis2_msg_t *msg, + const axis2_env_t *env, + axis2_char_t *direction); + +axis2_qname_t *AXIS2_CALL +axis2_msg_get_element_qname(axis2_msg_t *msg, + const axis2_env_t *env); + +axis2_status_t AXIS2_CALL +axis2_msg_set_element_qname(axis2_msg_t *msg, + const axis2_env_t *env, + axis2_qname_t *element_qname); + +axis2_char_t *AXIS2_CALL +axis2_msg_get_name(axis2_msg_t *msg, + const axis2_env_t *env); + +axis2_status_t AXIS2_CALL +axis2_msg_set_name(axis2_msg_t *msg, + const axis2_env_t *env, + const axis2_char_t *name); + + +/************************* End of function headers ****************************/ + +AXIS2_EXTERN axis2_msg_t * AXIS2_CALL +axis2_msg_create (const axis2_env_t *env) +{ + axis2_msg_impl_t *msg_impl = NULL; + + AXIS2_ENV_CHECK(env, NULL); + + msg_impl = (axis2_msg_impl_t *) AXIS2_MALLOC (env->allocator, + sizeof (axis2_msg_impl_t)); + + if(NULL == msg_impl) + { + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + + msg_impl->msg.param_container = NULL; + msg_impl->parent = NULL; + msg_impl->flow = NULL; + msg_impl->name = NULL; + msg_impl->soap_headers = NULL; + msg_impl->element_qname = NULL; + msg_impl->direction = NULL; + msg_impl->msg.ops = NULL; + + msg_impl->msg.param_container = (axis2_param_container_t *) + axis2_param_container_create(env); + if(NULL == msg_impl->msg.param_container) + { + axis2_msg_free(&(msg_impl->msg), env); + return NULL; + } + + msg_impl->soap_headers = axis2_array_list_create(env, 0); + if(NULL == msg_impl->soap_headers) + { + axis2_msg_free(&(msg_impl->msg), env); + return NULL; + } + + msg_impl->flow = axis2_array_list_create(env, 0); + if(NULL == msg_impl->flow) + { + axis2_msg_free(&(msg_impl->msg), env); + return NULL; + } + + msg_impl->msg.ops = AXIS2_MALLOC(env->allocator, sizeof(axis2_msg_ops_t)); + if(NULL == msg_impl->msg.ops) + { + axis2_msg_free(&(msg_impl->msg), env); + AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); + return NULL; + } + + msg_impl->msg.ops->free = axis2_msg_free; + msg_impl->msg.ops->add_param = axis2_msg_add_param; + msg_impl->msg.ops->get_param = axis2_msg_get_param; + msg_impl->msg.ops->get_params = axis2_msg_get_params; + msg_impl->msg.ops->is_param_locked = axis2_msg_is_param_locked; + msg_impl->msg.ops->set_parent = axis2_msg_set_parent; + msg_impl->msg.ops->get_parent = axis2_msg_get_parent; + msg_impl->msg.ops->get_flow = axis2_msg_get_flow; + msg_impl->msg.ops->set_flow = axis2_msg_set_flow; + msg_impl->msg.ops->get_direction = axis2_msg_get_direction; + msg_impl->msg.ops->set_direction = axis2_msg_set_direction; + msg_impl->msg.ops->get_element_qname = axis2_msg_get_element_qname; + msg_impl->msg.ops->set_element_qname = axis2_msg_set_element_qname; + msg_impl->msg.ops->get_name = axis2_msg_get_name; + msg_impl->msg.ops->set_name = axis2_msg_set_name; + + return &(msg_impl->msg); +} + +/*************************** Start of msg impls *************************/ + +axis2_status_t AXIS2_CALL +axis2_msg_free (axis2_msg_t *msg, const axis2_env_t *env) +{ + axis2_msg_impl_t *msg_impl = NULL; + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + msg_impl = AXIS2_INTF_TO_IMPL(msg); + + if(NULL != msg_impl->flow) + { + int i = 0; + int size = 0; + size = AXIS2_ARRAY_LIST_SIZE(msg_impl->flow, env); + for (i = 0; i < size; i++) + { + axis2_phase_t *phase = NULL; + phase = AXIS2_ARRAY_LIST_GET(msg_impl->flow, env, i); + if (phase) + { + AXIS2_PHASE_FREE (phase, env); + phase = NULL; + } + + } + AXIS2_ARRAY_LIST_FREE(msg_impl->flow, env); + msg_impl->flow = NULL; + } + + if(NULL != msg_impl->soap_headers) + { + int i = 0; + int size = 0; + size = AXIS2_ARRAY_LIST_SIZE(msg_impl->soap_headers, env); + for (i = 0; i < size; i++) + { + /* TODO : free the content */ + } + AXIS2_ARRAY_LIST_FREE(msg_impl->soap_headers, env); + msg_impl->soap_headers = NULL; + } + + if (msg_impl->name) + { + AXIS2_FREE(env->allocator, msg_impl->name); + msg_impl->name = NULL; + } + + if (msg_impl->element_qname) + { + AXIS2_QNAME_FREE(msg_impl->element_qname, env); + msg_impl->element_qname = NULL; + } + + if (msg_impl->direction) + { + AXIS2_FREE(env->allocator, msg_impl->direction); + msg_impl->direction = NULL; + } + + if(msg->param_container) + { + AXIS2_PARAM_CONTAINER_FREE(msg->param_container, env); + msg->param_container = NULL; + } + + msg_impl->parent = NULL; + + if (msg_impl->msg.ops) + { + AXIS2_FREE(env->allocator, msg_impl->msg.ops); + msg_impl->msg.ops = NULL; + } + + if(msg_impl) + { + AXIS2_FREE(env->allocator, msg_impl); + msg_impl = NULL; + } + + return AXIS2_SUCCESS; +} + +axis2_status_t AXIS2_CALL +axis2_msg_add_param (axis2_msg_t *msg, + const axis2_env_t *env, + axis2_param_t *param) +{ + axis2_msg_impl_t *msg_impl = NULL; + axis2_char_t *param_name = NULL; + + AXIS2_ENV_CHECK(env, AXIS2_FALSE); + AXIS2_PARAM_CHECK(env->error, param, AXIS2_FALSE); + msg_impl = AXIS2_INTF_TO_IMPL(msg); + + param_name = AXIS2_PARAM_GET_NAME(param, env); + if(AXIS2_TRUE == axis2_msg_is_param_locked(msg, env, param_name)) + { + AXIS2_ERROR_SET(env->error, + AXIS2_ERROR_PARAMETER_LOCKED_CANNOT_OVERRIDE, AXIS2_FAILURE); + return AXIS2_FAILURE; + } + else + { + return AXIS2_PARAM_CONTAINER_ADD_PARAM(msg->param_container, env, param); + } + + return AXIS2_SUCCESS; +} + +axis2_param_t * AXIS2_CALL +axis2_msg_get_param (axis2_msg_t *msg, + const axis2_env_t *env, + axis2_char_t *param_name) +{ + AXIS2_ENV_CHECK(env, AXIS2_FALSE); + AXIS2_PARAM_CHECK(env->error, param_name, NULL); + + return AXIS2_PARAM_CONTAINER_GET_PARAM(msg->param_container, env, param_name); +} + +axis2_array_list_t * AXIS2_CALL +axis2_msg_get_params(axis2_msg_t *msg, + const axis2_env_t *env) +{ + axis2_msg_impl_t *msg_impl = NULL; + + AXIS2_ENV_CHECK(env, AXIS2_FALSE); + AXIS2_PARAM_CHECK(env->error, msg->param_container, AXIS2_FALSE); + msg_impl = AXIS2_INTF_TO_IMPL(msg); + + return AXIS2_PARAM_CONTAINER_GET_PARAMS(msg->param_container, env); +} + +axis2_status_t AXIS2_CALL +axis2_msg_set_parent (axis2_msg_t *msg, + const axis2_env_t *env, + axis2_op_t *op) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + AXIS2_INTF_TO_IMPL(msg)->parent = op; + return AXIS2_SUCCESS; +} + +axis2_op_t * AXIS2_CALL +axis2_msg_get_parent (axis2_msg_t *msg, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, NULL); + + return AXIS2_INTF_TO_IMPL(msg)->parent; +} + +axis2_array_list_t *AXIS2_CALL +axis2_msg_get_flow(axis2_msg_t *msg, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, NULL); + return AXIS2_INTF_TO_IMPL(msg)->flow; +} + +axis2_bool_t AXIS2_CALL +axis2_msg_is_param_locked(axis2_msg_t *msg, + const axis2_env_t *env, + axis2_char_t *param_name) +{ + axis2_op_t *parent_l = NULL; + axis2_param_t *param_l = NULL; + axis2_bool_t locked = AXIS2_FALSE; + + AXIS2_ENV_CHECK(env, AXIS2_FALSE); + AXIS2_PARAM_CHECK(env->error, param_name, AXIS2_FALSE); + + /* checking the locked value of parent*/ + parent_l = axis2_msg_get_parent(msg, env); + if(NULL != parent_l) + { + locked = AXIS2_OP_IS_PARAM_LOCKED(parent_l, env, param_name); + } + if(AXIS2_TRUE == locked) + { + return AXIS2_TRUE; + } + else + { + param_l = axis2_msg_get_param(msg, env, param_name); + } + return (param_l != NULL && AXIS2_PARAM_IS_LOCKED(param_l, env)); +} + +axis2_status_t AXIS2_CALL +axis2_msg_set_flow(axis2_msg_t *msg, + const axis2_env_t *env, + axis2_array_list_t *flow) +{ + axis2_msg_impl_t *msg_impl = NULL; + + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + msg_impl = AXIS2_INTF_TO_IMPL(msg); + + if (msg_impl->flow) + { + AXIS2_ARRAY_LIST_FREE(msg_impl->flow, env); + msg_impl->flow = NULL; + } + if (flow) + { + msg_impl->flow = flow; + } + return AXIS2_SUCCESS; +} + +axis2_char_t *AXIS2_CALL +axis2_msg_get_direction(axis2_msg_t *msg, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + return AXIS2_INTF_TO_IMPL(msg)->direction; +} + +axis2_status_t AXIS2_CALL +axis2_msg_set_direction(axis2_msg_t *msg, + const axis2_env_t *env, + axis2_char_t *direction) +{ + axis2_msg_impl_t *msg_impl = NULL; + + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + msg_impl = AXIS2_INTF_TO_IMPL(msg); + + if (msg_impl->direction) + { + AXIS2_FREE(env->allocator, msg_impl->direction); + msg_impl->direction = NULL; + } + + if (direction) + { + msg_impl->direction = AXIS2_STRDUP(direction, env); + if (!(msg_impl->direction)) + return AXIS2_FAILURE; + } + + return AXIS2_SUCCESS; +} + +axis2_qname_t *AXIS2_CALL +axis2_msg_get_element_qname(axis2_msg_t *msg, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + return AXIS2_INTF_TO_IMPL(msg)->element_qname; +} + +axis2_status_t AXIS2_CALL +axis2_msg_set_element_qname(axis2_msg_t *msg, + const axis2_env_t *env, + axis2_qname_t *element_qname) +{ + axis2_msg_impl_t *msg_impl = NULL; + + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + msg_impl = AXIS2_INTF_TO_IMPL(msg); + + if (msg_impl->element_qname) + { + AXIS2_QNAME_FREE(msg_impl->element_qname, env); + msg_impl->element_qname = NULL; + } + + if (element_qname) + { + msg_impl->element_qname = AXIS2_QNAME_CLONE(element_qname, env); + if (!(msg_impl->element_qname)) + return AXIS2_FAILURE; + } + + return AXIS2_SUCCESS; +} + +/* +TODO: implement when xml schema is in place +xml_schema_element *AXIS2_CALL +axis2_msg_get_schema_element(axis2_msg_t *msg, + const axis2_env_t *env) +{ + AxisService service = (AxisService) getParent().getParent(); + axis2_array_list_t *schemas = service.getSchema(); + for (int i = 0; i < schemas.size(); i++) { + XmlSchema schema = (XmlSchema) schemas.get(i); + if (schema.getItems() != null) { + Iterator schemaItems = schema.getItems().getIterator(); + while (schemaItems.hasNext()) { + Object item = schemaItems.next(); + if (item instanceof xml_schema_element) { + xml_schema_element schema_element = (xml_schema_element) item; + if (schema_element.getQName().equals(getElementQName())) { + return schema_element; + } + } + } + } + } + return null; +}*/ + +axis2_char_t *AXIS2_CALL +axis2_msg_get_name(axis2_msg_t *msg, + const axis2_env_t *env) +{ + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + return AXIS2_INTF_TO_IMPL(msg)->name; +} + +axis2_status_t AXIS2_CALL +axis2_msg_set_name(axis2_msg_t *msg, + const axis2_env_t *env, + const axis2_char_t *name) +{ + axis2_msg_impl_t *msg_impl = NULL; + + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + msg_impl = AXIS2_INTF_TO_IMPL(msg); + + if (msg_impl->name) + { + AXIS2_FREE(env->allocator, msg_impl->name); + msg_impl->name = NULL; + } + + if (name) + { + msg_impl->name = AXIS2_STRDUP(env, name); + if (!(msg_impl->name)) + { + return AXIS2_FAILURE; + } + } + + return AXIS2_SUCCESS; +} + + +/* +TODO: these methods would be useful when doing WSDL to Axis service builders +axis2_status_t AXIS2_CALL +axis2_msg_add_soap_header(axis2_msg_t *msg, + const axis2_env_t *env, + soap_header_message *soap_header_message) +{ + soap_headers.add(soap_header_message); +} + +axis2_array_list_t *AXIS2_CALL +axis2_msg_get_soap_headers(axis2_msg_t *msg, + const axis2_env_t *env) +{ + return soap_headers; +} + +*/ Modified: webservices/axis2/trunk/c/modules/core/description/op.c URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/description/op.c?rev=411500&r1=411499&r2=411500&view=diff ============================================================================== --- webservices/axis2/trunk/c/modules/core/description/op.c (original) +++ webservices/axis2/trunk/c/modules/core/description/op.c Sat Jun 3 19:39:49 2006 @@ -16,6 +16,7 @@ #include #include +#include /** * @brief Operaton struct impl @@ -882,7 +883,7 @@ { param_l = axis2_op_get_param(op, env, param_name); } - return AXIS2_PARAM_IS_LOCKED(param_l, env); + return (param_l !=NULL && AXIS2_PARAM_IS_LOCKED(param_l, env)); } axis2_status_t AXIS2_CALL --------------------------------------------------------------------- To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org For additional commands, e-mail: axis-cvs-help@ws.apache.org