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/11/21 04:19:52 UTC
svn commit: r345818 [3/3] - in /webservices/axis2/trunk/c: include/
modules/wsdl/src/
Added: webservices/axis2/trunk/c/modules/wsdl/src/wsdl_fault_ref.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/wsdl/src/wsdl_fault_ref.c?rev=345818&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/src/wsdl_fault_ref.c (added)
+++ webservices/axis2/trunk/c/modules/wsdl/src/wsdl_fault_ref.c Sun Nov 20 19:19:08 2005
@@ -0,0 +1,229 @@
+/*
+ * 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 <axis2_wsdl_fault_ref.h>
+
+/**
+ * @brief Wsdl Binding Fault Reference struct impl
+ * Referes to the MEP the Message relates to.
+ */
+typedef struct axis2_wsdl_fault_ref_impl
+{
+ axis2_wsdl_fault_ref_t fault_ref;
+
+ /**
+ * Field messageLabel
+ */
+ axis2_char_t *msg_label;
+
+ /**
+ * Field Direction
+ * Can be "in" or "out" depending on the element name being "input" or
+ * "output" respectively;
+ */
+ axis2_char_t *direction;
+
+ /**
+ * Field ref
+ */
+ axis2_qname_t *ref;
+
+} axis2_wsdl_fault_ref_impl_t;
+
+#define AXIS2_INTF_TO_IMPL(fault_ref) \
+ ((axis2_wsdl_fault_ref_impl_t *)fault_ref)
+
+/************************* Function prototypes ********************************/
+
+axis2_status_t AXIS2_CALL
+ axis2_wsdl_fault_ref_free (axis2_wsdl_fault_ref_t *fault_ref,
+ axis2_env_t **env);
+
+axis2_char_t * AXIS2_CALL
+axis2_wsdl_fault_ref_get_direction(axis2_wsdl_fault_ref_t *fault_ref,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_wsdl_fault_ref_set_direction(axis2_wsdl_fault_ref_t *fault_ref,
+ axis2_env_t **env,
+ axis2_char_t *direction);
+
+axis2_char_t * AXIS2_CALL
+axis2_wsdl_fault_ref_get_msg_label(axis2_wsdl_fault_ref_t *fault_ref,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_wsdl_fault_ref_set_msg_label(axis2_wsdl_fault_ref_t *fault_ref,
+ axis2_env_t **env,
+ axis2_char_t *msg_label);
+
+axis2_qname_t * AXIS2_CALL
+axis2_wsdl_fault_ref_get_ref(axis2_wsdl_fault_ref_t *fault_ref,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_wdsl_fault_ref_set_ref(axis2_wsdl_fault_ref_t *fault_ref,
+ axis2_env_t **env,
+ axis2_qname_t *ref);
+
+/************************** End of function prototypes ************************/
+
+axis2_wsdl_fault_ref_t * AXIS2_CALL
+axis2_wsdl_fault_ref_create (axis2_env_t **env)
+{
+ AXIS2_ENV_CHECK(env, NULL);
+
+ axis2_wsdl_fault_ref_impl_t *fault_ref_impl =
+ (axis2_wsdl_fault_ref_impl_t *) AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_wsdl_fault_ref_impl_t));
+
+
+ if(NULL == fault_ref_impl)
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
+
+ fault_ref_impl->fault_ref.wsdl_component =
+ axis2_wsdl_component_create(env);
+
+ if(NULL == fault_ref_impl->fault_ref.wsdl_component)
+ {
+ AXIS2_FREE((*env)->allocator, fault_ref_impl);
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
+ }
+
+ fault_ref_impl->fault_ref.ops =
+ AXIS2_MALLOC ((*env)->allocator, sizeof(axis2_wsdl_fault_ref_ops_t));
+ if(NULL == fault_ref_impl->fault_ref.ops)
+ {
+ AXIS2_WSDL_COMPONENT_FREE(fault_ref_impl->fault_ref.wsdl_component, env);
+ AXIS2_FREE((*env)->allocator, fault_ref_impl);
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
+ }
+
+ fault_ref_impl->fault_ref.ops->free = axis2_wsdl_fault_ref_free;
+
+ fault_ref_impl->fault_ref.ops->get_direction =
+ axis2_wsdl_fault_ref_get_direction;
+
+ fault_ref_impl->fault_ref.ops->set_direction =
+ axis2_wsdl_fault_ref_set_direction;
+
+ fault_ref_impl->fault_ref.ops->get_msg_label =
+ axis2_wsdl_fault_ref_get_msg_label;
+
+ fault_ref_impl->fault_ref.ops->set_msg_label =
+ axis2_wsdl_fault_ref_set_msg_label;
+
+ fault_ref_impl->fault_ref.ops->get_ref = axis2_wsdl_fault_ref_get_ref;
+
+ fault_ref_impl->fault_ref.ops->set_ref = axis2_wdsl_fault_ref_set_ref;
+
+
+ fault_ref_impl->msg_label = NULL;
+ fault_ref_impl->direction = NULL;
+ fault_ref_impl->ref = NULL;
+
+ return &(fault_ref_impl->fault_ref);
+}
+
+/***************************Function implementation****************************/
+
+axis2_status_t AXIS2_CALL
+axis2_wsdl_fault_ref_free (axis2_wsdl_fault_ref_t *fault_ref,
+ axis2_env_t **env)
+{
+ AXIS2_FUNC_PARAM_CHECK(fault_ref, env, AXIS2_FAILURE);
+ if(NULL != fault_ref->ops)
+ AXIS2_FREE((*env)->allocator, fault_ref->ops);
+
+ if(NULL != AXIS2_INTF_TO_IMPL(fault_ref)->msg_label)
+ {
+ AXIS2_FREE((*env)->allocator, AXIS2_INTF_TO_IMPL(fault_ref)->msg_label);
+ }
+
+ if(NULL != AXIS2_INTF_TO_IMPL(fault_ref)->msg_label)
+ {
+ AXIS2_FREE((*env)->allocator, AXIS2_INTF_TO_IMPL(fault_ref)->msg_label);
+ }
+
+ if(NULL != AXIS2_INTF_TO_IMPL(fault_ref)->ref)
+ {
+ AXIS2_QNAME_FREE(AXIS2_INTF_TO_IMPL(fault_ref)->ref, env);
+ }
+
+ if(NULL != fault_ref->wsdl_component)
+ AXIS2_WSDL_COMPONENT_FREE(fault_ref->wsdl_component, env);
+
+ AXIS2_FREE((*env)->allocator, AXIS2_INTF_TO_IMPL(fault_ref));
+
+ return AXIS2_SUCCESS;
+}
+
+axis2_char_t * AXIS2_CALL
+axis2_wsdl_fault_ref_get_direction(axis2_wsdl_fault_ref_t *fault_ref,
+ axis2_env_t **env)
+{
+ AXIS2_FUNC_PARAM_CHECK(fault_ref, env, NULL);
+ return AXIS2_INTF_TO_IMPL(fault_ref)->direction;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_wsdl_fault_ref_set_direction(axis2_wsdl_fault_ref_t *fault_ref,
+ axis2_env_t **env,
+ axis2_char_t *direction)
+{
+ AXIS2_FUNC_PARAM_CHECK(fault_ref, env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, direction, AXIS2_FAILURE);
+ AXIS2_INTF_TO_IMPL(fault_ref)->direction = direction;
+ return AXIS2_SUCCESS;
+}
+
+axis2_char_t * AXIS2_CALL
+axis2_wsdl_fault_ref_get_msg_label(axis2_wsdl_fault_ref_t *fault_ref,
+ axis2_env_t **env)
+{
+ AXIS2_FUNC_PARAM_CHECK(fault_ref, env, NULL);
+ return AXIS2_INTF_TO_IMPL(fault_ref)->msg_label;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_wsdl_fault_ref_set_msg_label(axis2_wsdl_fault_ref_t *fault_ref,
+ axis2_env_t **env,
+ axis2_char_t *msg_label)
+{
+ AXIS2_FUNC_PARAM_CHECK(fault_ref, env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, msg_label, AXIS2_FAILURE);
+ AXIS2_INTF_TO_IMPL(fault_ref)->msg_label = msg_label;
+ return AXIS2_SUCCESS;
+}
+
+axis2_qname_t * AXIS2_CALL
+axis2_wsdl_fault_ref_get_ref(axis2_wsdl_fault_ref_t *fault_ref,
+ axis2_env_t **env)
+{
+ AXIS2_FUNC_PARAM_CHECK(fault_ref, env, NULL);
+ return AXIS2_INTF_TO_IMPL(fault_ref)->ref;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_wdsl_fault_ref_set_ref(axis2_wsdl_fault_ref_t *fault_ref,
+ axis2_env_t **env,
+ axis2_qname_t *ref)
+{
+ AXIS2_FUNC_PARAM_CHECK(fault_ref, env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, ref, AXIS2_FAILURE);
+ AXIS2_INTF_TO_IMPL(fault_ref)->ref = ref;
+ return AXIS2_SUCCESS;
+}
Modified: webservices/axis2/trunk/c/modules/wsdl/src/wsdl_feature.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/wsdl/src/wsdl_feature.c?rev=345818&r1=345817&r2=345818&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/src/wsdl_feature.c (original)
+++ webservices/axis2/trunk/c/modules/wsdl/src/wsdl_feature.c Sun Nov 20 19:19:08 2005
@@ -20,9 +20,10 @@
* @brief Wsdl feature struct impl
* Wsdl features
*/
-typedef struct axis2_wsdl_feature_impl_s
+typedef struct axis2_wsdl_feature_impl
{
axis2_wsdl_feature_t wsdl_feature;
+
axis2_char_t *name;
axis2_bool_t required;
} axis2_wsdl_feature_impl_t;
@@ -69,10 +70,18 @@
if(NULL == wsdl_feature_impl)
AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
+ wsdl_feature_impl->wsdl_feature.wsdl_component = axis2_wsdl_component_create(env);
+ if(NULL == wsdl_feature_impl->wsdl_feature.wsdl_component)
+ {
+ AXIS2_FREE((*env)->allocator, wsdl_feature_impl);
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
+ }
+
wsdl_feature_impl->wsdl_feature.ops =
AXIS2_MALLOC ((*env)->allocator, sizeof(axis2_wsdl_feature_ops_t));
if(NULL == wsdl_feature_impl->wsdl_feature.ops)
{
+ AXIS2_WSDL_FEATURE_FREE(wsdl_feature_impl->wsdl_feature.wsdl_component, env);
AXIS2_FREE((*env)->allocator, wsdl_feature_impl);
AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
}
@@ -106,6 +115,11 @@
if(NULL != AXIS2_INTF_TO_IMPL(wsdl_feature)->name)
{
AXIS2_FREE((*env)->allocator, AXIS2_INTF_TO_IMPL(wsdl_feature)->name);
+ }
+
+ if(NULL != wsdl_feature->wsdl_component)
+ {
+ AXIS2_WSDL_COMPONENT_FREE(wsdl_feature->wsdl_component, env);
}
AXIS2_FREE((*env)->allocator, AXIS2_INTF_TO_IMPL(wsdl_feature));
Modified: webservices/axis2/trunk/c/modules/wsdl/src/wsdl_interface.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/wsdl/src/wsdl_interface.c?rev=345818&r1=345817&r2=345818&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/src/wsdl_interface.c (original)
+++ webservices/axis2/trunk/c/modules/wsdl/src/wsdl_interface.c Sun Nov 20 19:19:08 2005
@@ -20,9 +20,10 @@
* @brief Wsdl interface struct impl
* Axis2 Wsdl Interface Implementation
*/
-typedef struct axis2_wsdl_interface_impl_s
+typedef struct axis2_wsdl_interface_impl
{
axis2_wsdl_interface_t wsdl_interface;
+
/**
* Field name
*/
@@ -74,7 +75,7 @@
axis2_wsdl_interface_get_operations(axis2_wsdl_interface_t *wsdl_interface,
axis2_env_t **env);
-axis2_wsdl_operation_t *AXIS2_CALL
+struct axis2_operation *AXIS2_CALL
axis2_interface_get_operation(axis2_wsdl_interface_t *wsdl_interface,
axis2_env_t **env,
axis2_char_t *nc_name);
@@ -110,7 +111,7 @@
axis2_status_t AXIS2_CALL
axis2_wsdl_interface_set_operation(axis2_wsdl_interface_t *wsdl_interface,
axis2_env_t **env,
- axis2_wsdl_operation_t *operation);
+ struct axis2_operation *operation);
axis2_status_t AXIS2_CALL
axis2_wsdl_interface_set_super_interfaces(axis2_wsdl_interface_t *wsdl_interface,
@@ -169,10 +170,23 @@
AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
}
+ wsdl_interface_impl->wsdl_interface.extensible_component =
+ axis2_wsdl_extensible_component_create(env);
+
+ if(NULL == wsdl_interface_impl->wsdl_interface.extensible_component)
+ {
+ axis2_hash_free(wsdl_interface_impl->operations, env);
+ axis2_hash_free(wsdl_interface_impl->super_interfaces, env);
+ AXIS2_FREE((*env)->allocator, wsdl_interface_impl);
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
+ }
+
wsdl_interface_impl->wsdl_interface.ops = AXIS2_MALLOC((*env)->allocator,
sizeof(axis2_wsdl_interface_ops_t));
if(NULL == wsdl_interface_impl->wsdl_interface.ops)
{
+ AXIS2_WSDL_EXTENSIBLE_COMPONENT_FREE(wsdl_interface_impl->wsdl_interface.
+ extensible_component, env);
axis2_hash_free(wsdl_interface_impl->super_interfaces, env);
axis2_hash_free(wsdl_interface_impl->operations, env);
AXIS2_LINKED_LIST_FREE(wsdl_interface_impl->faults, env);
@@ -274,6 +288,10 @@
style_default);
}
+ if(NULL != wsdl_interface->extensible_component)
+ AXIS2_WSDL_EXTENSIBLE_COMPONENT_FREE(wsdl_interface->
+ extensible_component, env);
+
AXIS2_FREE((*env)->allocator, AXIS2_INTF_TO_IMPL(wsdl_interface));
return AXIS2_SUCCESS;
@@ -307,12 +325,12 @@
return AXIS2_INTF_TO_IMPL(wsdl_interface)->operations;
}
-axis2_wsdl_operation_t *AXIS2_CALL
+struct axis2_operation *AXIS2_CALL
axis2_interface_get_operation(axis2_wsdl_interface_t *wsdl_interface,
axis2_env_t **env,
axis2_char_t *nc_name)
{
- return (axis2_wsdl_operation_t *) axis2_hash_get(AXIS2_INTF_TO_IMPL(
+ return (struct axis2_operation *) axis2_hash_get(AXIS2_INTF_TO_IMPL(
wsdl_interface)->operations, nc_name, AXIS2_HASH_KEY_STRING);
}
@@ -369,17 +387,17 @@
axis2_status_t AXIS2_CALL
axis2_wsdl_interface_set_operation(axis2_wsdl_interface_t *wsdl_interface,
axis2_env_t **env,
- axis2_wsdl_operation_t *operation)
+ struct axis2_operation *operation)
{
- if (NULL == AXIS2_WSDL_OPERATION_GET_NAME(operation, env))
+ if (NULL == AXIS2_WSDL_OPERATION_GET_NAME(operation->wsdl_operation, env))
{
/* The Operation name cannot be null (required) */
AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_INVALID_STATE_WSDL_OPERATION,
AXIS2_FAILURE);
}
axis2_char_t *op_name = AXIS2_QNAME_GET_LOCALPART(AXIS2_WSDL_OPERATION_GET_NAME(
- operation, env), env);
+ operation->wsdl_operation, env), env);
axis2_hash_set(AXIS2_INTF_TO_IMPL(wsdl_interface)->operations, op_name,
AXIS2_HASH_KEY_STRING, operation);
Added: webservices/axis2/trunk/c/modules/wsdl/src/wsdl_msg_ref.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/wsdl/src/wsdl_msg_ref.c?rev=345818&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/src/wsdl_msg_ref.c (added)
+++ webservices/axis2/trunk/c/modules/wsdl/src/wsdl_msg_ref.c Sun Nov 20 19:19:08 2005
@@ -0,0 +1,230 @@
+/*
+ * 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 <axis2_wsdl_msg_ref.h>
+
+/**
+ * @brief Wsdl Binding Message Reference struct impl
+ * Referes to the MEP the Message relates to.
+ */
+typedef struct axis2_wsdl_msg_ref_impl
+{
+ axis2_wsdl_msg_ref_t msg_ref;
+
+ /**
+ * Field messageLabel
+ */
+ axis2_char_t *msg_label;
+
+ /**
+ * Field Direction
+ * Can be "in" or "out" depending on the element name being "input" or
+ * "output" respectively;
+ */
+ axis2_char_t *direction;
+
+ /**
+ * Field element
+ */
+ axis2_qname_t *element;
+
+} axis2_wsdl_msg_ref_impl_t;
+
+#define AXIS2_INTF_TO_IMPL(msg_ref) \
+ ((axis2_wsdl_msg_ref_impl_t *)msg_ref)
+
+/************************* Function prototypes ********************************/
+
+axis2_status_t AXIS2_CALL
+ axis2_wsdl_msg_ref_free (axis2_wsdl_msg_ref_t *msg_ref,
+ axis2_env_t **env);
+
+axis2_char_t * AXIS2_CALL
+axis2_wsdl_msg_ref_get_direction(axis2_wsdl_msg_ref_t *msg_ref,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_wsdl_msg_ref_set_direction(axis2_wsdl_msg_ref_t *msg_ref,
+ axis2_env_t **env,
+ axis2_char_t *direction);
+
+axis2_char_t * AXIS2_CALL
+axis2_wsdl_msg_ref_get_msg_label(axis2_wsdl_msg_ref_t *msg_ref,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_wsdl_msg_ref_set_msg_label(axis2_wsdl_msg_ref_t *msg_ref,
+ axis2_env_t **env,
+ axis2_char_t *msg_label);
+
+axis2_qname_t * AXIS2_CALL
+axis2_wsdl_msg_ref_get_element(axis2_wsdl_msg_ref_t *msg_ref,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_wdsl_msg_ref_set_element(axis2_wsdl_msg_ref_t *msg_ref,
+ axis2_env_t **env,
+ axis2_qname_t *element);
+
+/************************** End of function prototypes ************************/
+
+axis2_wsdl_msg_ref_t * AXIS2_CALL
+axis2_wsdl_msg_ref_create (axis2_env_t **env)
+{
+ AXIS2_ENV_CHECK(env, NULL);
+
+ axis2_wsdl_msg_ref_impl_t *msg_ref_impl =
+ (axis2_wsdl_msg_ref_impl_t *) AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_wsdl_msg_ref_impl_t));
+
+
+ if(NULL == msg_ref_impl)
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
+
+ msg_ref_impl->msg_ref.extensible_component =
+ axis2_wsdl_extensible_component_create(env);
+
+ if(NULL == msg_ref_impl->msg_ref.extensible_component)
+ {
+ AXIS2_FREE((*env)->allocator, msg_ref_impl);
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
+ }
+
+ msg_ref_impl->msg_ref.ops =
+ AXIS2_MALLOC ((*env)->allocator, sizeof(axis2_wsdl_msg_ref_ops_t));
+ if(NULL == msg_ref_impl->msg_ref.ops)
+ {
+ AXIS2_WSDL_EXTENSIBLE_COMPONENT_FREE(msg_ref_impl->msg_ref.
+ extensible_component, env);
+ AXIS2_FREE((*env)->allocator, msg_ref_impl);
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
+ }
+
+ msg_ref_impl->msg_ref.ops->free = axis2_wsdl_msg_ref_free;
+
+ msg_ref_impl->msg_ref.ops->get_direction =
+ axis2_wsdl_msg_ref_get_direction;
+
+ msg_ref_impl->msg_ref.ops->set_direction =
+ axis2_wsdl_msg_ref_set_direction;
+
+ msg_ref_impl->msg_ref.ops->get_msg_label =
+ axis2_wsdl_msg_ref_get_msg_label;
+
+ msg_ref_impl->msg_ref.ops->set_msg_label =
+ axis2_wsdl_msg_ref_set_msg_label;
+
+ msg_ref_impl->msg_ref.ops->get_element = axis2_wsdl_msg_ref_get_element;
+
+ msg_ref_impl->msg_ref.ops->set_element = axis2_wdsl_msg_ref_set_element;
+
+
+ msg_ref_impl->msg_label = NULL;
+ msg_ref_impl->direction = NULL;
+ msg_ref_impl->element = NULL;
+
+ return &(msg_ref_impl->msg_ref);
+}
+
+/***************************Function implementation****************************/
+
+axis2_status_t AXIS2_CALL
+axis2_wsdl_msg_ref_free (axis2_wsdl_msg_ref_t *msg_ref,
+ axis2_env_t **env)
+{
+ AXIS2_FUNC_PARAM_CHECK(msg_ref, env, AXIS2_FAILURE);
+ if(NULL != msg_ref->ops)
+ AXIS2_FREE((*env)->allocator, msg_ref->ops);
+
+ if(NULL != AXIS2_INTF_TO_IMPL(msg_ref)->msg_label)
+ {
+ AXIS2_FREE((*env)->allocator, AXIS2_INTF_TO_IMPL(msg_ref)->msg_label);
+ }
+
+ if(NULL != AXIS2_INTF_TO_IMPL(msg_ref)->msg_label)
+ {
+ AXIS2_FREE((*env)->allocator, AXIS2_INTF_TO_IMPL(msg_ref)->msg_label);
+ }
+
+ if(NULL != AXIS2_INTF_TO_IMPL(msg_ref)->element)
+ {
+ AXIS2_QNAME_FREE(AXIS2_INTF_TO_IMPL(msg_ref)->element, env);
+ }
+
+ if(NULL != msg_ref->extensible_component)
+ AXIS2_WSDL_EXTENSIBLE_COMPONENT_FREE(msg_ref->extensible_component, env);
+
+ AXIS2_FREE((*env)->allocator, AXIS2_INTF_TO_IMPL(msg_ref));
+
+ return AXIS2_SUCCESS;
+}
+
+axis2_char_t * AXIS2_CALL
+axis2_wsdl_msg_ref_get_direction(axis2_wsdl_msg_ref_t *msg_ref,
+ axis2_env_t **env)
+{
+ AXIS2_FUNC_PARAM_CHECK(msg_ref, env, NULL);
+ return AXIS2_INTF_TO_IMPL(msg_ref)->direction;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_wsdl_msg_ref_set_direction(axis2_wsdl_msg_ref_t *msg_ref,
+ axis2_env_t **env,
+ axis2_char_t *direction)
+{
+ AXIS2_FUNC_PARAM_CHECK(msg_ref, env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, direction, AXIS2_FAILURE);
+ AXIS2_INTF_TO_IMPL(msg_ref)->direction = direction;
+ return AXIS2_SUCCESS;
+}
+
+axis2_char_t * AXIS2_CALL
+axis2_wsdl_msg_ref_get_msg_label(axis2_wsdl_msg_ref_t *msg_ref,
+ axis2_env_t **env)
+{
+ AXIS2_FUNC_PARAM_CHECK(msg_ref, env, NULL);
+ return AXIS2_INTF_TO_IMPL(msg_ref)->msg_label;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_wsdl_msg_ref_set_msg_label(axis2_wsdl_msg_ref_t *msg_ref,
+ axis2_env_t **env,
+ axis2_char_t *msg_label)
+{
+ AXIS2_FUNC_PARAM_CHECK(msg_ref, env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, msg_label, AXIS2_FAILURE);
+ AXIS2_INTF_TO_IMPL(msg_ref)->msg_label = msg_label;
+ return AXIS2_SUCCESS;
+}
+
+axis2_qname_t * AXIS2_CALL
+axis2_wsdl_msg_ref_get_element(axis2_wsdl_msg_ref_t *msg_ref,
+ axis2_env_t **env)
+{
+ AXIS2_FUNC_PARAM_CHECK(msg_ref, env, NULL);
+ return AXIS2_INTF_TO_IMPL(msg_ref)->element;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_wdsl_msg_ref_set_element(axis2_wsdl_msg_ref_t *msg_ref,
+ axis2_env_t **env,
+ axis2_qname_t *element)
+{
+ AXIS2_FUNC_PARAM_CHECK(msg_ref, env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, element, AXIS2_FAILURE);
+ AXIS2_INTF_TO_IMPL(msg_ref)->element = element;
+ return AXIS2_SUCCESS;
+}
Modified: webservices/axis2/trunk/c/modules/wsdl/src/wsdl_operation.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/wsdl/src/wsdl_operation.c?rev=345818&r1=345817&r2=345818&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/src/wsdl_operation.c (original)
+++ webservices/axis2/trunk/c/modules/wsdl/src/wsdl_operation.c Sun Nov 20 19:19:08 2005
@@ -16,19 +16,53 @@
#include <axis2_wsdl_operation.h>
-typedef struct axis2_wsdl_operation_impl_s axis2_wsdl_operation_impl_t;
+typedef struct axis2_wsdl_operation_impl axis2_wsdl_operation_impl_t;
/**
* @brief Wsdl Component struct impl
* Axis2 Wsdl Component impl
*/
-struct axis2_wsdl_operation_impl_s
+struct axis2_wsdl_operation_impl
{
axis2_wsdl_operation_t wsdl_operation;
- axis2_wsdl_component_t *wsdl_component;
+ /**
+ * URI of the MEP
+ */
axis2_char_t *msg_exchange_pattern;
+ /**
+ * Field style
+ */
axis2_char_t *style;
+ /**
+ * Field name
+ */
axis2_qname_t *name;
+
+ /**
+ * Field inputMessage
+ */
+ axis2_wsdl_msg_ref_t *input_msg;
+
+ /**
+ * Field outputMessage
+ */
+ axis2_wsdl_msg_ref_t *output_msg;
+
+ /**
+ * Field infaults
+ */
+ axis2_linked_list_t *infaults;
+
+ /**
+ * Field outfaults
+ */
+ axis2_linked_list_t *outfaults;
+
+ /**
+ * Field safety
+ * value of parent if not specified
+ */
+ axis2_bool_t safety;
};
@@ -70,30 +104,65 @@
axis2_wsdl_operation_get_style (axis2_wsdl_operation_t *wsdl_operation,
axis2_env_t **env);
-axis2_status_t AXIS2_CALL
-axis2_wsdl_operation_set_component_properties (
- axis2_wsdl_operation_t *wsdl_operation,
- axis2_env_t **env,
- axis2_hash_t *properties);
-axis2_hash_t * AXIS2_CALL
-axis2_wsdl_operation_get_component_properties (
- axis2_wsdl_operation_t *wsdl_operation,
- axis2_env_t **env);
+axis2_linked_list_t * AXIS2_CALL
+axis2_wsdl_operation_get_infaults(axis2_wsdl_operation_t *wsdl_operation,
+ axis2_env_t **env);
-axis2_status_t AXIS2_CALL
-axis2_wsdl_operation_set_component_property (
- axis2_wsdl_operation_t *wsdl_operation,
- axis2_env_t **env,
- const void *key,
- void *value);
-
-void * AXIS2_CALL
-axis2_wsdl_operation_get_component_property (
- axis2_wsdl_operation_t *wsdl_operation,
+axis2_status_t AXIS2_CALL
+axis2_wsdl_operation_set_infaults(axis2_wsdl_operation_t *wsdl_operation,
+ axis2_env_t **env,
+ axis2_linked_list_t *infaults);
+
+axis2_wsdl_msg_ref_t *AXIS2_CALL
+axis2_wsdl_operation_get_input_msg(axis2_wsdl_operation_t *wsdl_operation,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_wsdl_operation_set_input_msg(axis2_wsdl_operation_t *wsdl_operation,
+ axis2_env_t **env,
+ axis2_wsdl_msg_ref_t *input_msg);
+
+axis2_linked_list_t *AXIS2_CALL
+axis2_wsdl_operation_get_outfaults(axis2_wsdl_operation_t *wsdl_operation,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_wsdl_operation_set_outfaults(axis2_wsdl_operation_t *wsdl_operation,
+ axis2_env_t **env,
+ axis2_linked_list_t *outfaults);
+
+axis2_wsdl_msg_ref_t *AXIS2_CALL
+axis2_wsdl_operation_get_output_msg(axis2_wsdl_operation_t *wsdl_operation,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_wsdl_operation_set_output_msg(axis2_wsdl_operation_t *wsdl_operation,
axis2_env_t **env,
- const void *key);
+ axis2_wsdl_msg_ref_t *output_msg);
+
+axis2_bool_t AXIS2_CALL
+axis2_wsdl_operation_is_safe(axis2_wsdl_operation_t *wsdl_operation,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_wsdl_operation_set_safety(axis2_wsdl_operation_t *wsdl_operation,
+ axis2_env_t **env,
+ axis2_bool_t safe);
+
+axis2_char_t *AXIS2_CALL
+axis2_wsdl_operation_get_target_namespace(axis2_wsdl_operation_t *wsdl_operation,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_wsdl_operation_add_infault(axis2_wsdl_operation_t *wsdl_operation,
+ axis2_env_t **env,
+ axis2_wsdl_fault_ref_t *infault);
+axis2_status_t AXIS2_CALL
+axis2_wsdl_operation_add_outfault(axis2_wsdl_operation_t *wsdl_operation,
+ axis2_env_t **env,
+ axis2_wsdl_fault_ref_t *outfault);
/***************************** End of function headers ************************/
@@ -108,13 +177,40 @@
{
AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
}
-
+
+ wsdl_operation_impl->infaults = axis2_linked_list_create(env);
+ if(NULL == wsdl_operation_impl->infaults)
+ {
+ AXIS2_FREE((*env)->allocator, wsdl_operation_impl);
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
+ }
+
+ wsdl_operation_impl->outfaults = axis2_linked_list_create(env);
+ if(NULL == wsdl_operation_impl->outfaults)
+ {
+ AXIS2_LINKED_LIST_FREE(wsdl_operation_impl->infaults, env);
+ AXIS2_FREE((*env)->allocator, wsdl_operation_impl);
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
+ }
+
+ wsdl_operation_impl->wsdl_operation.extensible_component = axis2_wsdl_extensible_component_create(env);
+ if(NULL == wsdl_operation_impl->wsdl_operation.extensible_component)
+ {
+ AXIS2_LINKED_LIST_FREE(wsdl_operation_impl->infaults, env);
+ AXIS2_LINKED_LIST_FREE(wsdl_operation_impl->outfaults, env);
+ AXIS2_FREE((*env)->allocator, wsdl_operation_impl);
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
+ }
+
wsdl_operation_impl->wsdl_operation.ops = (axis2_wsdl_operation_ops_t *)
AXIS2_MALLOC ((*env)->allocator, sizeof(axis2_wsdl_operation_ops_t));
if(NULL == wsdl_operation_impl->wsdl_operation.ops)
{
- AXIS2_FREE((*env)->allocator, wsdl_operation_impl->wsdl_operation.ops);
+ AXIS2_WSDL_COMPONENT_FREE(wsdl_operation_impl->wsdl_operation.extensible_component, env);
+ AXIS2_LINKED_LIST_FREE(wsdl_operation_impl->infaults, env);
+ AXIS2_LINKED_LIST_FREE(wsdl_operation_impl->outfaults, env);
+ AXIS2_FREE((*env)->allocator, wsdl_operation_impl);
AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
}
@@ -138,23 +234,51 @@
wsdl_operation_impl->wsdl_operation.ops->get_style =
axis2_wsdl_operation_get_style;
- wsdl_operation_impl->wsdl_operation.ops->set_component_properties =
- axis2_wsdl_operation_set_component_properties;
+ wsdl_operation_impl->wsdl_operation.ops->get_infaults =
+ axis2_wsdl_operation_get_infaults;
- wsdl_operation_impl->wsdl_operation.ops->get_component_properties =
- axis2_wsdl_operation_get_component_properties;
+ wsdl_operation_impl->wsdl_operation.ops->set_infaults =
+ axis2_wsdl_operation_set_infaults;
+
+ wsdl_operation_impl->wsdl_operation.ops->get_input_msg =
+ axis2_wsdl_operation_get_input_msg;
- wsdl_operation_impl->wsdl_operation.ops->set_component_property =
- axis2_wsdl_operation_set_component_property;
+ wsdl_operation_impl->wsdl_operation.ops->set_input_msg =
+ axis2_wsdl_operation_set_input_msg;
- wsdl_operation_impl->wsdl_operation.ops->get_component_property =
- axis2_wsdl_operation_get_component_property;
+ wsdl_operation_impl->wsdl_operation.ops->get_outfaults =
+ axis2_wsdl_operation_get_outfaults;
+
+ wsdl_operation_impl->wsdl_operation.ops->set_outfaults =
+ axis2_wsdl_operation_set_outfaults;
+
+ wsdl_operation_impl->wsdl_operation.ops->get_output_msg =
+ axis2_wsdl_operation_get_output_msg;
-
- wsdl_operation_impl->wsdl_component = axis2_wsdl_component_create(env);
+ wsdl_operation_impl->wsdl_operation.ops->set_output_msg =
+ axis2_wsdl_operation_set_output_msg;
+
+ wsdl_operation_impl->wsdl_operation.ops->is_safe =
+ axis2_wsdl_operation_is_safe;
+
+ wsdl_operation_impl->wsdl_operation.ops->set_safety =
+ axis2_wsdl_operation_set_safety;
+
+ wsdl_operation_impl->wsdl_operation.ops->get_target_namespace =
+ axis2_wsdl_operation_get_target_namespace;
+
+ wsdl_operation_impl->wsdl_operation.ops->add_infault =
+ axis2_wsdl_operation_add_infault;
+
+ wsdl_operation_impl->wsdl_operation.ops->add_outfault =
+ axis2_wsdl_operation_add_outfault;
+
wsdl_operation_impl->msg_exchange_pattern = NULL;
- wsdl_operation_impl->style = NULL;
+ wsdl_operation_impl->style = STYLE_DOC;
wsdl_operation_impl->name = NULL;
+ wsdl_operation_impl->input_msg = NULL;
+ wsdl_operation_impl->output_msg = NULL;
+ wsdl_operation_impl->safety = AXIS2_FALSE;
return &(wsdl_operation_impl->wsdl_operation);
}
@@ -170,9 +294,25 @@
if(NULL != wsdl_operation->ops)
AXIS2_FREE((*env)->allocator, wsdl_operation->ops);
- if(NULL != AXIS2_INTF_TO_IMPL(wsdl_operation)->wsdl_component)
- AXIS2_WSDL_COMPONENT_FREE(AXIS2_INTF_TO_IMPL(wsdl_operation)->
- wsdl_component, env);
+ if(NULL != wsdl_operation->extensible_component)
+ AXIS2_WSDL_COMPONENT_FREE(wsdl_operation->extensible_component, env);
+
+ if(NULL != AXIS2_INTF_TO_IMPL(wsdl_operation)->input_msg)
+ AXIS2_WSDL_MSG_REF_FREE(AXIS2_INTF_TO_IMPL(wsdl_operation)->
+ input_msg, env);
+
+ if(NULL != AXIS2_INTF_TO_IMPL(wsdl_operation)->output_msg)
+ AXIS2_WSDL_MSG_REF_FREE(AXIS2_INTF_TO_IMPL(wsdl_operation)->
+ output_msg, env);
+
+ if(NULL != AXIS2_INTF_TO_IMPL(wsdl_operation)->infaults)
+ AXIS2_LINKED_LIST_FREE(AXIS2_INTF_TO_IMPL(wsdl_operation)->
+ infaults, env);
+
+ if(NULL != AXIS2_INTF_TO_IMPL(wsdl_operation)->outfaults)
+ AXIS2_LINKED_LIST_FREE(AXIS2_INTF_TO_IMPL(wsdl_operation)->
+ outfaults, env);
+
if(NULL != AXIS2_INTF_TO_IMPL(wsdl_operation)->msg_exchange_pattern)
AXIS2_FREE((*env)->allocator, AXIS2_INTF_TO_IMPL(wsdl_operation)->
@@ -199,11 +339,11 @@
AXIS2_FUNC_PARAM_CHECK(wsdl_operation, env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK((*env)->error, msg_exchange_pattern, AXIS2_FAILURE);
- axis2_char_t *tempname = AXIS2_STRDUP(msg_exchange_pattern, env);
- if(NULL == tempname)
+ axis2_char_t *pattern_l = AXIS2_STRDUP(msg_exchange_pattern, env);
+ if(NULL == pattern_l)
AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
- AXIS2_INTF_TO_IMPL(wsdl_operation)->msg_exchange_pattern = tempname;
+ AXIS2_INTF_TO_IMPL(wsdl_operation)->msg_exchange_pattern = pattern_l;
return AXIS2_SUCCESS;
}
@@ -263,63 +403,108 @@
return AXIS2_INTF_TO_IMPL(wsdl_operation)->style;
}
+axis2_linked_list_t * AXIS2_CALL
+axis2_wsdl_operation_get_infaults(axis2_wsdl_operation_t *wsdl_operation,
+ axis2_env_t **env)
+{
+ return AXIS2_INTF_TO_IMPL(wsdl_operation)->infaults;
+}
-axis2_status_t AXIS2_CALL
-axis2_wsdl_operation_set_component_properties (
- axis2_wsdl_operation_t *wsdl_operation,
- axis2_env_t **env,
- axis2_hash_t *properties)
+axis2_status_t AXIS2_CALL
+axis2_wsdl_operation_set_infaults(axis2_wsdl_operation_t *wsdl_operation,
+ axis2_env_t **env,
+ axis2_linked_list_t *infaults)
{
- AXIS2_FUNC_PARAM_CHECK(wsdl_operation, env, AXIS2_FAILURE);
- AXIS2_PARAM_CHECK((*env)->error, properties, AXIS2_FAILURE);
-
- if(NULL == AXIS2_INTF_TO_IMPL(wsdl_operation)->wsdl_component)
- AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_INVALID_STATE_WSDL_OPERATION,
- AXIS2_FAILURE);
-
- return AXIS2_WSDL_COMPONENT_SET_COMPONENT_PROPERTIES(
- AXIS2_INTF_TO_IMPL(wsdl_operation)->wsdl_component, env, properties);
+ AXIS2_INTF_TO_IMPL(wsdl_operation)->infaults = infaults;
+ return AXIS2_SUCCESS;
}
-axis2_hash_t * AXIS2_CALL
-axis2_wsdl_operation_get_component_properties (
- axis2_wsdl_operation_t *wsdl_operation,
- axis2_env_t **env)
+axis2_wsdl_msg_ref_t *AXIS2_CALL
+axis2_wsdl_operation_get_input_msg(axis2_wsdl_operation_t *wsdl_operation,
+ axis2_env_t **env)
{
- AXIS2_FUNC_PARAM_CHECK(wsdl_operation, env, NULL);
-
- return AXIS2_WSDL_COMPONENT_GET_COMPONENT_PROPERTIES (
- AXIS2_INTF_TO_IMPL(wsdl_operation)->wsdl_component, env);
+ return AXIS2_INTF_TO_IMPL(wsdl_operation)->input_msg;
}
-axis2_status_t AXIS2_CALL
-axis2_wsdl_operation_set_component_property (
- axis2_wsdl_operation_t *wsdl_operation,
- axis2_env_t **env,
- const void *key,
- void *value)
+axis2_status_t AXIS2_CALL
+axis2_wsdl_operation_set_input_msg(axis2_wsdl_operation_t *wsdl_operation,
+ axis2_env_t **env,
+ axis2_wsdl_msg_ref_t *input_msg)
{
- AXIS2_FUNC_PARAM_CHECK(wsdl_operation, env, AXIS2_FAILURE);
- AXIS2_PARAM_CHECK((*env)->error, key, AXIS2_FAILURE);
- AXIS2_PARAM_CHECK((*env)->error, value, AXIS2_FAILURE);
-
- if(NULL == AXIS2_INTF_TO_IMPL(wsdl_operation)->wsdl_component)
- AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_INVALID_STATE_WSDL_OPERATION,
- AXIS2_FAILURE);
-
- return AXIS2_WSDL_COMPONENT_SET_COMPONENT_PROPERTY (
- AXIS2_INTF_TO_IMPL(wsdl_operation)->wsdl_component, env, key, value);
+ AXIS2_INTF_TO_IMPL(wsdl_operation)->input_msg = input_msg;
+ return AXIS2_SUCCESS;
}
-
-void * AXIS2_CALL
-axis2_wsdl_operation_get_component_property(
- axis2_wsdl_operation_t *wsdl_operation,
+
+axis2_linked_list_t *AXIS2_CALL
+axis2_wsdl_operation_get_outfaults(axis2_wsdl_operation_t *wsdl_operation,
+ axis2_env_t **env)
+{
+ return AXIS2_INTF_TO_IMPL(wsdl_operation)->outfaults;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_wsdl_operation_set_outfaults(axis2_wsdl_operation_t *wsdl_operation,
+ axis2_env_t **env,
+ axis2_linked_list_t *outfaults)
+{
+ AXIS2_INTF_TO_IMPL(wsdl_operation)->outfaults = outfaults;
+ return AXIS2_SUCCESS;
+}
+
+axis2_wsdl_msg_ref_t *AXIS2_CALL
+axis2_wsdl_operation_get_output_msg(axis2_wsdl_operation_t *wsdl_operation,
+ axis2_env_t **env)
+{
+ return AXIS2_INTF_TO_IMPL(wsdl_operation)->output_msg;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_wsdl_operation_set_output_msg(axis2_wsdl_operation_t *wsdl_operation,
axis2_env_t **env,
- const void *key)
+ axis2_wsdl_msg_ref_t *output_msg)
{
- AXIS2_FUNC_PARAM_CHECK(wsdl_operation, env, AXIS2_FAILURE);
- AXIS2_PARAM_CHECK((*env)->error, key, AXIS2_FAILURE);
-
- return AXIS2_WSDL_COMPONENT_GET_COMPONENT_PROPERTY (
- AXIS2_INTF_TO_IMPL(wsdl_operation)->wsdl_component, env, key);
+ AXIS2_INTF_TO_IMPL(wsdl_operation)->output_msg = output_msg;
+ return AXIS2_SUCCESS;
+}
+
+axis2_bool_t AXIS2_CALL
+axis2_wsdl_operation_is_safe(axis2_wsdl_operation_t *wsdl_operation,
+ axis2_env_t **env)
+{
+ return AXIS2_INTF_TO_IMPL(wsdl_operation)->safety;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_wsdl_operation_set_safety(axis2_wsdl_operation_t *wsdl_operation,
+ axis2_env_t **env,
+ axis2_bool_t safe)
+{
+ AXIS2_INTF_TO_IMPL(wsdl_operation)->safety = safe;
+ return AXIS2_SUCCESS;
+}
+
+axis2_char_t *AXIS2_CALL
+axis2_wsdl_operation_get_target_namespace(axis2_wsdl_operation_t *wsdl_operation,
+ axis2_env_t **env)
+{
+ if (NULL != AXIS2_INTF_TO_IMPL(wsdl_operation)->name)
+ {
+ return AXIS2_QNAME_GET_URI(AXIS2_INTF_TO_IMPL(wsdl_operation)->name, env);
+ }
+ return NULL;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_wsdl_operation_add_infault(axis2_wsdl_operation_t *wsdl_operation,
+ axis2_env_t **env,
+ axis2_wsdl_fault_ref_t *infault)
+{
+ return AXIS2_LINKED_LIST_ADD(AXIS2_INTF_TO_IMPL(wsdl_operation)->infaults, env, infault);
+}
+
+axis2_status_t AXIS2_CALL
+axis2_wsdl_operation_add_outfault(axis2_wsdl_operation_t *wsdl_operation,
+ axis2_env_t **env,
+ axis2_wsdl_fault_ref_t *outfault) {
+ return AXIS2_LINKED_LIST_ADD(AXIS2_INTF_TO_IMPL(wsdl_operation)->outfaults, env, outfault);
}
Modified: webservices/axis2/trunk/c/modules/wsdl/src/wsdl_property.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/wsdl/src/wsdl_property.c?rev=345818&r1=345817&r2=345818&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/src/wsdl_property.c (original)
+++ webservices/axis2/trunk/c/modules/wsdl/src/wsdl_property.c Sun Nov 20 19:19:08 2005
@@ -20,9 +20,10 @@
* @brief Wsdl property struct impl
* Wsdl properties
*/
-typedef struct axis2_wsdl_property_impl_s
+typedef struct axis2_wsdl_property_impl
{
axis2_wsdl_property_t wsdl_property;
+
axis2_char_t *name;
void *constraint;
void *value;
@@ -79,6 +80,14 @@
if(NULL == wsdl_property_impl)
AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
+ wsdl_property_impl->wsdl_property.wsdl_component = axis2_wsdl_component_create(env);
+
+ if(NULL == wsdl_property_impl->wsdl_property.wsdl_component)
+ {
+ AXIS2_FREE((*env)->allocator, wsdl_property_impl);
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
+ }
+
wsdl_property_impl->wsdl_property.ops =
AXIS2_MALLOC ((*env)->allocator, sizeof(axis2_wsdl_property_ops_t));
if(NULL == wsdl_property_impl->wsdl_property.ops)
@@ -132,6 +141,9 @@
{
AXIS2_FREE((*env)->allocator, AXIS2_INTF_TO_IMPL(wsdl_property)->value);
}
+
+ if(NULL != wsdl_property->wsdl_component)
+ AXIS2_WSDL_COMPONENT_FREE(wsdl_property->wsdl_component, env);
AXIS2_FREE((*env)->allocator, AXIS2_INTF_TO_IMPL(wsdl_property));
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=345818&r1=345817&r2=345818&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/src/wsdl_svc.c (original)
+++ webservices/axis2/trunk/c/modules/wsdl/src/wsdl_svc.c Sun Nov 20 19:19:08 2005
@@ -25,9 +25,20 @@
struct axis2_wsdl_svc_impl_s
{
axis2_wsdl_svc_t wsdl_svc;
- axis2_wsdl_component_t * wsdl_component;
+
+ /**
+ * The QName that identifies the Service. This namespace of the QName
+ * should be the target namespace defined in the Definitions component.
+ */
axis2_qname_t *qname;
-
+ /**
+ * The Interface that this Service is an instance of.
+ */
+ struct axis2_wsdl_interface *svc_interface;
+ /**
+ *
+ */
+ axis2_hash_t *endpoints;
};
#define AXIS2_INTF_TO_IMPL(wsdl_svc) ((axis2_wsdl_svc_impl_t *)(wsdl_svc))
@@ -47,25 +58,37 @@
axis2_env_t **env,
axis2_qname_t *qname);
-axis2_hash_t * AXIS2_CALL
-axis2_wsdl_svc_get_component_properties(axis2_wsdl_svc_t *wsdl_svc,
- axis2_env_t **env);
+axis2_hash_t *AXIS2_CALL
+axis2_wsdl_svc_get_endpoints(axis2_wsdl_svc_t *wsdl_svc,
+ axis2_env_t **env);
-axis2_status_t AXIS2_CALL
-axis2_wsdl_svc_set_component_properties(axis2_wsdl_svc_t *wsdl_svc,
- axis2_env_t **env,
- axis2_hash_t *properties);
-
-axis2_wsdl_component_t * AXIS2_CALL
-axis2_wsdl_svc_get_component_property(axis2_wsdl_svc_t *wsdl_svc,
- axis2_env_t **env,
- const axis2_char_t *key);
+axis2_status_t AXIS2_CALL
+axis2_wsdl_svc_set_endpoints(axis2_wsdl_svc_t *wsdl_svc,
+ axis2_env_t **env,
+ axis2_hash_t *endpoints);
-axis2_status_t AXIS2_CALL
-axis2_wsdl_svc_set_component_property (axis2_wsdl_svc_t *wsdl_svc,
- axis2_env_t **env,
- const void *key,
- void *value);
+axis2_status_t AXIS2_CALL
+axis2_wsdl_svc_set_endpoint(axis2_wsdl_svc_t *wsdl_svc,
+ axis2_env_t **env,
+ axis2_wsdl_endpoint_t *endpoint);
+
+axis2_wsdl_endpoint_t * AXIS2_CALL
+axis2_wsdl_svc_get_endpoint(axis2_wsdl_svc_t *wsdl_svc,
+ axis2_env_t **env,
+ axis2_qname_t *qname);
+
+axis2_char_t *AXIS2_CALL
+axis2_wsdl_svc_get_namespace(axis2_wsdl_svc_t *wsdl_svc,
+ axis2_env_t **env);
+
+struct axis2_wsdl_interface * AXIS2_CALL
+axis2_wsdl_svc_get_svc_interface(axis2_wsdl_svc_t *wsdl_svc,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_wsdl_svc_set_svc_interface(axis2_wsdl_svc_t *wsdl_svc,
+ axis2_env_t **env,
+ struct axis2_wsdl_interface *svc_interface);
/***************************** End of function headers ************************/
@@ -81,19 +104,28 @@
AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
}
- wsdl_svc_impl->wsdl_component = axis2_wsdl_component_create(env);
- if(NULL == wsdl_svc_impl->wsdl_component)
+ wsdl_svc_impl->wsdl_svc.wsdl_component = axis2_wsdl_component_create(env);
+ if(NULL == wsdl_svc_impl->wsdl_svc.wsdl_component)
{
AXIS2_FREE((*env)->allocator, wsdl_svc_impl);
AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
}
+
+ wsdl_svc_impl->endpoints = axis2_hash_make(env);
+ if(NULL == wsdl_svc_impl->endpoints)
+ {
+ AXIS2_WSDL_COMPONENT_FREE(wsdl_svc_impl->wsdl_svc.wsdl_component, env);
+ AXIS2_FREE((*env)->allocator, wsdl_svc_impl);
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
+ }
wsdl_svc_impl->wsdl_svc.ops =
(axis2_wsdl_svc_ops_t *) AXIS2_MALLOC ((*env)->allocator,
sizeof(axis2_wsdl_svc_ops_t));
if(NULL == wsdl_svc_impl->wsdl_svc.ops)
{
- AXIS2_WSDL_COMPONENT_FREE(wsdl_svc_impl->wsdl_component, env);
+ axis2_hash_free(wsdl_svc_impl->endpoints, env);
+ AXIS2_WSDL_COMPONENT_FREE(wsdl_svc_impl->wsdl_svc.wsdl_component, env);
AXIS2_FREE((*env)->allocator, wsdl_svc_impl);
AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, NULL);
}
@@ -101,7 +133,16 @@
wsdl_svc_impl->wsdl_svc.ops->free = axis2_wsdl_svc_free;
wsdl_svc_impl->wsdl_svc.ops->get_name = axis2_svc_get_name;
wsdl_svc_impl->wsdl_svc.ops->set_name = axis2_svc_set_name;
-
+ wsdl_svc_impl->wsdl_svc.ops->get_endpoints = axis2_wsdl_svc_get_endpoints;
+ wsdl_svc_impl->wsdl_svc.ops->set_endpoints = axis2_wsdl_svc_set_endpoints;
+ wsdl_svc_impl->wsdl_svc.ops->set_endpoint = axis2_wsdl_svc_set_endpoint;
+ wsdl_svc_impl->wsdl_svc.ops->get_endpoint = axis2_wsdl_svc_get_endpoint;
+ wsdl_svc_impl->wsdl_svc.ops->get_namespace = axis2_wsdl_svc_get_namespace;
+ wsdl_svc_impl->wsdl_svc.ops->get_svc_interface = axis2_wsdl_svc_get_svc_interface;
+ wsdl_svc_impl->wsdl_svc.ops->set_svc_interface = axis2_wsdl_svc_set_svc_interface;
+
+ wsdl_svc_impl->svc_interface = NULL;
+
return &(wsdl_svc_impl->wsdl_svc);
}
@@ -113,10 +154,16 @@
{
AXIS2_FUNC_PARAM_CHECK(wsdl_svc, env, AXIS2_FAILURE);
- if(NULL != AXIS2_INTF_TO_IMPL(wsdl_svc)->wsdl_component)
- AXIS2_WSDL_COMPONENT_FREE(AXIS2_INTF_TO_IMPL(wsdl_svc)->wsdl_component,
+ if(NULL != wsdl_svc->wsdl_component)
+ AXIS2_WSDL_COMPONENT_FREE(wsdl_svc->wsdl_component,
env);
+ if(NULL != AXIS2_INTF_TO_IMPL(wsdl_svc)->endpoints)
+ axis2_hash_free(AXIS2_INTF_TO_IMPL(wsdl_svc)->endpoints, env);
+
+ if(NULL != AXIS2_INTF_TO_IMPL(wsdl_svc)->svc_interface)
+ AXIS2_WSDL_INTERFACE_FREE(wsdl_svc, env);
+
if(NULL != wsdl_svc->ops)
AXIS2_FREE((*env)->allocator, wsdl_svc->ops);
@@ -129,7 +176,7 @@
axis2_svc_get_name(axis2_wsdl_svc_t *wsdl_svc,
axis2_env_t **env)
{
- AXIS2_FUNC_PARAM_CHECK(wsdl_svc, env, AXIS2_FAILURE);
+ AXIS2_FUNC_PARAM_CHECK(wsdl_svc, env, NULL);
return AXIS2_INTF_TO_IMPL(wsdl_svc)->qname;
}
@@ -145,48 +192,79 @@
return AXIS2_SUCCESS;
}
-axis2_hash_t * AXIS2_CALL
-axis2_wsdl_svc_get_component_properties(axis2_wsdl_svc_t *wsdl_svc,
- axis2_env_t **env)
+axis2_hash_t *AXIS2_CALL
+axis2_wsdl_svc_get_endpoints(axis2_wsdl_svc_t *wsdl_svc,
+ axis2_env_t **env)
{
AXIS2_FUNC_PARAM_CHECK(wsdl_svc, env, NULL);
-
- return AXIS2_WSDL_COMPONENT_GET_COMPONENT_PROPERTIES (
- AXIS2_INTF_TO_IMPL(wsdl_svc)->wsdl_component, env);
+ return AXIS2_INTF_TO_IMPL(wsdl_svc)->endpoints;
}
-axis2_status_t AXIS2_CALL
-axis2_wsdl_svc_set_component_properties(axis2_wsdl_svc_t *wsdl_svc,
- axis2_env_t **env,
- axis2_hash_t *properties)
+axis2_status_t AXIS2_CALL
+axis2_wsdl_svc_set_endpoints(axis2_wsdl_svc_t *wsdl_svc,
+ axis2_env_t **env,
+ axis2_hash_t *endpoints)
+{
+ AXIS2_FUNC_PARAM_CHECK(wsdl_svc, env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, endpoints, AXIS2_FAILURE);
+ AXIS2_INTF_TO_IMPL(wsdl_svc)->endpoints = endpoints;
+ return AXIS2_SUCCESS;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_wsdl_svc_set_endpoint(axis2_wsdl_svc_t *wsdl_svc,
+ axis2_env_t **env,
+ axis2_wsdl_endpoint_t *endpoint)
{
AXIS2_FUNC_PARAM_CHECK(wsdl_svc, env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, endpoint, AXIS2_FAILURE);
+
+ axis2_hash_set(AXIS2_INTF_TO_IMPL(wsdl_svc)->endpoints,
+ AXIS2_WSDL_ENDPOINT_GET_NAME(endpoint, env), sizeof(axis2_qname_t), endpoint);
- return AXIS2_WSDL_COMPONENT_SET_COMPONENT_PROPERTIES(
- AXIS2_INTF_TO_IMPL(wsdl_svc)->wsdl_component, env, properties);
+ return AXIS2_SUCCESS;
+}
+
+axis2_wsdl_endpoint_t * AXIS2_CALL
+axis2_wsdl_svc_get_endpoint(axis2_wsdl_svc_t *wsdl_svc,
+ axis2_env_t **env,
+ axis2_qname_t *qname)
+{
+ AXIS2_FUNC_PARAM_CHECK(wsdl_svc, env, NULL);
+ return (axis2_wsdl_endpoint_t *) axis2_hash_get(AXIS2_INTF_TO_IMPL(
+ wsdl_svc)->endpoints, qname, sizeof(axis2_qname_t));
}
-axis2_wsdl_component_t * AXIS2_CALL
-axis2_wsdl_svc_get_component_property(axis2_wsdl_svc_t *wsdl_svc,
- axis2_env_t **env,
- const axis2_char_t *key)
+axis2_char_t *AXIS2_CALL
+axis2_wsdl_svc_get_namespace(axis2_wsdl_svc_t *wsdl_svc,
+ axis2_env_t **env)
{
AXIS2_FUNC_PARAM_CHECK(wsdl_svc, env, NULL);
- AXIS2_PARAM_CHECK((*env)->error, key, NULL);
- return AXIS2_WSDL_COMPONENT_GET_COMPONENT_PROPERTY (
- AXIS2_INTF_TO_IMPL(wsdl_svc)->wsdl_component, env, key);
+ if (NULL == AXIS2_INTF_TO_IMPL(wsdl_svc)->qname)
+ {
+ /* Target Namespace not set and the Service Name is null */
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_INVALID_STATE_WSDL_SVC, NULL);
+ }
+
+ return AXIS2_QNAME_GET_URI(AXIS2_INTF_TO_IMPL(wsdl_svc)->qname, env);
}
-axis2_status_t AXIS2_CALL
-axis2_wsdl_svc_set_component_property (axis2_wsdl_svc_t *wsdl_svc,
- axis2_env_t **env,
- const void *key,
- void *value)
+struct axis2_wsdl_interface * AXIS2_CALL
+axis2_wsdl_svc_get_svc_interface(axis2_wsdl_svc_t *wsdl_svc,
+ axis2_env_t **env)
+{
+ AXIS2_FUNC_PARAM_CHECK(wsdl_svc, env, NULL);
+ return AXIS2_INTF_TO_IMPL(wsdl_svc)->svc_interface;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_wsdl_svc_set_svc_interface(axis2_wsdl_svc_t *wsdl_svc,
+ axis2_env_t **env,
+ struct axis2_wsdl_interface *svc_interface)
{
AXIS2_FUNC_PARAM_CHECK(wsdl_svc, env, AXIS2_FAILURE);
- AXIS2_PARAM_CHECK((*env)->error, key, AXIS2_FAILURE);
-
- return AXIS2_WSDL_COMPONENT_SET_COMPONENT_PROPERTY (
- AXIS2_INTF_TO_IMPL(wsdl_svc)->wsdl_component, env, key, value);
+ AXIS2_PARAM_CHECK((*env)->error, svc_interface, AXIS2_FAILURE);
+ AXIS2_INTF_TO_IMPL(wsdl_svc)->svc_interface = svc_interface;
+ return AXIS2_SUCCESS;
}