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 sa...@apache.org on 2006/04/18 06:33:27 UTC
svn commit: r394835 - in /webservices/axis2/trunk/c: include/
modules/core/context/ modules/core/engine/ modules/core/transport/http/
modules/mod_addr/ modules/xml/soap/ test/itest/whitemesa/round1/
test/itest/whitemesa/round2/ test/xml/soap/
Author: samisa
Date: Mon Apr 17 21:33:24 2006
New Revision: 394835
URL: http://svn.apache.org/viewcvs?rev=394835&view=rev
Log:
Adding more fixes related to the fault model.
These shortcommings in the fault model were revealed when working on addressing interop.
Modified:
webservices/axis2/trunk/c/include/axis2_msg_ctx.h
webservices/axis2/trunk/c/include/axis2_soap_envelope.h
webservices/axis2/trunk/c/modules/core/context/msg_ctx.c
webservices/axis2/trunk/c/modules/core/engine/conf.c
webservices/axis2/trunk/c/modules/core/engine/engine.c
webservices/axis2/trunk/c/modules/core/transport/http/http_transport_utils.c
webservices/axis2/trunk/c/modules/core/transport/http/http_worker.c
webservices/axis2/trunk/c/modules/mod_addr/addr_in_handler.c
webservices/axis2/trunk/c/modules/mod_addr/addr_out_handler.c
webservices/axis2/trunk/c/modules/xml/soap/soap_envelope.c
webservices/axis2/trunk/c/test/itest/whitemesa/round1/round1_client.c
webservices/axis2/trunk/c/test/itest/whitemesa/round2/round2_client.c
webservices/axis2/trunk/c/test/xml/soap/test_soap.c
Modified: webservices/axis2/trunk/c/include/axis2_msg_ctx.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_msg_ctx.h?rev=394835&r1=394834&r2=394835&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_msg_ctx.h (original)
+++ webservices/axis2/trunk/c/include/axis2_msg_ctx.h Mon Apr 17 21:33:24 2006
@@ -141,6 +141,10 @@
get_soap_envelope)(struct axis2_msg_ctx *msg_ctx,
axis2_env_t **env);
+ struct axis2_soap_envelope* (AXIS2_CALL *
+ get_fault_soap_envelope)(struct axis2_msg_ctx *msg_ctx,
+ axis2_env_t **env);
+
/**
* @return
*/
@@ -219,7 +223,12 @@
* @param soap_envelope
*/
axis2_status_t (AXIS2_CALL *
- set_envelope)(struct axis2_msg_ctx *msg_ctx,
+ set_soap_envelope)(struct axis2_msg_ctx *msg_ctx,
+ axis2_env_t **env,
+ struct axis2_soap_envelope *soap_envelope);
+
+ axis2_status_t (AXIS2_CALL *
+ set_fault_soap_envelope)(struct axis2_msg_ctx *msg_ctx,
axis2_env_t **env,
struct axis2_soap_envelope *soap_envelope);
@@ -713,6 +722,9 @@
#define AXIS2_MSG_CTX_GET_SOAP_ENVELOPE(msg_ctx, env) \
((msg_ctx)->ops->get_soap_envelope(msg_ctx, env))
+#define AXIS2_MSG_CTX_GET_FAULT_SOAP_ENVELOPE(msg_ctx, env) \
+ ((msg_ctx)->ops->get_fault_soap_envelope(msg_ctx, env))
+
#define AXIS2_MSG_CTX_GET_MSG_ID(msg_ctx, env) \
((msg_ctx)->ops->get_msg_id(msg_ctx, env))
@@ -744,7 +756,10 @@
((msg_ctx)->ops->get_in_fault_flow(msg_ctx, env, in_fault_flow))
#define AXIS2_MSG_CTX_SET_SOAP_ENVELOPE(msg_ctx, env, soap_envelope) \
- ((msg_ctx)->ops->set_envelope(msg_ctx, env, soap_envelope))
+ ((msg_ctx)->ops->set_soap_envelope(msg_ctx, env, soap_envelope))
+
+#define AXIS2_MSG_CTX_SET_FAULT_SOAP_ENVELOPE(msg_ctx, env, soap_envelope) \
+ ((msg_ctx)->ops->set_fault_soap_envelope(msg_ctx, env, soap_envelope))
#define AXIS2_MSG_CTX_SET_MESSAGE_ID(msg_ctx, env, message_id) \
((msg_ctx)->ops->set_message_id(msg_ctx, env, message_id))
Modified: webservices/axis2/trunk/c/include/axis2_soap_envelope.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_soap_envelope.h?rev=394835&r1=394834&r2=394835&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_soap_envelope.h (original)
+++ webservices/axis2/trunk/c/include/axis2_soap_envelope.h Mon Apr 17 21:33:24 2006
@@ -26,6 +26,7 @@
#include <axis2_om_node.h>
#include <axis2_om_element.h>
#include <axis2_om_namespace.h>
+#include <axis2_array_list.h>
#ifdef __cplusplus
extern "C"
@@ -164,7 +165,9 @@
AXIS2_DECLARE(axis2_soap_envelope_t *)
axis2_soap_envelope_create_default_soap_fault_envelope(axis2_env_t **env,
- axis2_char_t *code_value, axis2_char_t *reason_text, int soap_version);
+ axis2_char_t *code_value, axis2_char_t *reason_text, int soap_version,
+ axis2_array_list_t *sub_codes,
+ axis2_om_node_t *detail_node);
/******************** Macros **************************************************/
Modified: webservices/axis2/trunk/c/modules/core/context/msg_ctx.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/context/msg_ctx.c?rev=394835&r1=394834&r2=394835&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/context/msg_ctx.c (original)
+++ webservices/axis2/trunk/c/modules/core/context/msg_ctx.c Mon Apr 17 21:33:24 2006
@@ -66,6 +66,8 @@
/** SOAP envelope */
axis2_soap_envelope_t *soap_envelope;
+ /** SOAP Fault envelope */
+ axis2_soap_envelope_t *fault_soap_envelope;
/** response written? */
axis2_bool_t response_written;
/** in fault flow? */
@@ -144,6 +146,9 @@
axis2_soap_envelope_t* AXIS2_CALL
axis2_msg_ctx_get_soap_envelope(struct axis2_msg_ctx *msg_ctx,
axis2_env_t **env);
+axis2_soap_envelope_t* AXIS2_CALL
+axis2_msg_ctx_get_fault_soap_envelope(struct axis2_msg_ctx *msg_ctx,
+ axis2_env_t **env);
axis2_char_t* AXIS2_CALL
axis2_msg_ctx_get_msg_id(struct axis2_msg_ctx *msg_ctx,
axis2_env_t **env);
@@ -179,7 +184,11 @@
axis2_env_t **env,
axis2_bool_t in_fault_flow);
axis2_status_t AXIS2_CALL
-axis2_msg_ctx_set_envelope(struct axis2_msg_ctx *msg_ctx,
+axis2_msg_ctx_set_soap_envelope(struct axis2_msg_ctx *msg_ctx,
+ axis2_env_t **env,
+ axis2_soap_envelope_t *soap_envelope);
+axis2_status_t AXIS2_CALL
+axis2_msg_ctx_set_fault_soap_envelope(struct axis2_msg_ctx *msg_ctx,
axis2_env_t **env,
axis2_soap_envelope_t *soap_envelope);
axis2_status_t AXIS2_CALL
@@ -432,6 +441,7 @@
msg_ctx_impl->transport_in_desc = NULL;
msg_ctx_impl->transport_out_desc = NULL;
msg_ctx_impl->soap_envelope = NULL;
+ msg_ctx_impl->fault_soap_envelope = NULL;
msg_ctx_impl->response_written = AXIS2_FALSE;
msg_ctx_impl->in_fault_flow = AXIS2_FALSE;
msg_ctx_impl->server_side = AXIS2_FALSE;
@@ -498,6 +508,7 @@
msg_ctx_impl->msg_ctx.ops->get_from = axis2_msg_ctx_get_from;
msg_ctx_impl->msg_ctx.ops->get_in_fault_flow = axis2_msg_ctx_get_in_fault_flow;
msg_ctx_impl->msg_ctx.ops->get_soap_envelope = axis2_msg_ctx_get_soap_envelope;
+ msg_ctx_impl->msg_ctx.ops->get_fault_soap_envelope = axis2_msg_ctx_get_fault_soap_envelope;
msg_ctx_impl->msg_ctx.ops->get_msg_id = axis2_msg_ctx_get_msg_id;
msg_ctx_impl->msg_ctx.ops->get_process_fault = axis2_msg_ctx_get_process_fault;
msg_ctx_impl->msg_ctx.ops->get_relates_to = axis2_msg_ctx_get_relates_to;
@@ -508,7 +519,8 @@
msg_ctx_impl->msg_ctx.ops->set_fault_to = axis2_msg_ctx_set_fault_to;
msg_ctx_impl->msg_ctx.ops->set_from = axis2_msg_ctx_set_from;
msg_ctx_impl->msg_ctx.ops->set_in_fault_flow = axis2_msg_ctx_set_in_fault_flow;
- msg_ctx_impl->msg_ctx.ops->set_envelope = axis2_msg_ctx_set_envelope;
+ msg_ctx_impl->msg_ctx.ops->set_soap_envelope = axis2_msg_ctx_set_soap_envelope;
+ msg_ctx_impl->msg_ctx.ops->set_fault_soap_envelope = axis2_msg_ctx_set_fault_soap_envelope;
msg_ctx_impl->msg_ctx.ops->set_message_id = axis2_msg_ctx_set_message_id;
msg_ctx_impl->msg_ctx.ops->set_process_fault = axis2_msg_ctx_set_process_fault;
msg_ctx_impl->msg_ctx.ops->set_relates_to = axis2_msg_ctx_set_relates_to;
@@ -673,6 +685,12 @@
msg_ctx_impl->soap_envelope = NULL;
}
+ if (msg_ctx_impl->fault_soap_envelope)
+ {
+ AXIS2_SOAP_ENVELOPE_FREE(msg_ctx_impl->fault_soap_envelope, env);
+ msg_ctx_impl->fault_soap_envelope = NULL;
+ }
+
AXIS2_FREE((*env)->allocator, msg_ctx_impl);
return AXIS2_SUCCESS;
@@ -774,6 +792,13 @@
return AXIS2_INTF_TO_IMPL(msg_ctx)->soap_envelope;
}
+axis2_soap_envelope_t* AXIS2_CALL axis2_msg_ctx_get_fault_soap_envelope(struct axis2_msg_ctx *msg_ctx,
+ axis2_env_t **env)
+{
+ AXIS2_ENV_CHECK(env, NULL);
+ return AXIS2_INTF_TO_IMPL(msg_ctx)->fault_soap_envelope;
+}
+
axis2_char_t *AXIS2_CALL axis2_msg_ctx_get_msg_id(struct axis2_msg_ctx *msg_ctx,
axis2_env_t **env)
{
@@ -909,7 +934,7 @@
return AXIS2_SUCCESS;
}
-axis2_status_t AXIS2_CALL axis2_msg_ctx_set_envelope(struct axis2_msg_ctx *msg_ctx,
+axis2_status_t AXIS2_CALL axis2_msg_ctx_set_soap_envelope(struct axis2_msg_ctx *msg_ctx,
axis2_env_t **env, axis2_soap_envelope_t *soap_envelope)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
@@ -945,6 +970,14 @@
else
AXIS2_INTF_TO_IMPL(msg_ctx)->soap_envelope = NULL;
+ return AXIS2_SUCCESS;
+}
+
+axis2_status_t AXIS2_CALL axis2_msg_ctx_set_fault_soap_envelope(struct axis2_msg_ctx *msg_ctx,
+ axis2_env_t **env, axis2_soap_envelope_t *soap_envelope)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_INTF_TO_IMPL(msg_ctx)->fault_soap_envelope = soap_envelope ;
return AXIS2_SUCCESS;
}
Modified: webservices/axis2/trunk/c/modules/core/engine/conf.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/engine/conf.c?rev=394835&r1=394834&r2=394835&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/engine/conf.c (original)
+++ webservices/axis2/trunk/c/modules/core/engine/conf.c Mon Apr 17 21:33:24 2006
@@ -1478,6 +1478,7 @@
config_impl->phases_info = NULL;
}
config_impl->phases_info = phases_info;
+ config_impl->out_faultphases = AXIS2_PHASES_INFO_GET_OUT_FAULTPHASES(phases_info, env);
return AXIS2_SUCCESS;
}
Modified: webservices/axis2/trunk/c/modules/core/engine/engine.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/engine/engine.c?rev=394835&r1=394834&r2=394835&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/engine/engine.c (original)
+++ webservices/axis2/trunk/c/modules/core/engine/engine.c Mon Apr 17 21:33:24 2006
@@ -18,6 +18,9 @@
#include <axis2.h>
#include <axis2_hash.h>
#include <axis2_soap.h>
+#include <axis2_soap_envelope.h>
+#include <axis2_soap_body.h>
+#include <axis2_soap_fault.h>
#include <axis2_transport_sender.h>
#include <axis2_http_transport.h>
@@ -450,11 +453,27 @@
if (!(AXIS2_MSG_CTX_IS_PAUSED(msg_ctx, env)))
{
/* send the SOAP Fault*/
+ axis2_conf_ctx_t *conf_ctx = NULL;
axis2_transport_sender_t *transport_sender = NULL;
+
+ /*conf_ctx = AXIS2_MSG_CTX_GET_CONF_CTX(msg_ctx, env);
+ if (conf_ctx)
+ {
+ axis2_conf_t *conf = AXIS2_CONF_CTX_GET_CONF(conf_ctx, env);
+ if (conf)
+ {
+ axis2_array_list_t *phases = AXIS2_CONF_GET_OUT_FAULT_FLOW(conf, env);
+ if (phases)
+ {
+ axis2_engine_invoke_phases(engine, env, phases, msg_ctx);
+ }
+ }
+ }*/
+
axis2_transport_out_desc_t *transport_out = AXIS2_MSG_CTX_GET_TRANSPORT_OUT_DESC(msg_ctx, env);
+
if (transport_out)
transport_sender = AXIS2_TRANSPORT_OUT_DESC_GET_SENDER(transport_out, env);
- /*TODO:Uncomment this once the implementation done*/
if (transport_sender)
AXIS2_TRANSPORT_SENDER_INVOKE(transport_sender, env, msg_ctx);
}
@@ -541,6 +560,7 @@
axis2_engine_impl_t *engine_impl = NULL;
axis2_endpoint_ref_t *fault_to = NULL;
axis2_property_t *property = NULL;
+ axis2_soap_envelope_t *envelope = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK((*env)->error, processing_context, AXIS2_FAILURE);
@@ -568,11 +588,11 @@
else
{
property = AXIS2_MSG_CTX_GET_PROPERTY(processing_context, env,
- AXIS2_TRANSPORT_OUT, AXIS2_TRUE);
+ AXIS2_TRANSPORT_OUT, AXIS2_FALSE);
if(property)
{
AXIS2_MSG_CTX_SET_PROPERTY(fault_ctx, env, AXIS2_TRANSPORT_OUT, property,
- AXIS2_TRUE);
+ AXIS2_FALSE);
property = NULL;
}
else
@@ -587,44 +607,47 @@
AXIS2_MSG_CTX_SET_SERVER_SIDE(fault_ctx, env, AXIS2_TRUE);
property = AXIS2_MSG_CTX_GET_PROPERTY(processing_context, env,
- AXIS2_HTTP_OUT_TRANSPORT_INFO, AXIS2_TRUE);
+ AXIS2_HTTP_OUT_TRANSPORT_INFO, AXIS2_FALSE);
if(property)
{
AXIS2_MSG_CTX_SET_PROPERTY(fault_ctx, env, AXIS2_HTTP_OUT_TRANSPORT_INFO,
- property , AXIS2_TRUE );
+ property , AXIS2_FALSE);
property = NULL;
}
-
- /*axis2_soap_envelope_t *envelope = NULL;
- if (AXIS2_MSG_CTX_GET_IS_SOAP_11(processing_context, env))
- {
- envelope = axis2_create_default_fault_soap_envelope(env, AXIS2_SOAP_11);
-
- }
- else
- {
- envelope = axis2_create_default_fault_soap_envilope(env, AXIS2_SOAP_12);
- }
- if (envelope)
+ envelope = AXIS2_MSG_CTX_GET_FAULT_SOAP_ENVELOPE(processing_context, env);
+
+ if (!envelope)
{
- axis2_soap_body_t *body = AXIS2_SOAP_ENVELOPE_GET_BODY(envelope, env);
- if (body)
+ if (AXIS2_MSG_CTX_GET_IS_SOAP_11(processing_context, env))
{
- axis2_soap_fault_t *fault = AXIS2_SOAP_BODY_GET_FAULT(body, env);
+ envelope = axis2_soap_envelope_create_default_soap_envelope(env, AXIS2_SOAP11);
+ }
+ else
+ {
+ envelope = axis2_soap_envelope_create_default_soap_envelope(env, AXIS2_SOAP12);
}
- extract_fault_info_from_msg_ctx( engine, env,
- processing_context,fault);
- }
- else
- {
- return NULL;
- }
- AXIS2_MSG_CTX_SET_ENVELOPE(fault_ctx, env, envelope);
+ if (envelope)
+ {
+ axis2_soap_body_t *body = AXIS2_SOAP_ENVELOPE_GET_BODY(envelope, env);
+ if (body)
+ {
+ axis2_soap_fault_t *fault = AXIS2_SOAP_BODY_GET_FAULT(body, env);
+ axis2_engine_extract_fault_info_from_msg_ctx(engine, env,
+ processing_context, fault);
+ }
+ }
+ else
+ {
+ return NULL;
+ }
+ }
+
+ AXIS2_MSG_CTX_SET_SOAP_ENVELOPE(fault_ctx, env, envelope);
AXIS2_MSG_CTX_SET_PROPERTY(fault_ctx, env, AXIS2_HTTP_OUT_TRANSPORT_INFO,
- AXIS2_MSG_CTX_GET_PROPERTY(processing_context, env, AXIS2_HTTP_OUT_TRANSPORT_INFO, AXIS2_TRUE) );*/
+ AXIS2_MSG_CTX_GET_PROPERTY(processing_context, env, AXIS2_HTTP_OUT_TRANSPORT_INFO, AXIS2_FALSE), AXIS2_FALSE);
return fault_ctx;
}
Modified: webservices/axis2/trunk/c/modules/core/transport/http/http_transport_utils.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/transport/http/http_transport_utils.c?rev=394835&r1=394834&r2=394835&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/http_transport_utils.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/http_transport_utils.c Mon Apr 17 21:33:24 2006
@@ -120,6 +120,7 @@
axis2_engine_t *engine = NULL;
axis2_soap_body_t *soap_body = NULL;
axis2_property_t *property = NULL;
+ axis2_status_t status = AXIS2_FAILURE;
AXIS2_PARAM_CHECK((*env)->error, msg_ctx, AXIS2_FAILURE);
AXIS2_PARAM_CHECK((*env)->error, in_stream, AXIS2_FAILURE);
@@ -174,7 +175,7 @@
{
AXIS2_LOG_ERROR((*env)->log, AXIS2_LOG_SI, "Error occured in"
" creating in chunked stream.");
- return AXIS2_FALSE;
+ return AXIS2_FAILURE;
}
AXIS2_LOG_DEBUG((*env)->log, AXIS2_LOG_SI, "HTTP"
" stream chunked");
@@ -329,7 +330,7 @@
}
else
{
- AXIS2_ENGINE_RECEIVE(engine, env, msg_ctx);
+ status = AXIS2_ENGINE_RECEIVE(engine, env, msg_ctx);
}
if(NULL == AXIS2_MSG_CTX_GET_SOAP_ENVELOPE(msg_ctx, env) &&
AXIS2_FALSE == is_soap11)
@@ -342,7 +343,7 @@
{
AXIS2_ENGINE_FREE(engine, env);
}
- return AXIS2_SUCCESS;
+ return status;
}
Modified: webservices/axis2/trunk/c/modules/core/transport/http/http_worker.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/transport/http/http_worker.c?rev=394835&r1=394834&r2=394835&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/http_worker.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/http_worker.c Mon Apr 17 21:33:24 2006
@@ -365,6 +365,10 @@
tmp_stat_line = axis2_http_status_line_create(env,
status_line_str);
AXIS2_ENGINE_SEND_FAULT(engine, env, fault_ctx);
+ AXIS2_HTTP_SIMPLE_RESPONSE_SET_STATUS_LINE(response, env,
+ AXIS2_HTTP_STATUS_LINE_GET_HTTP_VERSION(tmp_stat_line, env),
+ AXIS2_HTTP_STATUS_LINE_GET_STATUS_CODE(tmp_stat_line, env) ,
+ AXIS2_HTTP_STATUS_LINE_GET_REASON_PHRASE(tmp_stat_line, env));
AXIS2_HTTP_SIMPLE_RESPONSE_SET_BODY_STREAM(response, env,
out_stream);
axis2_http_worker_set_response_headers(http_worker, env, svr_conn,
Modified: webservices/axis2/trunk/c/modules/mod_addr/addr_in_handler.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/mod_addr/addr_in_handler.c?rev=394835&r1=394834&r2=394835&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/mod_addr/addr_in_handler.c (original)
+++ webservices/axis2/trunk/c/modules/mod_addr/addr_in_handler.c Mon Apr 17 21:33:24 2006
@@ -18,6 +18,7 @@
#include <axis2_addr.h>
#include <axis2_handler_desc.h>
#include <axis2_array_list.h>
+#include <axis2_soap.h>
#include <axis2_soap_envelope.h>
#include <axis2_soap_header.h>
#include <axis2_soap_header_block.h>
@@ -49,7 +50,8 @@
axis2_addr_in_extract_addr_final_info(axis2_env_t **env,
axis2_soap_header_t *soap_header,
axis2_msg_info_headers_t **msg_info_headers,
- axis2_array_list_t *addr_headers);
+ axis2_array_list_t *addr_headers,
+ axis2_msg_ctx_t *msg_ctx);
axis2_status_t
@@ -69,12 +71,20 @@
axis2_soap_header_t *soap_header,
axis2_msg_info_headers_t **msg_info_headers,
axis2_array_list_t *addr_headers,
- axis2_char_t *addr_ns);
+ axis2_char_t *addr_ns,
+ axis2_msg_ctx_t *msg_ctx);
axis2_status_t axis2_addr_in_extract_addr_submission_info(axis2_env_t **env,
axis2_soap_header_t *soap_header,
axis2_msg_info_headers_t **msg_info_headers,
- axis2_array_list_t *addr_headers);
+ axis2_array_list_t *addr_headers,
+ axis2_msg_ctx_t *msg_ctx);
+
+axis2_soap_envelope_t *
+axis2_addr_in_create_fault_envelope(axis2_env_t **env,
+ axis2_char_t *header_name,
+ axis2_char_t *addr_ns_str,
+ int soap_version);
/******************************************************************************/
@@ -110,6 +120,7 @@
axis2_soap_envelope_t *soap_envelope = NULL;
axis2_soap_header_t *soap_header = NULL;
axis2_property_t *property = NULL;
+ axis2_status_t status = AXIS2_FAILURE;
AXIS2_ENV_CHECK( env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK((*env)->error, msg_ctx, AXIS2_FAILURE);
@@ -135,10 +146,11 @@
if (addr_headers)
{
addr_ns_str = AXIS2_STRDUP(AXIS2_WSA_NAMESPACE_SUBMISSION, env);
- axis2_addr_in_extract_addr_submission_info(env,
+ status = axis2_addr_in_extract_addr_submission_info(env,
soap_header,
&msg_info_headers,
- addr_headers);
+ addr_headers,
+ msg_ctx);
}
else
{
@@ -146,10 +158,11 @@
if (addr_headers)
{
addr_ns_str = AXIS2_STRDUP(AXIS2_WSA_NAMESPACE, env);
- axis2_addr_in_extract_addr_final_info(env,
+ status = axis2_addr_in_extract_addr_final_info(env,
soap_header,
&msg_info_headers,
- addr_headers);
+ addr_headers,
+ msg_ctx);
axis2_addr_in_extract_ref_params(env, soap_header, AXIS2_MSG_CTX_GET_MSG_INFO_HEADERS(msg_ctx, env));
}
@@ -178,7 +191,7 @@
axis2_addr_in_extract_svc_grp_ctx_id(env, soap_header, msg_ctx);
AXIS2_ARRAY_LIST_FREE(addr_headers, env);
- return AXIS2_SUCCESS;
+ return status;
}
}
@@ -238,25 +251,29 @@
axis2_addr_in_extract_addr_final_info(axis2_env_t **env,
axis2_soap_header_t *soap_header,
axis2_msg_info_headers_t **msg_info_headers,
- axis2_array_list_t *addr_headers)
+ axis2_array_list_t *addr_headers,
+ axis2_msg_ctx_t *msg_ctx)
{
return axis2_addr_in_extract_addr_params(env,
soap_header,
msg_info_headers,
addr_headers,
- AXIS2_WSA_NAMESPACE);
+ AXIS2_WSA_NAMESPACE,
+ msg_ctx);
}
axis2_status_t axis2_addr_in_extract_addr_submission_info(axis2_env_t **env,
axis2_soap_header_t *soap_header,
axis2_msg_info_headers_t **msg_info_headers,
- axis2_array_list_t *addr_headers)
+ axis2_array_list_t *addr_headers,
+ axis2_msg_ctx_t *msg_ctx)
{
return axis2_addr_in_extract_addr_params(env,
soap_header,
msg_info_headers,
addr_headers,
- AXIS2_WSA_NAMESPACE_SUBMISSION);
+ AXIS2_WSA_NAMESPACE_SUBMISSION,
+ msg_ctx);
}
axis2_status_t
@@ -264,11 +281,13 @@
axis2_soap_header_t *soap_header,
axis2_msg_info_headers_t **msg_info_headers_p,
axis2_array_list_t *addr_headers,
- axis2_char_t *addr_ns_str)
+ axis2_char_t *addr_ns_str,
+ axis2_msg_ctx_t *msg_ctx)
{
axis2_hash_t *header_block_ht = NULL;
axis2_hash_index_t *hash_index = NULL;
axis2_msg_info_headers_t *msg_info_headers = *(msg_info_headers_p);
+ axis2_bool_t to_found = AXIS2_FALSE;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK((*env)->error, soap_header, AXIS2_FAILURE);
@@ -309,10 +328,25 @@
/* here the addressing epr overidde what ever already there in the message context */
epr = axis2_endpoint_ref_create(env, AXIS2_OM_ELEMENT_GET_TEXT(header_block_ele, env, header_block_node));
+ if (to_found == AXIS2_TRUE)
+ {
+ /* Duplicate To */
+ int soap_version = AXIS2_SOAP12;
+ axis2_soap_envelope_t *envelope = NULL;
+ if (AXIS2_MSG_CTX_GET_IS_SOAP_11(msg_ctx, env))
+ {
+ soap_version = AXIS2_SOAP11;
+ }
+ envelope = axis2_addr_in_create_fault_envelope(env,
+ "wsa:To", addr_ns_str, soap_version);
+ AXIS2_MSG_CTX_SET_FAULT_SOAP_ENVELOPE(msg_ctx, env, envelope);
+ return AXIS2_FAILURE;
+ }
AXIS2_MSG_INFO_HEADERS_SET_TO(msg_info_headers, env, epr);
axis2_addr_in_extract_to_epr_ref_params(env, epr, soap_header, addr_ns_str);
AXIS2_SOAP_HEADER_BLOCK_SET_PRECESSED(header_block, env);
+ to_found = AXIS2_TRUE;
}
else if(AXIS2_STRCMP(ele_localname, AXIS2_WSA_FROM) == 0)
{
@@ -648,3 +682,34 @@
return ((AXIS2_STRCMP(exp_qn_lpart, act_qn_lpart) == 0) &&
(AXIS2_STRCMP(exp_qn_nsuri,act_qn_nsuri) == 0));
}
+
+axis2_soap_envelope_t *
+axis2_addr_in_create_fault_envelope(axis2_env_t **env,
+ axis2_char_t *header_name,
+ axis2_char_t *addr_ns_str,
+ int soap_version)
+{
+ axis2_soap_envelope_t *envelope = NULL;
+ axis2_array_list_t *sub_codes = NULL;
+
+ axis2_om_node_t* text_om_node = NULL;
+ axis2_om_element_t * text_om_ele = NULL;
+ axis2_om_namespace_t *ns1 = NULL;
+ ns1 = axis2_om_namespace_create (env, addr_ns_str, "wsa");
+ text_om_ele = axis2_om_element_create(env, NULL, "ProblemHeaderQName", ns1, &text_om_node);
+ AXIS2_OM_ELEMENT_SET_TEXT(text_om_ele, env, header_name, text_om_node);
+
+ sub_codes = axis2_array_list_create(env, 2);
+ if (sub_codes)
+ {
+ AXIS2_ARRAY_LIST_ADD(sub_codes, env, "wsa:InvalidAddressingHeader");
+ AXIS2_ARRAY_LIST_ADD(sub_codes, env, "wsa:InvalidCardinality");
+ }
+
+ envelope = axis2_soap_envelope_create_default_soap_fault_envelope(env,
+ "soapenv:Sender",
+ "A header representing a Message Addressing Property is not valid and the message cannot be processed",
+ soap_version, sub_codes, text_om_node);
+ return envelope;
+}
+
Modified: webservices/axis2/trunk/c/modules/mod_addr/addr_out_handler.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/mod_addr/addr_out_handler.c?rev=394835&r1=394834&r2=394835&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/mod_addr/addr_out_handler.c (original)
+++ webservices/axis2/trunk/c/modules/mod_addr/addr_out_handler.c Mon Apr 17 21:33:24 2006
@@ -18,6 +18,7 @@
#include <axis2_qname.h>
#include <axis2_svc.h>
#include <axis2_soap_header.h>
+#include <axis2_soap_body.h>
#include <axis2_addr.h>
#include <axis2_soap_header_block.h>
#include <axis2_endpoint_ref.h>
@@ -244,10 +245,25 @@
soap_header_node, addressing_namespace);
epr = AXIS2_MSG_INFO_HEADERS_GET_TO (msg_info_headers, env);
+
+ if (soap_envelope && epr)
+ {
+ axis2_soap_body_t *body = AXIS2_SOAP_ENVELOPE_GET_BODY(soap_envelope, env);
+ if (body)
+ {
+ /* in case of a SOAP fault, we got to send the response to
+ the adress specified by FaultTo */
+ if (AXIS2_SOAP_BODY_HAS_FAULT( body, env))
+ {
+ axis2_endpoint_ref_t *fault_epr = AXIS2_MSG_INFO_HEADERS_GET_FAULT_TO (msg_info_headers, env);
+ if (fault_epr)
+ {
+ AXIS2_ENDPOINT_REF_SET_ADDRESS (epr, env, AXIS2_ENDPOINT_REF_GET_ADDRESS (fault_epr, env));
+ }
+ }
+ }
+ }
-
-
-
if (epr)
{
address = AXIS2_ENDPOINT_REF_GET_ADDRESS (epr, env);
Modified: webservices/axis2/trunk/c/modules/xml/soap/soap_envelope.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/soap/soap_envelope.c?rev=394835&r1=394834&r2=394835&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/soap/soap_envelope.c (original)
+++ webservices/axis2/trunk/c/modules/xml/soap/soap_envelope.c Mon Apr 17 21:33:24 2006
@@ -725,7 +725,9 @@
AXIS2_DECLARE(axis2_soap_envelope_t *)
axis2_soap_envelope_create_default_soap_fault_envelope(axis2_env_t **env,
- axis2_char_t *code_value, axis2_char_t *reason_text, int soap_version)
+ axis2_char_t *code_value, axis2_char_t *reason_text, int soap_version,
+ axis2_array_list_t *sub_codes,
+ axis2_om_node_t *detail_node)
{
axis2_soap_envelope_t *soap_env = NULL;
axis2_soap_body_t *soap_body = NULL;
@@ -771,6 +773,35 @@
AXIS2_SOAP_ENVELOPE_FREE(soap_env, env);
return NULL;
}
+
+ if (sub_codes)
+ {
+ int i = 0;
+ axis2_soap_fault_code_t *fault_code = NULL;
+ fault_code = AXIS2_SOAP_FAULT_GET_CODE(fault, env);
+ if (fault_code)
+ {
+ for ( i = 0; i < AXIS2_ARRAY_LIST_SIZE(sub_codes, env); i++)
+ {
+ axis2_char_t *sub_code = (axis2_char_t*) AXIS2_ARRAY_LIST_GET(sub_codes, env, i);
+ if (sub_code)
+ {
+ axis2_soap_fault_sub_code_create_with_parent_value(env, fault_code, sub_code);
+ }
+ }
+ }
+ }
+
+ if (detail_node)
+ {
+ axis2_soap_fault_detail_t *detail =
+ axis2_soap_fault_detail_create_with_parent(env, fault);
+ if (detail)
+ {
+ AXIS2_SOAP_FAULT_DETAIL_ADD_DETAIL_ENTRY(detail, env, detail_node);
+ }
+ }
+
return soap_env;
}
Modified: webservices/axis2/trunk/c/test/itest/whitemesa/round1/round1_client.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/test/itest/whitemesa/round1/round1_client.c?rev=394835&r1=394834&r2=394835&view=diff
==============================================================================
--- webservices/axis2/trunk/c/test/itest/whitemesa/round1/round1_client.c (original)
+++ webservices/axis2/trunk/c/test/itest/whitemesa/round1/round1_client.c Mon Apr 17 21:33:24 2006
@@ -329,7 +329,7 @@
ns5);
AXIS2_OM_ELEMENT_DECLARE_NAMESPACE (envelope_element, env, envelope_node,
ns6);
- ns0 = AXIS2_OM_ELEMENT_GET_NAMESPACE (envelope_element, env);
+ ns0 = AXIS2_OM_ELEMENT_GET_NAMESPACE (envelope_element, env, envelope_node);
attri1 =
axis2_om_attribute_create (env, "encodingStyle",
"http://schemas.xmlsoap.org/soap/encoding/",
Modified: webservices/axis2/trunk/c/test/itest/whitemesa/round2/round2_client.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/test/itest/whitemesa/round2/round2_client.c?rev=394835&r1=394834&r2=394835&view=diff
==============================================================================
--- webservices/axis2/trunk/c/test/itest/whitemesa/round2/round2_client.c (original)
+++ webservices/axis2/trunk/c/test/itest/whitemesa/round2/round2_client.c Mon Apr 17 21:33:24 2006
@@ -279,7 +279,7 @@
AXIS2_OM_ELEMENT_DECLARE_NAMESPACE(envelope_element, env, envelope_node, ns4);
AXIS2_OM_ELEMENT_DECLARE_NAMESPACE(envelope_element, env, envelope_node, ns5);
AXIS2_OM_ELEMENT_DECLARE_NAMESPACE(envelope_element, env, envelope_node, ns6);
- ns0 = AXIS2_OM_ELEMENT_GET_NAMESPACE(envelope_element, env);
+ ns0 = AXIS2_OM_ELEMENT_GET_NAMESPACE(envelope_element, env, envelope_node);
attri1 = axis2_om_attribute_create (env, "encodingStyle", "http://schemas.xmlsoap.org/soap/encoding/", ns0);
body_om_ele = AXIS2_OM_NODE_GET_DATA_ELEMENT( body_node, env );
Modified: webservices/axis2/trunk/c/test/xml/soap/test_soap.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/test/xml/soap/test_soap.c?rev=394835&r1=394834&r2=394835&view=diff
==============================================================================
--- webservices/axis2/trunk/c/test/xml/soap/test_soap.c (original)
+++ webservices/axis2/trunk/c/test/xml/soap/test_soap.c Mon Apr 17 21:33:24 2006
@@ -308,7 +308,10 @@
axis2_om_output_t *om_output = NULL;
axis2_char_t *buffer = NULL;
- soap_envelope = axis2_soap_envelope_create_default_soap_fault_envelope(env, "Fault Code", "Fault Reason", AXIS2_SOAP11);
+ soap_envelope =
+ axis2_soap_envelope_create_default_soap_fault_envelope(env,
+ "Fault Code", "Fault Reason", AXIS2_SOAP11,
+ NULL, NULL);
soap_body = AXIS2_SOAP_ENVELOPE_GET_BODY(soap_envelope, env);
axis2_soap_fault_create_default_fault(env, soap_body, "env:Receiver","A fault occured", AXIS2_SOAP12);
@@ -334,7 +337,8 @@
printf("TEST SOAP FAULT VALUE\n");
soap_envelope = axis2_soap_envelope_create_default_soap_fault_envelope(
- env, "env:Receiver", "Something went wrong!", AXIS2_SOAP12);
+ env, "env:Receiver", "Something went wrong!", AXIS2_SOAP12,
+ NULL, NULL);
soap_body = AXIS2_SOAP_ENVELOPE_GET_BODY(soap_envelope, env);
soap_fault = AXIS2_SOAP_BODY_GET_FAULT(soap_body, env);
soap_code = AXIS2_SOAP_FAULT_GET_CODE(soap_fault, env);