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 na...@apache.org on 2006/01/26 10:11:07 UTC
svn commit: r372489 - in /webservices/axis2/trunk/c: include/
modules/xml/om/ modules/xml/soap/ test/xml/om/ test/xml/soap/
Author: nandika
Date: Thu Jan 26 01:10:47 2006
New Revision: 372489
URL: http://svn.apache.org/viewcvs?rev=372489&view=rev
Log: (empty)
Modified:
webservices/axis2/trunk/c/include/axis2_error.h
webservices/axis2/trunk/c/include/axis2_om_document.h
webservices/axis2/trunk/c/include/axis2_soap_builder.h
webservices/axis2/trunk/c/modules/xml/om/om_document.c
webservices/axis2/trunk/c/modules/xml/om/om_stax_builder.c
webservices/axis2/trunk/c/modules/xml/soap/soap11_builder_helper.c
webservices/axis2/trunk/c/modules/xml/soap/soap_builder.c
webservices/axis2/trunk/c/test/xml/om/test_om.c
webservices/axis2/trunk/c/test/xml/soap/test_soap.c
Modified: webservices/axis2/trunk/c/include/axis2_error.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_error.h?rev=372489&r1=372488&r2=372489&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_error.h (original)
+++ webservices/axis2/trunk/c/include/axis2_error.h Thu Jan 26 01:10:47 2006
@@ -315,7 +315,7 @@
AXIS2_ERROR_INVALID_HTTP_INVALID_HEADER_START_LINE,
/** SOAP envelope or SOAP body NULL */
AXIS2_ERROR_SOAP_ENVELOPE_OR_SOAP_BODY_NULL,
-
+ /* must understatnd attribute should have values of true or false */
AXIS2_ERROR_MUST_UNDERSTAND_SHOULD_BE_1_0_TRUE_FALSE,
AXIS2_ERROR_INVALID_VALUE_FOUND_IN_MUST_UNDERSTAND,
@@ -432,6 +432,8 @@
AXIS2_ERROR_THIS_LOCALNAME_IS_NOT_SUPPORTED_INSIDE_THE_SUB_CODE_ELEMENT,
AXIS2_ERROR_ROLE_ELEMENT_SHOULD_HAVE_A_TEXT,
+
+ AXIS2_ERROR_SOAP11_FAULT_ACTOR_SHOULD_NOT_HAVE_CHILD_ELEMENTS,
/* OM output is NULL */
AXIS2_ERROR_NULL_OM_OUTPUT,
Modified: webservices/axis2/trunk/c/include/axis2_om_document.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_om_document.h?rev=372489&r1=372488&r2=372489&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_om_document.h (original)
+++ webservices/axis2/trunk/c/include/axis2_om_document.h Thu Jan 26 01:10:47 2006
@@ -62,6 +62,14 @@
axis2_status_t (AXIS2_CALL *free) (struct axis2_om_document *document,
axis2_env_t **env);
+ /** Free documents xml tree. When this function is called the entire
+ * xml structure is freed
+ * @param document pointer
+ * @param env environment. Must not be null
+ */
+ axis2_status_t (AXIS2_CALL *free_om_nodes)(struct axis2_om_document *document,
+ axis2_env_t **env);
+
/**
* Builds the next node if the builder is not finished with input xml stream
* @param document document whose next node is to be built. cannot be NULL
@@ -183,6 +191,9 @@
/** serialize opertation */
#define AXIS2_OM_DOCUMENT_SERIALIZE(document, env, om_output) \
((document)->ops->serialize(document, env, om_output))
+
+#define AXIS2_OM_DOCUMENT_FREE_OM_NODES(document, env) \
+ ((document)->ops->free_om_nodes(document, env))
/** @} */
Modified: webservices/axis2/trunk/c/include/axis2_soap_builder.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_soap_builder.h?rev=372489&r1=372488&r2=372489&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_soap_builder.h (original)
+++ webservices/axis2/trunk/c/include/axis2_soap_builder.h Thu Jan 26 01:10:47 2006
@@ -87,7 +87,13 @@
axis2_status_t (AXIS2_CALL *set_element_level)
(axis2_soap_builder_t *builder,
axis2_env_t **env,
- int ele_level);
+ int ele_level);
+
+ axis2_status_t (AXIS2_CALL *process_namespace_data)
+ (axis2_soap_builder_t *builder,
+ axis2_env_t **env,
+ axis2_om_node_t *om_node,
+ axis2_bool_t *is_soap_element);
};
@@ -147,6 +153,10 @@
#define AXIS2_SOAP_BUILDER_SET_ELEMENT_LEVEL(builder, env, ele_level) \
((builder)->ops->set_element_level(builder, env, ele_level))
+
+#define AXIS2_SOAP_BUILDER_PROCESS_NAMESPACE_DATA(builder, env, om_node, is_soap_element) \
+ ((builder)->ops->process_namespace_data(builder, env, om_node, is_soap_element))
+
/** @} */
#ifdef __cplusplus
@@ -156,7 +166,3 @@
#endif /* AXIS2_SOAP_BUILDER_H */
-
-
-
-
Modified: webservices/axis2/trunk/c/modules/xml/om/om_document.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/om_document.c?rev=372489&r1=372488&r2=372489&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/om_document.c (original)
+++ webservices/axis2/trunk/c/modules/xml/om/om_document.c Thu Jan 26 01:10:47 2006
@@ -53,7 +53,10 @@
axis2_om_document_serialize(axis2_om_document_t *document,
axis2_env_t **env,
axis2_om_output_t *om_output);
-
+
+axis2_status_t AXIS2_CALL
+axis2_om_document_free_om_nodes(axis2_om_document_t *document,
+ axis2_env_t **env);
/********************************* end of function pointers ******************/
typedef struct axis2_om_document_impl_t
@@ -152,6 +155,8 @@
document->om_document.ops->build_all = axis2_om_document_build_all;
document->om_document.ops->get_builder = axis2_om_document_get_builder;
document->om_document.ops->serialize = axis2_om_document_serialize;
+ document->om_document.ops->free_om_nodes = axis2_om_document_free_om_nodes;
+
if (builder)
AXIS2_OM_STAX_BUILDER_SET_DOCUMENT (builder, env, &(document->om_document) );
@@ -172,7 +177,7 @@
if (document->xml_version)
AXIS2_FREE((*env)->allocator, document->xml_version);
- AXIS2_OM_NODE_FREE_TREE(document->root_element, env);
+ /* AXIS2_OM_NODE_FREE_TREE(document->root_element, env); */
if(document->om_document.ops)
AXIS2_FREE((*env)->allocator, document->om_document.ops);
@@ -333,4 +338,18 @@
axis2_om_document_get_root_element(document, env);
}
return AXIS2_OM_NODE_SERIALIZE(document_impl->root_element, env, om_output);
+}
+
+axis2_status_t AXIS2_CALL
+axis2_om_document_free_om_nodes(axis2_om_document_t *document,
+ axis2_env_t **env)
+{
+ axis2_om_document_impl_t *document_impl = NULL;
+ document_impl = AXIS2_INTF_TO_IMPL(document);
+ if(document_impl->root_element)
+ {
+ AXIS2_OM_NODE_FREE_TREE(document_impl->root_element, env);
+ return AXIS2_SUCCESS;
+ }
+ return AXIS2_FAILURE;
}
Modified: webservices/axis2/trunk/c/modules/xml/om/om_stax_builder.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/om_stax_builder.c?rev=372489&r1=372488&r2=372489&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/om_stax_builder.c (original)
+++ webservices/axis2/trunk/c/modules/xml/om/om_stax_builder.c Thu Jan 26 01:10:47 2006
@@ -778,7 +778,6 @@
AXIS2_FUNC_PARAM_CHECK(builder, env, AXIS2_FAILURE);
builder_impl = AXIS2_INTF_TO_IMPL(builder);
-
if(builder_impl->parser)
{
AXIS2_XML_READER_FREE(builder_impl->parser, env);
@@ -952,4 +951,3 @@
}
return token;
}
-
Modified: webservices/axis2/trunk/c/modules/xml/soap/soap11_builder_helper.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/soap/soap11_builder_helper.c?rev=372489&r1=372488&r2=372489&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/soap/soap11_builder_helper.c (original)
+++ webservices/axis2/trunk/c/modules/xml/soap/soap11_builder_helper.c Thu Jan 26 01:10:47 2006
@@ -239,13 +239,16 @@
}else if(AXIS2_STRCMP(AXIS2_SOAP11_SOAP_FAULT_ACTOR_LOCAL_NAME, ele_localname) == 0)
{
axis2_soap_fault_role_t *fault_role = NULL;
-
+ int status = AXIS2_SUCCESS;
fault_role = axis2_soap_fault_role_create(env);
AXIS2_OM_ELEMENT_SET_LOCALNAME(om_ele, env, AXIS2_SOAP12_SOAP_FAULT_ROLE_LOCAL_NAME);
AXIS2_SOAP_FAULT_ROLE_SET_BASE_NODE(fault_role, env, om_element_node);
AXIS2_SOAP_FAULT_ROLE_SET_SOAP_VRESION(fault_role, env, AXIS2_SOAP11);
AXIS2_SOAP_FAULT_SET_ROLE(soap_fault, env, fault_role);
- /* process namespace data */
+ status = AXIS2_SOAP_BUILDER_PROCESS_NAMESPACE_DATA(
+ builder_helper_impl->soap_builder, env, om_element_node, AXIS2_TRUE);
+ if(status == AXIS2_FAILURE)
+ return AXIS2_FAILURE;
}
else if(AXIS2_STRCMP(AXIS2_SOAP11_SOAP_FAULT_DETAIL_LOCAL_NAME, ele_localname) == 0)
{
@@ -256,65 +259,33 @@
AXIS2_SOAP_FAULT_SET_DETAIL(soap_fault, env, fault_detail);
AXIS2_SOAP_FAULT_SET_SOAP_VERSION(soap_fault, env, AXIS2_SOAP11);
}
- /* else
- {
- return ;
- }
- */
+ else
+ {
+ return AXIS2_SUCCESS;
+ }
}
- /*
else if(element_level == 5)
{
-
-
-
-
-
-
-
-
-
- }
- else if (elementLevel == 5) {
+ axis2_om_node_t *parent_node = NULL;
+ axis2_om_element_t *parent_element = NULL;
+ axis2_char_t *parent_localname = NULL;
- String parentTagName = "";
- if(parent instanceof Element) {
- parentTagName = ((Element)parent).getTagName();
- } else {
- parentTagName = parent.getLocalName();
- }
-
- if (parentTagName.equals(SOAP_FAULT_CODE_LOCAL_NAME)) {
- throw new OMBuilderException(
- "faultcode element should not have children");
- } else if (parentTagName.equals(
- SOAP_FAULT_STRING_LOCAL_NAME)) {
- throw new OMBuilderException(
- "faultstring element should not have children");
- } else if (parentTagName.equals(
- SOAP_FAULT_ACTOR_LOCAL_NAME)) {
- throw new OMBuilderException(
- "faultactor element should not have children");
- } else {
- element =
- this.factory.createOMElement(
- localName, null, parent, builder);
- processNamespaceData(element, false);
- processAttributes(element);
- }
-
- } else if (elementLevel > 5) {
- element =
- this.factory.createOMElement(localName,
- null,
- parent,
- builder);
- processNamespaceData(element, false);
- processAttributes(element);
+ parent_node = AXIS2_OM_NODE_GET_PARENT(om_element_node, env);
+ if(!parent_node)
+ return AXIS2_FAILURE;
+ parent_element = (axis2_om_element_t *)AXIS2_OM_NODE_GET_DATA_ELEMENT(
+ om_element_node, env);
+ parent_localname = AXIS2_OM_ELEMENT_GET_LOCALNAME(parent_element, env);
+
+ if(!parent_localname)
+ return AXIS2_FAILURE;
+ if(AXIS2_STRCMP(parent_localname, AXIS2_ERROR_SOAP_FAULT_ROLE_ELEMENT_SHOULD_HAVE_A_TEXT) == 0)
+ {
+ AXIS2_ERROR_SET((*env)->error,
+ AXIS2_ERROR_SOAP11_FAULT_ACTOR_SHOULD_NOT_HAVE_CHILD_ELEMENTS, AXIS2_FAILURE);
+ return AXIS2_FAILURE;
}
-
-
- */
+ }
return AXIS2_SUCCESS;
}
Modified: webservices/axis2/trunk/c/modules/xml/soap/soap_builder.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/soap/soap_builder.c?rev=372489&r1=372488&r2=372489&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/soap/soap_builder.c (original)
+++ webservices/axis2/trunk/c/modules/xml/soap/soap_builder.c Thu Jan 26 01:10:47 2006
@@ -108,7 +108,7 @@
axis2_env_t **env,
axis2_om_node_t *current_node);
-axis2_status_t
+axis2_status_t AXIS2_CALL
axis2_soap_builder_process_namespace_data
(axis2_soap_builder_t *builder,
axis2_env_t **env,
@@ -216,6 +216,9 @@
axis2_soap_builder_is_processing_detail_elements;
builder_impl->soap_builder.ops->get_soap_version =
axis2_soap_builder_get_soap_version;
+ builder_impl->soap_builder.ops->process_namespace_data =
+ axis2_soap_builder_process_namespace_data;
+
status = identify_soap_version(&(builder_impl->soap_builder), env, soap_version);
if(status == AXIS2_FAILURE)
{
@@ -269,6 +272,8 @@
!AXIS2_OM_STAX_BUILDER_IS_COMPLETE(builder_impl->om_builder, env))
{
status = axis2_soap_builder_next(builder, env);
+ if(status == AXIS2_FAILURE)
+ break;
}
return builder_impl->soap_envelope;
@@ -298,7 +303,7 @@
builder_impl = AXIS2_INTF_TO_IMPL(builder);
if(builder_impl->done)
{
- return AXIS2_FAILURE;
+ return AXIS2_FAILURE;
}
lastnode = AXIS2_OM_STAX_BUILDER_GET_LAST_NODE(builder_impl->om_builder, env);
Modified: webservices/axis2/trunk/c/test/xml/om/test_om.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/test/xml/om/test_om.c?rev=372489&r1=372488&r2=372489&view=diff
==============================================================================
--- webservices/axis2/trunk/c/test/xml/om/test_om.c (original)
+++ webservices/axis2/trunk/c/test/xml/om/test_om.c Thu Jan 26 01:10:47 2006
@@ -157,13 +157,14 @@
AXIS2_OM_OUTPUT_FREE(om_output, &environment);
if(buffer)
printf("%s",buffer);
-
+ AXIS2_OM_DOCUMENT_FREE_OM_NODES(document, &environment);
AXIS2_OM_DOCUMENT_FREE(document, &environment);
AXIS2_OM_STAX_BUILDER_FREE(builder, &environment);
if(buffer)
AXIS2_FREE(environment->allocator, buffer);
printf ("\ndone\n");
+ fclose(f);
return 0;
}
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=372489&r1=372488&r2=372489&view=diff
==============================================================================
--- webservices/axis2/trunk/c/test/xml/soap/test_soap.c (original)
+++ webservices/axis2/trunk/c/test/xml/soap/test_soap.c Thu Jan 26 01:10:47 2006
@@ -89,7 +89,6 @@
return -1;
}
soap_envelope = AXIS2_SOAP_BUILDER_GET_SOAP_ENVELOPE(soap_builder, env);
-
om_node = AXIS2_SOAP_ENVELOPE_GET_BASE_NODE(soap_envelope, env);
printnode(om_node, env);
@@ -110,8 +109,7 @@
printnode(om_node, env);
}
}
- /* AXIS2_OM_CHILDREN_QNAME_ITERATOR_FREE(children_iter, env); */
-
+ AXIS2_OM_CHILDREN_QNAME_ITERATOR_FREE(children_iter, env);
soap_body = AXIS2_SOAP_ENVELOPE_GET_BODY(soap_envelope, env);
if (soap_body)
{