summaryrefslogtreecommitdiffstats
path: root/axiom/src/soap/soap_builder.c
diff options
context:
space:
mode:
authorGravatar shankar2010-04-07 07:20:41 +0000
committerGravatar shankar2010-04-07 07:20:41 +0000
commitda05a0173e5d9b33231745471c5d6ae4def5c9c3 (patch)
tree971d3e24adf4450a3137a1987cda4675355105d0 /axiom/src/soap/soap_builder.c
parent2a417ee2eed32bec5891afe14ec8be558ae46ad7 (diff)
downloadaxis2c-da05a0173e5d9b33231745471c5d6ae4def5c9c3.tar.gz
axis2c-da05a0173e5d9b33231745471c5d6ae4def5c9c3.tar.bz2
Fixing issue AXIS2C-1233
git-svn-id: http://svn.apache.org/repos/asf/axis/axis2/c/core/trunk@931454 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'axiom/src/soap/soap_builder.c')
-rw-r--r--axiom/src/soap/soap_builder.c53
1 files changed, 16 insertions, 37 deletions
diff --git a/axiom/src/soap/soap_builder.c b/axiom/src/soap/soap_builder.c
index 2496506..a2e8b23 100644
--- a/axiom/src/soap/soap_builder.c
+++ b/axiom/src/soap/soap_builder.c
@@ -24,16 +24,11 @@
#include "_axiom_soap_body.h"
#include "_axiom_soap_header_block.h"
#include <axiom_stax_builder_internal.h>
+#include "axiom_soap_builder_internal.h"
#include "_axiom_soap_fault.h"
#include <axutil_http_chunked_stream.h>
static axis2_status_t
-axiom_soap_builder_construct_node(
- axiom_soap_builder_t * soap_builder,
- const axutil_env_t * env,
- axiom_node_t * om_element_node);
-
-static axis2_status_t
axiom_soap_builder_identify_soap_version(
axiom_soap_builder_t * soap_builder,
const axutil_env_t * env,
@@ -151,6 +146,7 @@ axiom_soap_builder_create(
soap_builder->soap_version = AXIOM_SOAP12;
soap_builder->last_node_status = -1;
soap_builder->om_builder = stax_builder;
+ axiom_stax_builder_set_soap_builder(stax_builder, env, soap_builder);
soap_builder->done = AXIS2_FALSE;
status = axiom_soap_builder_identify_soap_version(soap_builder, env, soap_version);
@@ -324,37 +320,8 @@ axiom_soap_builder_next(
return AXIS2_FAILURE;
}
- /* Get the status of previous node before building next node. We need the previous state of the
- * node to identify very first element, which is SOAP Envelope. If last_node_status is
- * AXIS2_BUILDER_LAST_NODE_NULL, then it means next node is SOAP Envelope
- */
- if(axiom_stax_builder_get_lastnode(soap_builder->om_builder, env))
- {
- soap_builder->last_node_status = AXIS2_BUILDER_LAST_NODE_NOT_NULL;
- }
- else
- {
- soap_builder->last_node_status = AXIS2_BUILDER_LAST_NODE_NULL;
- }
-
current_event = axiom_stax_builder_next_with_token(soap_builder->om_builder, env);
- if(current_event == AXIOM_XML_READER_START_ELEMENT
- || current_event == AXIOM_XML_READER_EMPTY_ELEMENT)
- {
- axiom_node_t *current_node = axiom_stax_builder_get_lastnode(soap_builder->om_builder, env);
- if(current_node)
- {
- status = axiom_soap_builder_construct_node(soap_builder, env, current_node);
- }
- else
- {
- /* there is an error. So, don't continue building it */
- soap_builder->done = AXIS2_TRUE;
- status = AXIS2_FAILURE;
- AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error occurred when building node");
- }
- }
- else if(current_event == -1)
+ if(current_event == -1)
{
/* there is an error. So, don't continue building it */
soap_builder->done = AXIS2_TRUE;
@@ -381,7 +348,7 @@ axiom_soap_builder_get_document_element(
return document_node;
}
-static axis2_status_t
+axis2_status_t AXIS2_CALL
axiom_soap_builder_construct_node(
axiom_soap_builder_t * soap_builder,
const axutil_env_t * env,
@@ -393,6 +360,18 @@ axiom_soap_builder_construct_node(
int status = AXIS2_SUCCESS;
axiom_node_t *parent = NULL;
+ /* Check whether current node is the very first element, which is SOAP Envelope.
+ * If last_node_status is AXIS2_BUILDER_LAST_NODE_NULL, then it means next node is SOAP Envelope
+ */
+ if(om_element_node == axiom_stax_builder_get_root_node(soap_builder->om_builder, env))
+ {
+ soap_builder->last_node_status = AXIS2_BUILDER_LAST_NODE_NULL;
+ }
+ else
+ {
+ soap_builder->last_node_status = AXIS2_BUILDER_LAST_NODE_NOT_NULL;
+ }
+
/* get OM element struct from node */
om_element = (axiom_element_t *)axiom_node_get_data_element(om_element_node, env);
if(!om_element)