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 pi...@apache.org on 2006/08/23 11:15:56 UTC
svn commit: r433990 - in /webservices/axis2/trunk/c:
include/axis2_raw_xml_in_out_msg_recv.h
modules/core/receivers/raw_xml_in_out_msg_recv.c
Author: pini
Date: Wed Aug 23 02:15:56 2006
New Revision: 433990
URL: http://svn.apache.org/viewvc?rev=433990&view=rev
Log:
More fomatting fixes.
Modified:
webservices/axis2/trunk/c/include/axis2_raw_xml_in_out_msg_recv.h
webservices/axis2/trunk/c/modules/core/receivers/raw_xml_in_out_msg_recv.c
Modified: webservices/axis2/trunk/c/include/axis2_raw_xml_in_out_msg_recv.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/include/axis2_raw_xml_in_out_msg_recv.h?rev=433990&r1=433989&r2=433990&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_raw_xml_in_out_msg_recv.h (original)
+++ webservices/axis2/trunk/c/include/axis2_raw_xml_in_out_msg_recv.h Wed Aug 23 02:15:56 2006
@@ -17,6 +17,11 @@
#ifndef AXIS2_RAW_XML_IN_OUT_MSG_RECV_H
#define AXIS2_RAW_XML_IN_OUT_MSG_RECV_H
+/** @defgroup axis2_raw_xml_in_out_msg_recv raw XML in-out message receiver
+ * @ingroup axis2_receivers
+ * @{
+ */
+
/**
* @file axis2_ws_info.h
* @brief Axis2 Raw Xml In Out Message Receiver interface
@@ -35,20 +40,16 @@
{
#endif
- /** @defgroup axis2_raw_xml_in_out_msg_recv raw XML in-out message receiver
- * @ingroup axis2_receivers
- * @{
- */
/**
* Creates raw xml in out message receiver struct
* @return pointer to newly created raw xml in out message receiver
*/
- AXIS2_EXTERN axis2_msg_recv_t * AXIS2_CALL
+ AXIS2_EXTERN axis2_msg_recv_t *AXIS2_CALL
axis2_raw_xml_in_out_msg_recv_create(
const axis2_env_t *env);
- /** @} */
+/** @} */
#ifdef __cplusplus
}
Modified: webservices/axis2/trunk/c/modules/core/receivers/raw_xml_in_out_msg_recv.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/receivers/raw_xml_in_out_msg_recv.c?rev=433990&r1=433989&r2=433990&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/receivers/raw_xml_in_out_msg_recv.c (original)
+++ webservices/axis2/trunk/c/modules/core/receivers/raw_xml_in_out_msg_recv.c Wed Aug 23 02:15:56 2006
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
+
#include <axis2_raw_xml_in_out_msg_recv.h>
#include <string.h>
#include <axiom_element.h>
@@ -26,24 +26,26 @@
/************************* Function prototypes ********************************/
axis2_status_t AXIS2_CALL
-axis2_raw_xml_in_out_msg_recv_invoke_business_logic_sync(axis2_msg_recv_t *msg_recv,
- const axis2_env_t *env,
- axis2_msg_ctx_t *msg_ctx,
- axis2_msg_ctx_t *new_msg_ctx);
-
+axis2_raw_xml_in_out_msg_recv_invoke_business_logic_sync(
+ axis2_msg_recv_t *msg_recv,
+ const axis2_env_t *env,
+ axis2_msg_ctx_t *msg_ctx,
+ axis2_msg_ctx_t *new_msg_ctx);
+
/************************** End of function prototypes ************************/
-AXIS2_EXTERN axis2_msg_recv_t * AXIS2_CALL
-axis2_raw_xml_in_out_msg_recv_create(const axis2_env_t *env)
+AXIS2_EXTERN axis2_msg_recv_t *AXIS2_CALL
+axis2_raw_xml_in_out_msg_recv_create(
+ const axis2_env_t *env)
{
axis2_msg_recv_t *msg_recv = NULL;
axis2_status_t status = AXIS2_FAILURE;
-
- AXIS2_ENV_CHECK(env, NULL);
- msg_recv = axis2_msg_recv_create(env);
- if(NULL == msg_recv)
+
+ AXIS2_ENV_CHECK(env, NULL);
+ msg_recv = axis2_msg_recv_create(env);
+ if(NULL == msg_recv)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
status = AXIS2_MSG_RECV_SET_SCOPE(msg_recv, env, AXIS2_APPLICATION_SCOPE);
@@ -52,19 +54,20 @@
AXIS2_MSG_RECV_FREE(msg_recv, env);
return NULL;
}
- msg_recv->ops->invoke_in_out_business_logic_sync =
+ msg_recv->ops->invoke_in_out_business_logic_sync =
axis2_raw_xml_in_out_msg_recv_invoke_business_logic_sync;
msg_recv->ops->receive = msg_recv->ops->receive_sync;
- return msg_recv;
+ return msg_recv;
}
/***************************Function implementation****************************/
axis2_status_t AXIS2_CALL
-axis2_raw_xml_in_out_msg_recv_invoke_business_logic_sync(axis2_msg_recv_t *msg_recv,
- const axis2_env_t *env,
- axis2_msg_ctx_t *msg_ctx,
- axis2_msg_ctx_t *new_msg_ctx)
+axis2_raw_xml_in_out_msg_recv_invoke_business_logic_sync(
+ axis2_msg_recv_t *msg_recv,
+ const axis2_env_t *env,
+ axis2_msg_ctx_t *msg_ctx,
+ axis2_msg_ctx_t *new_msg_ctx)
{
axis2_svc_skeleton_t *svc_obj = NULL;
axis2_op_ctx_t *op_ctx = NULL;
@@ -86,14 +89,14 @@
const axis2_char_t *soap_ns = AXIOM_SOAP12_SOAP_ENVELOPE_NAMESPACE_URI;
int soap_version = AXIOM_SOAP12;
axiom_namespace_t *env_ns = NULL;
-
+
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, msg_ctx, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, new_msg_ctx, AXIS2_FAILURE);
-
+
/* get the implementation class for the Web Service */
svc_obj = AXIS2_MSG_RECV_GET_IMPL_OBJ(msg_recv, env, msg_ctx);
-
+
if (!svc_obj)
{
const axis2_char_t *svc_name = NULL;
@@ -107,12 +110,12 @@
{
svc_name = "unknown";
}
-
- AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
- "Impl object for service '%s' not set in message receiver. %d :: %s",
- svc_name,
- env->error->error_number,
- AXIS2_ERROR_GET_MESSAGE(env->error));
+
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+ "Impl object for service '%s' not set in message receiver. %d :: %s",
+ svc_name,
+ env->error->error_number,
+ AXIS2_ERROR_GET_MESSAGE(env->error));
status = AXIS2_FAILURE;
}
else
@@ -125,12 +128,12 @@
{
axiom_soap_envelope_t *envelope = NULL;
axiom_soap_body_t *body = NULL;
-
+
envelope = AXIS2_MSG_CTX_GET_SOAP_ENVELOPE(msg_ctx, env);
body = AXIOM_SOAP_ENVELOPE_GET_BODY(envelope, env);
om_node = AXIOM_SOAP_BODY_GET_BASE_NODE(body, env);
om_element = AXIOM_NODE_GET_DATA_ELEMENT(om_node, env);
- om_node = AXIOM_NODE_GET_FIRST_CHILD(om_node, env);
+ om_node = AXIOM_NODE_GET_FIRST_CHILD(om_node, env);
}
else if(0 == AXIS2_STRCMP(AXIS2_STYLE_RPC, style))
{
@@ -138,7 +141,7 @@
axiom_soap_body_t *body = NULL;
axiom_node_t *op_node = NULL;
axiom_element_t *op_element = NULL;
-
+
envelope = AXIS2_MSG_CTX_GET_SOAP_ENVELOPE(msg_ctx, env);
body = AXIOM_SOAP_ENVELOPE_GET_BODY(envelope, env);
op_node = AXIOM_SOAP_BODY_GET_BASE_NODE(body, env);
@@ -152,86 +155,86 @@
int i = 0;
int size = 0;
axis2_bool_t matches = AXIS2_FALSE;
-
+
function_arr = svc_obj->func_array;
if(function_arr)
{
size = AXIS2_ARRAY_LIST_SIZE(function_arr, env);
}
-
- for (i = 0; i < size; i++)
+
+ for (i = 0; i < size; i++)
{
axis2_char_t *function_name = NULL;
-
+
function_name = (axis2_char_t *) AXIS2_ARRAY_LIST_GET(
- function_arr, env, i);
+ function_arr, env, i);
if(0 == AXIS2_STRCMP(function_name, local_name))
{
matches = AXIS2_TRUE;
-
+
}
}
if(AXIS2_TRUE == matches)
{
om_node = AXIOM_NODE_GET_FIRST_CHILD(op_node, env);
- om_element = AXIOM_NODE_GET_DATA_ELEMENT(om_node, env);
+ om_element = AXIOM_NODE_GET_DATA_ELEMENT(om_node, env);
}
else
{
- AXIS2_ERROR_SET(env->error,
- AXIS2_ERROR_OM_ELEMENT_MISMATCH, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error,
+ AXIS2_ERROR_OM_ELEMENT_MISMATCH, AXIS2_FAILURE);
status = AXIS2_FAILURE;
}
}
else
{
- AXIS2_ERROR_SET(env->error,
- AXIS2_ERROR_OM_ELEMENT_INVALID_STATE, AXIS2_FAILURE);
+ AXIS2_ERROR_SET(env->error,
+ AXIS2_ERROR_OM_ELEMENT_INVALID_STATE, AXIS2_FAILURE);
status = AXIS2_FAILURE;
}
}
else
{
- AXIS2_ERROR_SET(env->error,
+ AXIS2_ERROR_SET(env->error,
AXIS2_ERROR_RPC_NEED_MATCHING_CHILD, AXIS2_FAILURE);
status = AXIS2_FAILURE;
}
}
else
{
- AXIS2_ERROR_SET(env->error,
+ AXIS2_ERROR_SET(env->error,
AXIS2_ERROR_UNKNOWN_STYLE, AXIS2_FAILURE);
status = AXIS2_FAILURE;
}
-
+
if (status == AXIS2_SUCCESS)
{
skel_invoked = AXIS2_TRUE;
result_node = AXIS2_SVC_SKELETON_INVOKE(svc_obj, env, om_node, new_msg_ctx);
AXIS2_SVC_SKELETON_FREE(svc_obj, env);
}
-
+
if (result_node)
{
if(0 == AXIS2_STRCMP(style, AXIS2_STYLE_RPC))
{
axiom_namespace_t *ns = NULL;
axis2_char_t *res_name = NULL;
-
+
res_name = AXIS2_STRACAT(local_name, "Response", env);
ns = axiom_namespace_create(env, "http://soapenc/", "res");
if(!ns)
{
status = AXIS2_FAILURE;
}
- else
+ else
{
- body_content_element = axiom_element_create(env, NULL, res_name,
- ns, &body_content_node);
+ body_content_element = axiom_element_create(env, NULL, res_name,
+ ns, &body_content_node);
AXIOM_NODE_ADD_CHILD(body_content_node, env, result_node);
}
-
+
}
else
{
@@ -243,7 +246,7 @@
status = AXIS2_ERROR_GET_STATUS_CODE(env->error);
}
}
-
+
if (msg_ctx && AXIS2_MSG_CTX_GET_IS_SOAP_11(msg_ctx, env))
{
soap_ns = AXIOM_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI; /* default is 1.2 */
@@ -252,19 +255,19 @@
if (AXIS2_MSG_CTX_GET_SOAP_ENVELOPE(new_msg_ctx, env))
{
- /* service implementation has set the envelope,
+ /* service implementation has set the envelope,
useful when setting a SOAP fault.
No need to further process */
return AXIS2_SUCCESS;
}
-
+
/* create the soap envelope here*/
- env_ns = axiom_namespace_create(env, soap_ns, "soapenv");
+ env_ns = axiom_namespace_create(env, soap_ns, "soapenv");
if (!env_ns)
{
return AXIS2_FAILURE;
}
-
+
default_envelope = axiom_soap_envelope_create(env, env_ns);
if (!default_envelope)
@@ -289,17 +292,17 @@
{
return AXIS2_FAILURE;
}
-
+
if (status != AXIS2_SUCCESS)
{
/* something went wrong. set a SOAP Fault*/
const axis2_char_t *fault_value_str = "env:Sender";
const axis2_char_t *fault_reason_str = NULL;
const axis2_char_t *err_msg = NULL;
-
+
if (!skel_invoked)
fault_value_str = "env:Receiver";
-
+
err_msg = AXIS2_ERROR_GET_MESSAGE(env->error);
if (err_msg)
{
@@ -309,9 +312,9 @@
{
fault_reason_str = "Something went wrong";
}
-
- soap_fault = axiom_soap_fault_create_default_fault(env, out_body,
- fault_value_str, fault_reason_str, soap_version);
+
+ soap_fault = axiom_soap_fault_create_default_fault(env, out_body,
+ fault_value_str, fault_reason_str, soap_version);
}
if (body_content_node)
@@ -330,7 +333,7 @@
AXIOM_SOAP_ENVELOPE_FREE(default_envelope, env);
default_envelope = NULL;
}
-
+
return status;
}
@@ -340,8 +343,9 @@
*/
-AXIS2_EXPORT int axis2_get_instance(struct axis2_msg_recv **inst,
- const axis2_env_t *env)
+AXIS2_EXPORT int axis2_get_instance(
+ struct axis2_msg_recv **inst,
+ const axis2_env_t *env)
{
*inst = axis2_raw_xml_in_out_msg_recv_create(env);
if(!(*inst))
@@ -352,8 +356,9 @@
return AXIS2_SUCCESS;
}
-AXIS2_EXPORT int axis2_remove_instance(struct axis2_msg_recv *inst,
- const axis2_env_t *env)
+AXIS2_EXPORT int axis2_remove_instance(
+ struct axis2_msg_recv *inst,
+ const axis2_env_t *env)
{
axis2_status_t status = AXIS2_FAILURE;
if (inst)
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org