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 2005/12/14 05:47:24 UTC
svn commit: r356732 - in /webservices/axis2/trunk/c: include/
modules/core/description/src/ modules/core/engine/src/
modules/core/phaseresolver/src/ modules/wsdl/src/ test/unit/core/description/
Author: damitha
Date: Tue Dec 13 20:46:54 2005
New Revision: 356732
URL: http://svn.apache.org/viewcvs?rev=356732&view=rev
Log:
Added ctx related code into svc_grp
Modified:
webservices/axis2/trunk/c/include/axis2_op.h
webservices/axis2/trunk/c/include/axis2_svc_grp.h
webservices/axis2/trunk/c/include/axis2_svc_grp_ctx.h
webservices/axis2/trunk/c/modules/core/description/src/module_desc.c
webservices/axis2/trunk/c/modules/core/description/src/op.c
webservices/axis2/trunk/c/modules/core/description/src/svc.c
webservices/axis2/trunk/c/modules/core/description/src/svc_grp.c
webservices/axis2/trunk/c/modules/core/engine/src/conf.c
webservices/axis2/trunk/c/modules/core/phaseresolver/src/phase_resolver.c
webservices/axis2/trunk/c/modules/wsdl/src/wsdl_component.c
webservices/axis2/trunk/c/modules/wsdl/src/wsdl_op.c
webservices/axis2/trunk/c/modules/wsdl/src/wsdl_svc.c
webservices/axis2/trunk/c/test/unit/core/description/description_test.c
webservices/axis2/trunk/c/test/unit/core/description/description_test.h
webservices/axis2/trunk/c/test/unit/core/description/test_svc.c
webservices/axis2/trunk/c/test/unit/core/description/test_svc.h
Modified: webservices/axis2/trunk/c/include/axis2_op.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_op.h?rev=356732&r1=356731&r2=356732&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_op.h (original)
+++ webservices/axis2/trunk/c/include/axis2_op.h Tue Dec 13 20:46:54 2005
@@ -319,7 +319,7 @@
axis2_env_t **env);
axis2_status_t (AXIS2_CALL *
- set_wsdl_opeartion) (axis2_op_t *op,
+ set_wsdl_op) (axis2_op_t *op,
axis2_env_t **env,
struct axis2_wsdl_op *wsdl_op);
};
@@ -502,8 +502,8 @@
#define AXIS2_OP_GET_PROPERTIES(op, env) \
((op->ops)->get_properties (op, env, properties))
-#define AXIS2_OP_SET_WSDL_OP(op, env) \
- ((op->ops)->set_wsdl_opeartion (op, env))
+#define AXIS2_OP_SET_WSDL_OP(op, env, wsdl_op) \
+ ((op->ops)->set_wsdl_op (op, env, wsdl_op))
/************************** End of function macros ****************************/
Modified: webservices/axis2/trunk/c/include/axis2_svc_grp.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_svc_grp.h?rev=356732&r1=356731&r2=356732&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_svc_grp.h (original)
+++ webservices/axis2/trunk/c/include/axis2_svc_grp.h Tue Dec 13 20:46:54 2005
@@ -25,6 +25,7 @@
#include <axis2_core.h>
#include <axis2_param_container.h>
#include <axis2_svc.h>
+#include <axis2_svc_grp_ctx.h>
#ifdef __cplusplus
extern "C"
@@ -37,6 +38,7 @@
*/
struct axis2_svc;
+struct axis2_svc_grp_ctx;
typedef struct axis2_svc_grp_ops axis2_svc_grp_ops_t;
typedef struct axis2_svc_grp axis2_svc_grp_t;
@@ -159,6 +161,11 @@
get_modules) (axis2_svc_grp_t *svc_grp,
axis2_env_t **env);
+ struct axis2_svc_grp_ctx *(AXIS2_CALL *
+ get_svc_grp_ctx) (axis2_svc_grp_t *svc_grp,
+ axis2_env_t **env,
+ struct axis2_conf_ctx *parent);
+
};
/**
@@ -248,6 +255,10 @@
#define AXIS2_SVC_GRP_GET_MODULES(svc_grp, env) \
(svc_grp->ops->get_modules(svc_grp, env))
+
+#define AXIS2_SVC_GRP_GET_SVC_GRP_CTX(svc_grp, env) \
+ (svc_grp->ops->get_svc_grp_ctx(svc_grp, env))
+
/**************************** End of function macros **************************/
Modified: webservices/axis2/trunk/c/include/axis2_svc_grp_ctx.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_svc_grp_ctx.h?rev=356732&r1=356731&r2=356732&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_svc_grp_ctx.h (original)
+++ webservices/axis2/trunk/c/include/axis2_svc_grp_ctx.h Tue Dec 13 20:46:54 2005
@@ -26,6 +26,7 @@
#include <axis2_defines.h>
#include <axis2_env.h>
#include <axis2_svc_ctx.h>
+#include <axis2_svc_grp.h>
#ifdef __cplusplus
extern "C"
@@ -36,7 +37,8 @@
* @ingroup axis2_core_context
* @{
*/
-
+
+struct axis2_svc_grp;
typedef struct axis2_svc_grp_ctx_ops axis2_svc_grp_ctx_ops_t;
typedef struct axis2_svc_grp_ctx axis2_svc_grp_ctx_t;
@@ -74,7 +76,7 @@
*/
axis2_status_t (AXIS2_CALL *fill_svc_ctx_map)(struct axis2_svc_grp_ctx *svc_grp_ctx,
axis2_env_t **env);
- axis2_svc_grp_t* (AXIS2_CALL *get_svc_grp)(struct axis2_svc_grp_ctx *svc_grp_ctx,
+ struct axis2_svc_grp* (AXIS2_CALL *get_svc_grp)(struct axis2_svc_grp_ctx *svc_grp_ctx,
axis2_env_t **env);
axis2_hash_t* (AXIS2_CALL *get_svc_ctx_map)(struct axis2_svc_grp_ctx *svc_grp_ctx,
axis2_env_t **env);
@@ -90,7 +92,7 @@
};
AXIS2_DECLARE(axis2_svc_grp_ctx_t*) axis2_svc_grp_ctx_create(axis2_env_t **env,
- axis2_svc_grp_t *svc_grp,
+ struct axis2_svc_grp *svc_grp,
struct axis2_conf_ctx *conf_ctx);
/****************** Start of function macros **************************/
Modified: webservices/axis2/trunk/c/modules/core/description/src/module_desc.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/description/src/module_desc.c?rev=356732&r1=356731&r2=356732&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/description/src/module_desc.c (original)
+++ webservices/axis2/trunk/c/modules/core/description/src/module_desc.c Tue Dec 13 20:46:54 2005
@@ -429,11 +429,14 @@
module_desc_impl = AXIS2_INTF_TO_IMPL(module_desc);
if (NULL == (module_desc_impl->ops))
- {
+ {
module_desc_impl->ops = axis2_hash_make (env);
+ if(!module_desc_impl->ops)
+ return AXIS2_FAILURE;
}
optr_name = AXIS2_OP_GET_NAME(op, env);
+
if(NULL == optr_name)
{
return AXIS2_FAILURE;
Modified: webservices/axis2/trunk/c/modules/core/description/src/op.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/description/src/op.c?rev=356732&r1=356731&r2=356732&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/description/src/op.c (original)
+++ webservices/axis2/trunk/c/modules/core/description/src/op.c Tue Dec 13 20:46:54 2005
@@ -255,7 +255,7 @@
axis2_env_t **env);
axis2_status_t AXIS2_CALL
-axis2_op_set_wsdl_opeartion(axis2_op_t *op,
+axis2_op_set_wsdl_op(axis2_op_t *op,
axis2_env_t **env,
axis2_wsdl_op_t *wsdl_op);
@@ -417,7 +417,7 @@
op_impl->op.ops->get_features = axis2_op_get_features;
op_impl->op.ops->add_property = axis2_op_add_property;
op_impl->op.ops->get_Properties = axis2_op_get_Properties;
- op_impl->op.ops->set_wsdl_opeartion = axis2_op_set_wsdl_opeartion;
+ op_impl->op.ops->set_wsdl_op = axis2_op_set_wsdl_op;
return &(op_impl->op);
}
@@ -439,6 +439,16 @@
return NULL;
}
+ if(!op_impl->op.wsdl_op)
+ {
+ op_impl->op.wsdl_op = (axis2_wsdl_op_t *) axis2_wsdl_op_create(env);
+ if(NULL == op_impl->op.wsdl_op)
+ {
+ axis2_op_free(&(op_impl->op), env);
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
+ return NULL;
+ }
+ }
status = axis2_op_set_name(&(op_impl->op), env, qname);
if(AXIS2_FAILURE == status)
@@ -446,6 +456,7 @@
axis2_op_free(&(op_impl->op), env);
return NULL;
}
+ printf("status:%d\n", status);
return &(op_impl->op);
}
@@ -1374,7 +1385,7 @@
}
axis2_status_t AXIS2_CALL
-axis2_op_set_wsdl_opeartion(axis2_op_t *op,
+axis2_op_set_wsdl_op(axis2_op_t *op,
axis2_env_t **env,
axis2_wsdl_op_t *wsdl_op)
{
Modified: webservices/axis2/trunk/c/modules/core/description/src/svc.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/description/src/svc.c?rev=356732&r1=356731&r2=356732&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/description/src/svc.c (original)
+++ webservices/axis2/trunk/c/modules/core/description/src/svc.c Tue Dec 13 20:46:54 2005
@@ -256,11 +256,13 @@
axis2_status_t status = AXIS2_FAILURE;
AXIS2_ENV_CHECK(env, NULL);
+
svc_impl = (axis2_svc_impl_t *)
AXIS2_MALLOC ((*env)->allocator, sizeof(axis2_svc_impl_t));
if(NULL == svc_impl)
{
AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
+ return NULL;
}
svc_impl->parent = NULL;
@@ -272,8 +274,7 @@
svc_impl->wasaction_opeartionmap = NULL;
svc_impl->module_list = NULL;
- svc_impl->svc.param_container = (struct axis2_param_container *)
- axis2_param_container_create(env);
+ svc_impl->svc.param_container = axis2_param_container_create(env);
if(NULL == svc_impl->svc.param_container)
{
axis2_svc_free(&(svc_impl->svc), env);
@@ -281,8 +282,7 @@
return NULL;
}
- svc_impl->svc.flow_container = (struct axis2_flow_container *)
- axis2_flow_container_create(env);
+ svc_impl->svc.flow_container = axis2_flow_container_create(env);
if(NULL == svc_impl->svc.flow_container)
{
axis2_svc_free(&(svc_impl->svc), env);
@@ -290,8 +290,7 @@
return NULL;
}
-
- svc_impl->svc.wsdl_svc = (axis2_wsdl_svc_t *)axis2_wsdl_svc_create(env);
+ svc_impl->svc.wsdl_svc = axis2_wsdl_svc_create(env);
if(NULL == svc_impl->svc.wsdl_svc)
{
axis2_svc_free(&(svc_impl->svc), env);
@@ -324,13 +323,14 @@
return NULL;
}
-
wsdl_interface_l = axis2_wsdl_interface_create(env);
if(NULL == wsdl_interface_l)
{
+ axis2_svc_free(&(svc_impl->svc), env);
AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
return NULL;
}
+
status = axis2_svc_set_svc_interface(&(svc_impl->svc), env, wsdl_interface_l);
if(AXIS2_FAILURE == status)
{
@@ -341,6 +341,7 @@
param_container_l = axis2_param_container_create(env);
if(NULL == param_container_l)
{
+ axis2_svc_free(&(svc_impl->svc), env);
AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
return NULL;
}
@@ -356,6 +357,7 @@
array_list_l = axis2_array_list_create(env, 0);
if(NULL == array_list_l)
{
+ axis2_svc_free(&(svc_impl->svc), env);
AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
return NULL;
}
@@ -451,7 +453,7 @@
svc_impl->svc.ops->add_module_ref = axis2_svc_add_module_ref;
svc_impl->svc.ops->get_modules = axis2_svc_get_modules;
-
+
return &(svc_impl->svc);
}
@@ -875,23 +877,24 @@
axis2_status_t AXIS2_CALL
axis2_svc_add_module_ops(axis2_svc_t *svc,
axis2_env_t **env,
- struct axis2_module_desc * module_desc,
- struct axis2_conf * axis2_config)
+ struct axis2_module_desc *module_desc,
+ struct axis2_conf *axis2_config)
{
- axis2_hash_t * map = NULL;
+ axis2_hash_t *map = NULL;
axis2_hash_index_t *index = NULL;
- struct axis2_phase_resolver * pr = NULL;
- struct axis2_op * axis2_opt = NULL;
+ struct axis2_phase_resolver *pr = NULL;
+ struct axis2_op *axis2_opt = NULL;
axis2_array_list_t *params = NULL;
struct axis2_param *param = NULL;
axis2_status_t status = AXIS2_FAILURE;
-
+
AXIS2_FUNC_PARAM_CHECK(svc, env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK((*env)->error, module_desc, AXIS2_FAILURE);
AXIS2_PARAM_CHECK((*env)->error, axis2_config, AXIS2_FAILURE);
map = AXIS2_MODULE_DESC_GET_OPS(module_desc, env);
pr = axis2_phase_resolver_create_with_config_and_svc(env, axis2_config, svc);
+ printf("came1\n");
if(!pr)
{
return AXIS2_FAILURE;
@@ -900,6 +903,7 @@
for (index = axis2_hash_first (map, env); index; index =
axis2_hash_next (env, index))
{
+ printf("came2\n");
int size = 0;
int j = 0;
void *v = NULL;
@@ -908,6 +912,7 @@
params = AXIS2_OP_GET_PARAMS(axis2_opt, env);
/* Adding wsa-maping into service */
size = AXIS2_ARRAY_LIST_SIZE(params, env);
+ printf("size:%d\n", size);
if(AXIS2_TRUE != AXIS2_ERROR_GET_STATUS_CODE((*env)->error))
{
if(pr)
@@ -930,7 +935,9 @@
}
}
+ printf("came3\n");
status = AXIS2_PHASE_RESOLVER_BUILD_MODULE_OP(pr, env, axis2_opt);
+ printf("came4\n");
if(AXIS2_FAILURE == status)
{
if(pr)
@@ -941,6 +948,7 @@
status = axis2_svc_add_op(svc, env, axis2_opt);
}
+ printf("came5\n");
if(pr)
AXIS2_PHASE_RESOLVER_FREE(pr, env);
return status;
Modified: webservices/axis2/trunk/c/modules/core/description/src/svc_grp.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/description/src/svc_grp.c?rev=356732&r1=356731&r2=356732&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/description/src/svc_grp.c (original)
+++ webservices/axis2/trunk/c/modules/core/description/src/svc_grp.c Tue Dec 13 20:46:54 2005
@@ -130,6 +130,11 @@
axis2_array_list_t *AXIS2_CALL
axis2_svc_grp_get_modules(axis2_svc_grp_t *svc_grp,
axis2_env_t **env);
+
+struct axis2_svc_grp_ctx *AXIS2_CALL
+axis2_svc_grp_get_svc_grp_ctx(axis2_svc_grp_t *svc_grp,
+ axis2_env_t **env,
+ struct axis2_conf_ctx *parent);
/***************************** End of function headers ************************/
@@ -212,7 +217,8 @@
svc_grp_impl->svc_grp.ops->get_axis_desc = axis2_svc_grp_get_axis_desc;
svc_grp_impl->svc_grp.ops->set_axis_desc = axis2_svc_grp_set_axis_desc;
svc_grp_impl->svc_grp.ops->add_moduleref = axis2_svc_grp_add_moduleref;
- svc_grp_impl->svc_grp.ops->get_modules = axis2_svc_grp_get_modules;
+ svc_grp_impl->svc_grp.ops->get_modules = axis2_svc_grp_get_modules;
+ svc_grp_impl->svc_grp.ops->get_svc_grp_ctx = axis2_svc_grp_get_svc_grp_ctx;
return &(svc_grp_impl->svc_grp);
}
@@ -734,8 +740,21 @@
return AXIS2_INTF_TO_IMPL(svc_grp)->module_list;
}
-/*public ServiceGroupContext getServiceGroupContext(ConfigurationContext parent){
- ServiceGroupContext serviceGroupContext = new ServiceGroupContext(parent,this) ;
- return serviceGroupContext;
+
+struct axis2_svc_grp_ctx *AXIS2_CALL
+axis2_svc_grp_get_svc_grp_ctx(axis2_svc_grp_t *svc_grp,
+ axis2_env_t **env,
+ struct axis2_conf_ctx *parent)
+{
+ struct axis2_svc_grp_ctx *svc_grp_ctx = NULL;
+
+ AXIS2_FUNC_PARAM_CHECK(svc_grp, env, NULL);
+ AXIS2_PARAM_CHECK((*env)->error, parent, NULL);
+
+ svc_grp_ctx = axis2_svc_grp_ctx_create(env, svc_grp, parent);
+ if(!svc_grp_ctx)
+ {
+ return NULL;
+ }
+ return svc_grp_ctx;
}
-*/
Modified: webservices/axis2/trunk/c/modules/core/engine/src/conf.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/engine/src/conf.c?rev=356732&r1=356731&r2=356732&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/engine/src/conf.c (original)
+++ webservices/axis2/trunk/c/modules/core/engine/src/conf.c Tue Dec 13 20:46:54 2005
@@ -52,8 +52,7 @@
};
-#define AXIS2_INTF_TO_IMPL(conf) \
- ((axis2_conf_impl_t *)conf)
+#define AXIS2_INTF_TO_IMPL(conf) ((axis2_conf_impl_t *)conf)
/***************************** Function prototypes ****************************/
@@ -259,12 +258,15 @@
{
axis2_conf_impl_t *config_impl = NULL;
AXIS2_ENV_CHECK(env, NULL);
- config_impl
- = (axis2_conf_impl_t *) AXIS2_MALLOC ((*env)->allocator
+
+ config_impl = (axis2_conf_impl_t *) AXIS2_MALLOC ((*env)->allocator
, sizeof(axis2_conf_impl_t));
if(NULL == config_impl)
+ {
AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
+ return NULL;
+ }
config_impl->conf.param_container = NULL;
config_impl->svc_grps = NULL;
@@ -299,7 +301,7 @@
AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
return NULL;
}
-
+
config_impl->transports_out = axis2_hash_make(env);
if(NULL == config_impl->transports_out)
{
Modified: webservices/axis2/trunk/c/modules/core/phaseresolver/src/phase_resolver.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/phaseresolver/src/phase_resolver.c?rev=356732&r1=356731&r2=356732&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/phaseresolver/src/phase_resolver.c (original)
+++ webservices/axis2/trunk/c/modules/core/phaseresolver/src/phase_resolver.c Tue Dec 13 20:46:54 2005
@@ -328,7 +328,9 @@
int size = 0;
int status = AXIS2_FAILURE;
struct axis2_flow *flow = NULL;
-
+
+ resolver_impl = AXIS2_INTF_TO_IMPL(phase_resolver);
+
/**************************************************************************/
/********************* Handlers from axis2.xml from modules *************/
/**************************************************************************/
@@ -339,6 +341,7 @@
size = AXIS2_ARRAY_LIST_SIZE(moduleqnames, env);
if(AXIS2_TRUE != AXIS2_ERROR_GET_STATUS_CODE((*env)->error))
{
+ printf("came30\n");
return AXIS2_FAILURE;
}
@@ -454,6 +457,7 @@
}
}
+ printf("came31\n");
/**************************************************************************/
/************************** SERVICE HANDLERS ******************************/
/**************************************************************************/
@@ -463,6 +467,7 @@
case AXIS2_INFLOW:
{
+ printf("came32\n");
flow = AXIS2_WSDL_COMPONENT_GET_COMPONENT_PROPERTY(resolver_impl->
svc->wsdl_svc->wsdl_component, env, INFLOW_KEY);
break;
@@ -486,6 +491,7 @@
break;
}
}
+ printf("came33\n");
if (NULL != flow)
{
int j = 0;
@@ -542,11 +548,14 @@
}
}
}
+ printf("came34\n");
if(resolver_impl->phase_holder)
{
AXIS2_PHASE_HOLDER_FREE(resolver_impl->phase_holder, env);
}
- switch (type) {
+ switch (type)
+ {
+ printf("came35\n");
case AXIS2_INFLOW:
{
resolver_impl->phase_holder = axis2_phase_holder_create_with_phases(env,
@@ -572,7 +581,19 @@
break;
}
}
- for (i = 0; i < AXIS2_ARRAY_LIST_SIZE(all_handlers, env); i++)
+ if(!all_handlers)
+ {
+ printf("came36\n");
+ return AXIS2_FAILURE;
+ }
+
+ size = AXIS2_ARRAY_LIST_SIZE(all_handlers, env);
+ if(AXIS2_TRUE != AXIS2_ERROR_GET_STATUS_CODE((*env)->error))
+ {
+ return AXIS2_FAILURE;
+ }
+
+ for (i = 0; i < size; i++)
{
struct axis2_handler_desc *metadata = NULL;
@@ -581,7 +602,7 @@
status = AXIS2_PHASE_HOLDER_ADD_HANDLER(resolver_impl->phase_holder, env, metadata);
}
-
+ printf("came37\n");
/* Free the locally created all_handlers list */
if(all_handlers)
AXIS2_ARRAY_LIST_FREE(all_handlers, env);
Modified: webservices/axis2/trunk/c/modules/wsdl/src/wsdl_component.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/wsdl/src/wsdl_component.c?rev=356732&r1=356731&r2=356732&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/src/wsdl_component.c (original)
+++ webservices/axis2/trunk/c/modules/wsdl/src/wsdl_component.c Tue Dec 13 20:46:54 2005
@@ -153,7 +153,7 @@
{
axis2_param_container_t *param_container = NULL;
axis2_array_list_t *module_desc_list = NULL;
-
+
axis2_hash_this (hi, &key, NULL, &val);
if(0 == AXIS2_STRCMP(PARAMETER_KEY, (axis2_char_t *)key))
@@ -167,22 +167,27 @@
{
void *val = NULL;
int i = 0;
+ int size = 0;
module_desc_list = (axis2_array_list_t *) val;
-
- for (i = 0; i < AXIS2_ARRAY_LIST_SIZE(module_desc_list, env); i++)
+ if(module_desc_list)
{
- struct axis2_module_desc *module_desc = NULL;
- module_desc = AXIS2_ARRAY_LIST_GET(module_desc_list, env, i);
-
- module_desc = (struct axis2_module_desc *) val;
- if (module_desc)
- AXIS2_MODULE_DESC_FREE (module_desc, env);
-
- val = NULL;
- module_desc = NULL;
-
+ size = AXIS2_ARRAY_LIST_SIZE(module_desc_list, env);
+ for (i = 0; i < size; i++)
+ {
+ struct axis2_module_desc *module_desc = NULL;
+ module_desc = AXIS2_ARRAY_LIST_GET(module_desc_list, env, i);
+
+ module_desc = (struct axis2_module_desc *) val;
+ if (module_desc)
+ AXIS2_MODULE_DESC_FREE (module_desc, env);
+
+ val = NULL;
+ module_desc = NULL;
+
+ }
+ AXIS2_ARRAY_LIST_FREE(module_desc_list, env);
}
- AXIS2_ARRAY_LIST_FREE(module_desc_list, env);
+
module_desc_list = NULL;
}
@@ -241,13 +246,16 @@
void *key,
void *value)
{
+ printf("key:%s\n", key);
+ axis2_wsdl_component_impl_t *component_impl = NULL;
AXIS2_FUNC_PARAM_CHECK(wsdl_component, env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK((*env)->error, key, AXIS2_FAILURE);
AXIS2_PARAM_CHECK((*env)->error, value, AXIS2_FAILURE);
-
- axis2_hash_set (AXIS2_INTF_TO_IMPL(wsdl_component)->component_properties,
- key, sizeof(key), value);
-
+ printf("came60\n");
+ component_impl = AXIS2_INTF_TO_IMPL(wsdl_component);
+ printf("came61\n");
+ axis2_hash_set (component_impl->component_properties, key, sizeof(key), value);
+ printf("came62\n");
return AXIS2_SUCCESS;
}
Modified: webservices/axis2/trunk/c/modules/wsdl/src/wsdl_op.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/wsdl/src/wsdl_op.c?rev=356732&r1=356731&r2=356732&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/src/wsdl_op.c (original)
+++ webservices/axis2/trunk/c/modules/wsdl/src/wsdl_op.c Tue Dec 13 20:46:54 2005
@@ -183,12 +183,14 @@
wsdl_op_impl->out_faults = NULL;
wsdl_op_impl->wsdl_op.extensible_component = NULL;
wsdl_op_impl->msg_exchange_pattern = NULL;
- wsdl_op_impl->style = STYLE_DOC;
+ wsdl_op_impl->style = NULL;
wsdl_op_impl->name = NULL;
wsdl_op_impl->input_msg = NULL;
wsdl_op_impl->output_msg = NULL;
wsdl_op_impl->safety = AXIS2_FALSE;
+ wsdl_op_impl->style = AXIS2_STRDUP(STYLE_DOC, env);
+
wsdl_op_impl->in_faults = axis2_linked_list_create(env);
if(NULL == wsdl_op_impl->in_faults)
{
@@ -306,6 +308,7 @@
if(NULL != wsdl_op->extensible_component)
{
AXIS2_WSDL_EXTENSIBLE_COMPONENT_FREE(wsdl_op->extensible_component, env);
+
wsdl_op->extensible_component = NULL;
}
@@ -334,7 +337,10 @@
{
void *val = NULL;
int i = 0;
- for (i = 0; i < AXIS2_LINKED_LIST_SIZE(wsdl_op_impl->out_faults, env); i++)
+ int size = 0;
+ size = AXIS2_LINKED_LIST_SIZE(wsdl_op_impl->out_faults, env);
+
+ for (i = 0; i < size; i++)
{
struct axis2_wsdl_fault_ref *fault = NULL;
fault = AXIS2_LINKED_LIST_GET(wsdl_op_impl->out_faults, env, i);
@@ -362,11 +368,13 @@
AXIS2_FREE((*env)->allocator, wsdl_op_impl->style);
wsdl_op_impl->style = NULL;
}
+
if(wsdl_op_impl)
{
AXIS2_FREE((*env)->allocator, wsdl_op_impl);
wsdl_op_impl = NULL;
}
+
return AXIS2_SUCCESS;
}
@@ -415,7 +423,7 @@
AXIS2_FREE((*env)->allocator, wsdl_op_impl->name);
wsdl_op_impl->name = NULL;
}
- wsdl_op_impl->name = AXIS2_STRDUP(name, env);
+ wsdl_op_impl->name = AXIS2_QNAME_CLONE(name, env);
if(!wsdl_op_impl->name)
{
return AXIS2_FAILURE;
Modified: webservices/axis2/trunk/c/modules/wsdl/src/wsdl_svc.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/wsdl/src/wsdl_svc.c?rev=356732&r1=356731&r2=356732&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/src/wsdl_svc.c (original)
+++ webservices/axis2/trunk/c/modules/wsdl/src/wsdl_svc.c Tue Dec 13 20:46:54 2005
@@ -20,9 +20,9 @@
* @brief Wsdl Service struct impl
* Axis2 Wsdl Service impl
*/
-typedef struct axis2_wsdl_svc_impl_s axis2_wsdl_svc_impl_t;
+typedef struct axis2_wsdl_svc_impl axis2_wsdl_svc_impl_t;
-struct axis2_wsdl_svc_impl_s
+struct axis2_wsdl_svc_impl
{
axis2_wsdl_svc_t wsdl_svc;
@@ -92,14 +92,15 @@
/***************************** End of function headers ************************/
-axis2_wsdl_svc_t * AXIS2_CALL
+axis2_wsdl_svc_t *AXIS2_CALL
axis2_wsdl_svc_create (axis2_env_t **env)
{
axis2_wsdl_svc_impl_t *wsdl_svc_impl = NULL;
+
AXIS2_ENV_CHECK(env, NULL);
wsdl_svc_impl = (axis2_wsdl_svc_impl_t *) AXIS2_MALLOC ((*env)->allocator,
- sizeof(axis2_wsdl_svc_t));
+ sizeof(axis2_wsdl_svc_impl_t));
if(NULL == wsdl_svc_impl)
{
AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
Modified: webservices/axis2/trunk/c/test/unit/core/description/description_test.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/test/unit/core/description/description_test.c?rev=356732&r1=356731&r2=356732&view=diff
==============================================================================
--- webservices/axis2/trunk/c/test/unit/core/description/description_test.c (original)
+++ webservices/axis2/trunk/c/test/unit/core/description/description_test.c Tue Dec 13 20:46:54 2005
@@ -6,7 +6,8 @@
CuSuite* axis2_descriptionGetSuite() {
CuSuite* suite = CuSuiteNew();
- SUITE_ADD_TEST(suite, Testaxis2_op_set_remaining_phases_inflow);
+ /*SUITE_ADD_TEST(suite, Testaxis2_op_set_remaining_phases_inflow);*/
+ SUITE_ADD_TEST(suite, Testaxis2_svc_add_module_ops);
return suite;
}
Modified: webservices/axis2/trunk/c/test/unit/core/description/description_test.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/test/unit/core/description/description_test.h?rev=356732&r1=356731&r2=356732&view=diff
==============================================================================
--- webservices/axis2/trunk/c/test/unit/core/description/description_test.h (original)
+++ webservices/axis2/trunk/c/test/unit/core/description/description_test.h Tue Dec 13 20:46:54 2005
@@ -3,6 +3,7 @@
#include <CuTest.h>
#include "test_op.h"
+#include "test_svc.h"
CuSuite* axis2_descriptionGetSuite();
Modified: webservices/axis2/trunk/c/test/unit/core/description/test_svc.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/test/unit/core/description/test_svc.c?rev=356732&r1=356731&r2=356732&view=diff
==============================================================================
--- webservices/axis2/trunk/c/test/unit/core/description/test_svc.c (original)
+++ webservices/axis2/trunk/c/test/unit/core/description/test_svc.c Tue Dec 13 20:46:54 2005
@@ -1,18 +1,90 @@
#include "test_svc.h"
+struct axis2_module_desc *create_module_desc(axis2_env_t **env);
+void add_handlers_to_flow(struct axis2_flow *flow, axis2_env_t **env);
+
void Testaxis2_svc_add_module_ops(CuTest *tc)
{
-
+ struct axis2_module_desc *module_desc = NULL;
+ struct axis2_conf *conf = NULL;
+ struct axis2_svc *svc = NULL;
+ axis2_status_t expected = AXIS2_SUCCESS;
+ axis2_status_t actual = AXIS2_FAILURE;
+ struct axis2_flow *inflow = NULL;
+
+ axis2_allocator_t *allocator = axis2_allocator_init (NULL);
+ axis2_env_t *env = axis2_env_create (allocator);
+ conf = axis2_conf_create(&env);
+ module_desc = create_module_desc(&env);
+
+ inflow = axis2_flow_create(&env);
+ add_handlers_to_flow(inflow, &env);
+ svc = axis2_svc_create(&env);
+ axis2_svc_set_inflow(svc, &env, inflow);
+ actual = axis2_svc_add_module_ops(svc, &env, module_desc, conf);
+
+ CuAssertIntEquals(tc, expected, actual);
+
}
struct axis2_module_desc *create_module_desc(axis2_env_t **env)
{
struct axis2_op *op = NULL;
- struct axis2_wsdl_op *wsdl_op = NULL;
axis2_qname_t *op_qname = NULL;
+ struct axis2_module_desc *module_desc = NULL;
+
+ module_desc = axis2_module_desc_create(env);
+
+ op_qname = axis2_qname_create(env, "op_name1", NULL, NULL);
+ op = axis2_op_create_with_name(env, op_qname);
+ int status = AXIS2_MODULE_DESC_ADD_OP(module_desc, env, op);
- wsdl_op = axis2_wsdl_op_create(env);
- op_qname = axis2_qname_create(env, "op_name", NULL, NULL);
+ op_qname = axis2_qname_create(env, "op_name2", NULL, NULL);
op = axis2_op_create_with_name(env, op_qname);
+ AXIS2_MODULE_DESC_ADD_OP(module_desc, env, op);
+
+ return module_desc;
+
+}
+
+void add_handlers_to_flow(struct axis2_flow *flow, axis2_env_t **env)
+{
+ struct axis2_handler_desc *handler_desc = NULL;
+ struct axis2_handler *handler = NULL;
+ axis2_qname_t *qname = NULL;
+ struct axis2_phase_rule *rule = NULL;
+
+ rule = axis2_phase_rule_create(env, AXIS2_PHASE_POLICY_DETERMINATION);
+ axis2_phase_rule_set_before(rule, env, "before");
+ axis2_phase_rule_set_after(rule, env, "after");
+ qname = axis2_qname_create(env, "handler1", NULL, NULL);
+ handler_desc = axis2_handler_desc_create_with_qname(env, qname);
+ AXIS2_HANDLER_DESC_SET_RULES(handler_desc, env, rule);
+ handler = axis2_handler_create(env);
+ AXIS2_HANDLER_INIT(handler, env, handler_desc);
+ AXIS2_HANDLER_DESC_SET_HANDLER(handler_desc, env, handler);
+ AXIS2_FLOW_ADD_HANDLER(flow, env, handler_desc);
+
+ rule = axis2_phase_rule_create(env, AXIS2_PHASE_POLICY_DETERMINATION);
+ axis2_phase_rule_set_before(rule, env, "before");
+ axis2_phase_rule_set_after(rule, env, "after");
+ qname = axis2_qname_create(env, "handler2", NULL, NULL);
+ handler_desc = axis2_handler_desc_create_with_qname(env, qname);
+ AXIS2_HANDLER_DESC_SET_RULES(handler_desc, env, rule);
+ handler = axis2_handler_create(env);
+ AXIS2_HANDLER_INIT(handler, env, handler_desc);
+ AXIS2_HANDLER_DESC_SET_HANDLER(handler_desc, env, handler);
+ AXIS2_FLOW_ADD_HANDLER(flow, env, handler_desc);
+
+ rule = axis2_phase_rule_create(env, AXIS2_PHASE_POLICY_DETERMINATION);
+ axis2_phase_rule_set_before(rule, env, "before");
+ axis2_phase_rule_set_after(rule, env, "after");
+ qname = axis2_qname_create(env, "handler3", NULL, NULL);
+ handler_desc = axis2_handler_desc_create_with_qname(env, qname);
+ AXIS2_HANDLER_DESC_SET_RULES(handler_desc, env, rule);
+ handler = axis2_handler_create(env);
+ AXIS2_HANDLER_INIT(handler, env, handler_desc);
+ AXIS2_HANDLER_DESC_SET_HANDLER(handler_desc, env, handler);
+ AXIS2_FLOW_ADD_HANDLER(flow, env, handler_desc);
}
Modified: webservices/axis2/trunk/c/test/unit/core/description/test_svc.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/test/unit/core/description/test_svc.h?rev=356732&r1=356731&r2=356732&view=diff
==============================================================================
--- webservices/axis2/trunk/c/test/unit/core/description/test_svc.h (original)
+++ webservices/axis2/trunk/c/test/unit/core/description/test_svc.h Tue Dec 13 20:46:54 2005
@@ -18,7 +18,8 @@
struct axis2_op;
struct axis2_module_desc;
struct axis2_wsdl_op;
-
+struct axis2_conf;
+struct axis2_flow;
void Testaxis2_svc_add_module_ops(CuTest *tc);