You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by da...@apache.org on 2006/05/10 11:07:12 UTC
svn commit: r405685 - in /webservices/axis2/trunk/c: include/
modules/core/clientapi/diclient/ modules/core/deployment/
modules/core/transport/http/ modules/core/transport/http/sender/
modules/util/ modules/xml/om/ modules/xml/parser/guththila/ modules...
Author: damitha
Date: Wed May 10 02:07:08 2006
New Revision: 405685
URL: http://svn.apache.org/viewcvs?rev=405685&view=rev
Log:
Changed the signature of the following methods to support xmlDoc:
axis2_xml_writer_create_for_memory
axis2_xml_reader_create_for_memory (previously axis2_xml_reader_create_for_buffer)
AXIS2_XML_WRITER_GET_XML
axis2_xml_reader_create_for_memory is changed to axis2_xml_reader_create_for_io
Different parser types are defined in the axis2_xml_parser_type enum
Modified:
webservices/axis2/trunk/c/include/axis2_defines.h
webservices/axis2/trunk/c/include/axis2_error.h
webservices/axis2/trunk/c/include/axis2_xml_reader.h
webservices/axis2/trunk/c/include/axis2_xml_writer.h
webservices/axis2/trunk/c/modules/core/clientapi/diclient/di_client.c
webservices/axis2/trunk/c/modules/core/deployment/svc_builder.c
webservices/axis2/trunk/c/modules/core/transport/http/http_transport_utils.c
webservices/axis2/trunk/c/modules/core/transport/http/sender/http_transport_sender.c
webservices/axis2/trunk/c/modules/util/error.c
webservices/axis2/trunk/c/modules/xml/om/om_element.c
webservices/axis2/trunk/c/modules/xml/om/om_node.c
webservices/axis2/trunk/c/modules/xml/om/om_output.c
webservices/axis2/trunk/c/modules/xml/om/om_text.c
webservices/axis2/trunk/c/modules/xml/parser/guththila/guththila_xml_reader_wrapper.c
webservices/axis2/trunk/c/modules/xml/parser/guththila/guththila_xml_writer_wrapper.c
webservices/axis2/trunk/c/modules/xml/parser/libxml2/libxml2_reader_wrapper.c
webservices/axis2/trunk/c/modules/xml/parser/libxml2/libxml2_writer_wrapper.c
webservices/axis2/trunk/c/samples/client/echo/echo_client.c
webservices/axis2/trunk/c/samples/client/math/math_client.c
webservices/axis2/trunk/c/samples/client/mtom/mtom_client.c
webservices/axis2/trunk/c/samples/client/notify/notify_client.c
webservices/axis2/trunk/c/samples/server/echo/echo.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/om/test_om.c
webservices/axis2/trunk/c/test/xml/soap/test_soap.c
webservices/axis2/trunk/c/xdocs/docs/om_tutorial.html
webservices/axis2/trunk/c/xdocs/docs/userguide2.html
Modified: webservices/axis2/trunk/c/include/axis2_defines.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_defines.h?rev=405685&r1=405684&r2=405685&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_defines.h (original)
+++ webservices/axis2/trunk/c/include/axis2_defines.h Wed May 10 02:07:08 2006
@@ -37,6 +37,16 @@
#define AXIS2_TRUE 1
#define AXIS2_FALSE 0
+/**
+ * This enum is used to decide the type of storage used
+ */
+typedef enum _axis2_xml_parser_type
+{
+ AXIS2_XML_PARSER_TYPE_BUFFER = 1,
+ AXIS2_XML_PARSER_TYPE_FILE,
+ AXIS2_XML_PARSER_TYPE_DOC
+} axis2_xml_parser_type;
+
/**
* Exporting
*/
Modified: webservices/axis2/trunk/c/include/axis2_error.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_error.h?rev=405685&r1=405684&r2=405685&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_error.h (original)
+++ webservices/axis2/trunk/c/include/axis2_error.h Wed May 10 02:07:08 2006
@@ -433,6 +433,9 @@
AXIS2_ERROR_WRITING_START_ELEMENT_WITH_NAMESPACE_PREFIX,
/** error in writing cdata section */
AXIS2_ERROR_WRITING_CDATA,
+ /** AXIS2_XML_PARSER_TYPE_BUFFER or AXIS2_XML_PARSER_TYPE_DOC is expected */
+ AXIS2_ERROR_XML_PARSER_INVALID_MEM_TYPE,
+
/*
* Group - xml:soap
*/
Modified: webservices/axis2/trunk/c/include/axis2_xml_reader.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_xml_reader.h?rev=405685&r1=405684&r2=405685&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_xml_reader.h (original)
+++ webservices/axis2/trunk/c/include/axis2_xml_reader.h Wed May 10 02:07:08 2006
@@ -335,7 +335,7 @@
*/
AXIS2_DECLARE(axis2_xml_reader_t *)
-axis2_xml_reader_create_for_memory(axis2_env_t **env,
+axis2_xml_reader_create_for_io(axis2_env_t **env,
int (*read_input_callback)(char *buffer,int size,void* ctx),
int (*close_input_callback)(void *ctx),
void *ctx,
@@ -350,14 +350,12 @@
* @return pointer to axis2_xml_reader_t struct on success , NULL otherwise
*/
AXIS2_DECLARE(axis2_xml_reader_t *)
-axis2_xml_reader_create_for_buffer(axis2_env_t **env,
- const axis2_char_t *buffer,
+axis2_xml_reader_create_for_memory(axis2_env_t **env,
+ void *container,
int size,
- const axis2_char_t *encoding);
+ const axis2_char_t *encoding,
+ int type);
-AXIS2_DECLARE(axis2_xml_reader_t *)
-axis2_xml_reader_create_for_xml_doc(axis2_env_t **env,
- void *doc);
/**
* init function initializes the parser
*/
Modified: webservices/axis2/trunk/c/include/axis2_xml_writer.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_xml_writer.h?rev=405685&r1=405684&r2=405685&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_xml_writer.h (original)
+++ webservices/axis2/trunk/c/include/axis2_xml_writer.h Wed May 10 02:07:08 2006
@@ -33,7 +33,6 @@
typedef struct axis2_xml_writer_ops axis2_xml_writer_ops_t;
typedef struct axis2_xml_writer axis2_xml_writer_t;
-
/**
* @defgroup axis2_xml_writer
* @ingroup axis2_om_parser
@@ -431,10 +430,13 @@
axis2_char_t *text,
int in_attr);
- axis2_char_t* (AXIS2_CALL *
+ void* (AXIS2_CALL *
get_xml)(axis2_xml_writer_t *writer,
axis2_env_t **env);
+ int (AXIS2_CALL *
+ get_type)(axis2_xml_writer_t *writer,
+ axis2_env_t **env);
};
/**
@@ -462,14 +464,9 @@
axis2_xml_writer_create_for_memory(axis2_env_t **env,
axis2_char_t *encoding,
int is_prefix_default,
- int compression);
+ int compression,
+ int type);
-AXIS2_DECLARE(axis2_xml_writer_t *)
- axis2_xml_writer_create_for_xml_doc(axis2_env_t **env,
- axis2_char_t *encoding,
- int is_prefix_default,
- int compression);
-
/********************** start macros *******************************************/
#define AXIS2_XML_WRITER_FREE(writer, env) \
@@ -577,6 +574,10 @@
#define AXIS2_XML_WRITER_GET_XML(writer, env) \
((writer)->ops->get_xml(writer, env))
+
+#define AXIS2_XML_WRITER_GET_TYPE(writer, env) \
+ ((writer)->ops->get_type(writer, env))
+
/** @} */
Modified: webservices/axis2/trunk/c/modules/core/clientapi/diclient/di_client.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/clientapi/diclient/di_client.c?rev=405685&r1=405684&r2=405685&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/clientapi/diclient/di_client.c (original)
+++ webservices/axis2/trunk/c/modules/core/clientapi/diclient/di_client.c Wed May 10 02:07:08 2006
@@ -453,11 +453,12 @@
axis2_char_t *buffer = NULL;
printf("\necho stub invoke SUCCESSFUL!\n");
- writer = axis2_xml_writer_create_for_memory(env, NULL, AXIS2_TRUE, 0);
+ writer = axis2_xml_writer_create_for_memory(env, NULL, AXIS2_TRUE, 0,
+ AXIS2_XML_PARSER_TYPE_BUFFER);
om_output = axis2_om_output_create (env, writer);
AXIS2_OM_NODE_SERIALIZE (ret_node, env, om_output);
- buffer = AXIS2_XML_WRITER_GET_XML(writer, env);
+ buffer = (axis2_char_t*)AXIS2_XML_WRITER_GET_XML(writer, env);
printf ("\nReceived OM node in XML : %s\n", buffer);
}
else
Modified: webservices/axis2/trunk/c/modules/core/deployment/svc_builder.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/deployment/svc_builder.c?rev=405685&r1=405684&r2=405685&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/deployment/svc_builder.c (original)
+++ webservices/axis2/trunk/c/modules/core/deployment/svc_builder.c Wed May 10 02:07:08 2006
@@ -306,14 +306,14 @@
axis2_char_t *svc_name = NULL;
xml_writer = axis2_xml_writer_create_for_memory(env, NULL,
- AXIS2_TRUE, 0);
+ AXIS2_TRUE, 0, AXIS2_XML_PARSERT_TYPE_BUFFER);
om_output = axis2_om_output_create(env, xml_writer);
status = AXIS2_OM_NODE_SERIALIZE(desc_value_node, env, om_output);
if(status != AXIS2_SUCCESS)
{
return AXIS2_FAILURE;
}
- svc_name = AXIS2_XML_WRITER_GET_XML(xml_writer, env);
+ svc_name = (axis2_char_t*)AXIS2_XML_WRITER_GET_XML(xml_writer, env);
AXIS2_SVC_SET_AXIS2_SVC_NAME(builder_impl->svc, env,
svc_name);
AXIS2_OM_OUTPUT_FREE(om_output, env);
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=405685&r1=405684&r2=405685&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 Wed May 10 02:07:08 2006
@@ -487,7 +487,7 @@
AXIS2_MSG_CTX_SET_SERVER_SIDE(msg_ctx, env, AXIS2_TRUE);
char_set = axis2_http_transport_utils_get_charset_enc(env,content_type);
- xml_reader = axis2_xml_reader_create_for_memory(env,
+ xml_reader = axis2_xml_reader_create_for_io(env,
axis2_http_transport_utils_on_data_request,NULL,
(void *)&callback_ctx, char_set);
@@ -1312,7 +1312,7 @@
axis2_soap_builder_t *soap_builder = NULL;
axis2_soap_envelope_t *soap_envelope = NULL;
- xml_reader = axis2_xml_reader_create_for_memory(env,
+ xml_reader = axis2_xml_reader_create_for_io(env,
axis2_http_transport_utils_on_data_request,NULL,
(void *)callback_ctx, char_set_enc);
if(NULL == xml_reader)
@@ -1349,7 +1349,7 @@
axis2_om_document_t *om_doc = NULL;
axis2_om_node_t *root_node = NULL;
- xml_reader = axis2_xml_reader_create_for_memory(env,
+ xml_reader = axis2_xml_reader_create_for_io(env,
axis2_http_transport_utils_on_data_request,NULL,
(void *)callback_ctx, char_set_enc);
if(NULL == xml_reader)
Modified: webservices/axis2/trunk/c/modules/core/transport/http/sender/http_transport_sender.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/transport/http/sender/http_transport_sender.c?rev=405685&r1=405684&r2=405685&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/sender/http_transport_sender.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/sender/http_transport_sender.c Wed May 10 02:07:08 2006
@@ -241,7 +241,7 @@
return AXIS2_FAILURE;
}
xml_writer = axis2_xml_writer_create_for_memory(env, NULL,
- AXIS2_TRUE, 0);
+ AXIS2_TRUE, 0, AXIS2_XML_PARSER_TYPE_BUFFER);
if(NULL == xml_writer)
{
return AXIS2_FAILURE;
@@ -362,13 +362,13 @@
return AXIS2_FAILURE;
}
AXIS2_OM_NODE_SERIALIZE(data_out, env, om_output);
- buffer = AXIS2_XML_WRITER_GET_XML(xml_writer, env);
+ buffer = (axis2_char_t*)AXIS2_XML_WRITER_GET_XML(xml_writer, env);
}
else
{
AXIS2_SOAP_ENVELOPE_SERIALIZE (soap_data_out, env, om_output,
AXIS2_FALSE);
- buffer = AXIS2_XML_WRITER_GET_XML(xml_writer, env);
+ buffer = (axis2_char_t*)AXIS2_XML_WRITER_GET_XML(xml_writer, env);
}
AXIS2_STREAM_WRITE(out_stream, env, buffer, AXIS2_STRLEN(buffer));
AXIS2_FREE((*env)->allocator, buffer);
Modified: webservices/axis2/trunk/c/modules/util/error.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/util/error.c?rev=405685&r1=405684&r2=405685&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/util/error.c (original)
+++ webservices/axis2/trunk/c/modules/util/error.c Wed May 10 02:07:08 2006
@@ -372,6 +372,9 @@
"error occured in writing start element with namespace prefix";
axis2_error_messages[AXIS2_ERROR_WRITING_CDATA] =
"error in writing cdata section";
+ axis2_error_messages[AXIS2_ERROR_XML_PARSER_INVALID_MEM_TYPE] =
+ "AXIS2_XML_PARSER_TYPE_BUFFER or AXIS2_XML_PARSER_TYPE_DOC is expected";
+
/* invalid type passed */
axis2_error_messages[AXIS2_ERROR_INVALID_BASE_TYPE] =
"invalid type passed";
Modified: webservices/axis2/trunk/c/modules/xml/om/om_element.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/om_element.c?rev=405685&r1=405684&r2=405685&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/om_element.c (original)
+++ webservices/axis2/trunk/c/modules/xml/om/om_element.c Wed May 10 02:07:08 2006
@@ -1425,7 +1425,8 @@
AXIS2_ENV_CHECK(env, NULL);
AXIS2_PARAM_CHECK((*env)->error, element_node, NULL);
- xml_writer = axis2_xml_writer_create_for_memory(env, NULL, AXIS2_TRUE, 0);
+ xml_writer = axis2_xml_writer_create_for_memory(env, NULL, AXIS2_TRUE, 0,
+ AXIS2_XML_PARSER_TYPE_BUFFER);
if(!xml_writer)
return NULL;
@@ -1436,7 +1437,7 @@
status = AXIS2_OM_NODE_SERIALIZE(element_node, env, om_output);
if(status == AXIS2_SUCCESS)
{
- xml = AXIS2_XML_WRITER_GET_XML(xml_writer, env);
+ xml = (axis2_char_t*)AXIS2_XML_WRITER_GET_XML(xml_writer, env);
}
AXIS2_OM_OUTPUT_FREE(om_output, env);
return xml;
@@ -1652,4 +1653,4 @@
om_ele_impl = AXIS2_INTF_TO_IMPL(om_element);
om_ele_impl->ns = om_ns;
return AXIS2_SUCCESS;
-}
\ No newline at end of file
+}
Modified: webservices/axis2/trunk/c/modules/xml/om/om_node.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/om_node.c?rev=405685&r1=405684&r2=405685&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/om_node.c (original)
+++ webservices/axis2/trunk/c/modules/xml/om/om_node.c Wed May 10 02:07:08 2006
@@ -838,7 +838,8 @@
AXIS2_ENV_CHECK(env, NULL);
AXIS2_PARAM_CHECK((*env)->error, om_node, NULL);
- xml_writer = axis2_xml_writer_create_for_memory(env, NULL, AXIS2_TRUE, 0);
+ xml_writer = axis2_xml_writer_create_for_memory(env, NULL, AXIS2_TRUE, 0,
+ AXIS2_XML_PARSER_TYPE_BUFFER);
if(!xml_writer)
return NULL;
@@ -851,8 +852,8 @@
status = AXIS2_OM_NODE_SERIALIZE(om_node, env, om_output);
if(status == AXIS2_SUCCESS)
{
- xml = AXIS2_XML_WRITER_GET_XML(xml_writer, env);
+ xml = (axis2_char_t*)AXIS2_XML_WRITER_GET_XML(xml_writer, env);
}
AXIS2_OM_OUTPUT_FREE(om_output, env);
return xml;
-}
\ No newline at end of file
+}
Modified: webservices/axis2/trunk/c/modules/xml/om/om_output.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/om_output.c?rev=405685&r1=405684&r2=405685&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/om_output.c (original)
+++ webservices/axis2/trunk/c/modules/xml/om/om_output.c Wed May 10 02:07:08 2006
@@ -803,7 +803,7 @@
{
axis2_byte_t* byte_stream = NULL;
axis2_char_t *root_content_id = NULL;
- axis2_char_t *buffer = AXIS2_XML_WRITER_GET_XML(output_impl->xml_writer, env);
+ axis2_char_t *buffer = (axis2_char_t*)AXIS2_XML_WRITER_GET_XML(output_impl->xml_writer, env);
int stream_size = 0;
if (output_impl->is_soap11)
{
Modified: webservices/axis2/trunk/c/modules/xml/om/om_text.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/om_text.c?rev=405685&r1=405684&r2=405685&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/om_text.c (original)
+++ webservices/axis2/trunk/c/modules/xml/om/om_text.c Wed May 10 02:07:08 2006
@@ -516,7 +516,8 @@
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- xml_writer = axis2_xml_writer_create_for_memory(env, NULL, AXIS2_TRUE, 0);
+ xml_writer = axis2_xml_writer_create_for_memory(env, NULL, AXIS2_TRUE, 0,
+ AXIS2_XML_PARSER_TYPE_BUFFER);
om_namespace = axis2_om_namespace_create(env, "" , "");
om_text_impl = AXIS2_INTF_TO_IMPL(om_text);
@@ -554,7 +555,8 @@
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- xml_writer = axis2_xml_writer_create_for_memory(env, NULL, AXIS2_TRUE, 0);
+ xml_writer = axis2_xml_writer_create_for_memory(env, NULL, AXIS2_TRUE, 0,
+ AXIS2_XML_PARSER_TYPE_BUFFER);
om_namespace = axis2_om_namespace_create(env, "" , "");
om_text_impl = AXIS2_INTF_TO_IMPL(om_text);
Modified: webservices/axis2/trunk/c/modules/xml/parser/guththila/guththila_xml_reader_wrapper.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/parser/guththila/guththila_xml_reader_wrapper.c?rev=405685&r1=405684&r2=405685&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/parser/guththila/guththila_xml_reader_wrapper.c (original)
+++ webservices/axis2/trunk/c/modules/xml/parser/guththila/guththila_xml_reader_wrapper.c Wed May 10 02:07:08 2006
@@ -243,11 +243,11 @@
return &(guththila_impl->parser);
}
-/****** pull parser for memory create function ***************************/
+/****** pull parser for io create function ***************************/
AXIS2_DECLARE(axis2_xml_reader_t *)
-axis2_xml_reader_create_for_memory(axis2_env_t **env,
+axis2_xml_reader_create_for_io(axis2_env_t **env,
int (*read_input_callback)(char *buffer,int size,void* ctx),
int (*close_input_callback)(void *ctx),
void *ctx,
Modified: webservices/axis2/trunk/c/modules/xml/parser/guththila/guththila_xml_writer_wrapper.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/parser/guththila/guththila_xml_writer_wrapper.c?rev=405685&r1=405684&r2=405685&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/parser/guththila/guththila_xml_writer_wrapper.c (original)
+++ webservices/axis2/trunk/c/modules/xml/parser/guththila/guththila_xml_writer_wrapper.c Wed May 10 02:07:08 2006
@@ -194,7 +194,7 @@
axis2_char_t *text,
int in_attr);
-axis2_char_t* AXIS2_CALL
+void* AXIS2_CALL
guththila_xml_writer_wrapper_get_xml(axis2_xml_writer_t *writer,
axis2_env_t **env);
@@ -332,7 +332,8 @@
axis2_xml_writer_create_for_memory(axis2_env_t **env,
axis2_char_t *encoding,
int is_prefix_default,
- int compression)
+ int compression,
+ int type)
{
return axis2_xml_writer_create(env, NULL, encoding, is_prefix_default, compression);
@@ -786,9 +787,9 @@
AXIS2_INTF_TO_IMPL(writer)->guththila_writer, text, in_attr);
}
-axis2_char_t* AXIS2_CALL
+void* AXIS2_CALL
guththila_xml_writer_wrapper_get_xml(axis2_xml_writer_t *writer,
axis2_env_t **env)
{
- return NULL;
+ return (void*)NULL;
}
Modified: webservices/axis2/trunk/c/modules/xml/parser/libxml2/libxml2_reader_wrapper.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/parser/libxml2/libxml2_reader_wrapper.c?rev=405685&r1=405684&r2=405685&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/parser/libxml2/libxml2_reader_wrapper.c (original)
+++ webservices/axis2/trunk/c/modules/xml/parser/libxml2/libxml2_reader_wrapper.c Wed May 10 02:07:08 2006
@@ -335,7 +335,7 @@
/************** create function for io callback function **********************/
AXIS2_DECLARE(axis2_xml_reader_t *)
-axis2_xml_reader_create_for_memory(axis2_env_t **env,
+axis2_xml_reader_create_for_io(axis2_env_t **env,
int (*read_input_callback)(char *buffer,int size,void *ctx),
int (*close_input_callback)(void *ctx),
void* ctx,
@@ -405,17 +405,18 @@
return &(wrapper_impl->parser);
}
-/***************** create function for character buffer ************************/
+/***************** create function for character buffer or xml doc ************************/
AXIS2_DECLARE(axis2_xml_reader_t *)
-axis2_xml_reader_create_for_buffer(axis2_env_t **env,
- const axis2_char_t *buffer,
+axis2_xml_reader_create_for_memory(axis2_env_t **env,
+ void *container,
int size,
- const axis2_char_t *encoding)
+ const axis2_char_t *encoding,
+ int type)
{
axis2_libxml2_reader_wrapper_impl_t *wrapper_impl = NULL;
AXIS2_ENV_CHECK( env, NULL);
- AXIS2_PARAM_CHECK((*env)->error, buffer , NULL);
+ AXIS2_PARAM_CHECK((*env)->error, container , NULL);
wrapper_impl = (axis2_libxml2_reader_wrapper_impl_t*)AXIS2_MALLOC((*env)->allocator,
sizeof(axis2_libxml2_reader_wrapper_impl_t));
@@ -427,9 +428,22 @@
wrapper_impl->close_input_callback = NULL;
wrapper_impl->read_input_callback = NULL;
wrapper_impl->ctx = NULL;
-
- wrapper_impl->reader = xmlReaderForMemory(buffer, size,
- NULL, encoding, XML_PARSE_RECOVER);
+
+ if (AXIS2_XML_PARSER_TYPE_BUFFER == type)
+ {
+ wrapper_impl->reader = xmlReaderForMemory((axis2_char_t*)container, size,
+ NULL, encoding, XML_PARSE_RECOVER);
+ }
+ else if (AXIS2_XML_PARSER_TYPE_DOC == type)
+ {
+ wrapper_impl->reader = xmlReaderWalker((xmlDocPtr)container);
+ }
+ else
+ {
+ AXIS2_FREE((*env)->allocator, wrapper_impl);
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_XML_PARSER_INVALID_MEM_TYPE, AXIS2_FAILURE);
+ return NULL;
+ }
if(!(wrapper_impl->reader))
{
@@ -439,9 +453,12 @@
return NULL;
}
- xmlTextReaderSetErrorHandler(wrapper_impl->reader,
- (xmlTextReaderErrorFunc)axis2_libxml2_reader_wrapper_error_handler,
- (*env));
+ if (AXIS2_XML_PARSER_TYPE_BUFFER == type)
+ {
+ xmlTextReaderSetErrorHandler(wrapper_impl->reader,
+ (xmlTextReaderErrorFunc)axis2_libxml2_reader_wrapper_error_handler,
+ (*env));
+ }
wrapper_impl->current_event = -1;
@@ -464,61 +481,6 @@
}
-/***************** create function for xmlDoc ************************/
-AXIS2_DECLARE(axis2_xml_reader_t *)
-axis2_xml_reader_create_for_xml_doc(axis2_env_t **env,
- void *doc)
-{
- axis2_libxml2_reader_wrapper_impl_t *wrapper_impl = NULL;
-
- AXIS2_ENV_CHECK( env, NULL);
-
- wrapper_impl = (axis2_libxml2_reader_wrapper_impl_t*)AXIS2_MALLOC((*env)->allocator,
- sizeof(axis2_libxml2_reader_wrapper_impl_t));
- if(!wrapper_impl)
- {
- AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
- return NULL;
- }
- wrapper_impl->close_input_callback = NULL;
- wrapper_impl->read_input_callback = NULL;
- wrapper_impl->ctx = NULL;
-
- wrapper_impl->reader = xmlReaderWalker((xmlDocPtr)doc);
-
- if(!(wrapper_impl->reader))
- {
- AXIS2_FREE((*env)->allocator, wrapper_impl);
- AXIS2_ERROR_SET((*env)->error,
- AXIS2_ERROR_CREATING_XML_STREAM_READER, AXIS2_FAILURE);
- return NULL;
- }
-
- /*xmlTextReaderSetErrorHandler(wrapper_impl->reader,
- (xmlTextReaderErrorFunc)axis2_libxml2_reader_wrapper_error_handler,
- (*env));
- */
- wrapper_impl->current_event = -1;
-
- axis2_libxml2_reader_wrapper_init_map(wrapper_impl);
-
- wrapper_impl->parser.ops = NULL;
- wrapper_impl->parser.ops = (axis2_xml_reader_ops_t*)AXIS2_MALLOC((*env)->allocator,
- sizeof(axis2_xml_reader_ops_t));
-
- if(!(wrapper_impl->parser.ops))
- {
- xmlFreeTextReader(wrapper_impl->reader);
- AXIS2_FREE((*env)->allocator, wrapper_impl);
- AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
- return NULL;
- }
-
- axis2_libxml2_reader_wrapper_init_ops(&(wrapper_impl->parser));
-
- return &(wrapper_impl->parser);
-}
-/****************** end create functions ***************************************/
int AXIS2_CALL
axis2_libxml2_reader_wrapper_next(axis2_xml_reader_t *parser,
Modified: webservices/axis2/trunk/c/modules/xml/parser/libxml2/libxml2_writer_wrapper.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/parser/libxml2/libxml2_writer_wrapper.c?rev=405685&r1=405684&r2=405685&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/parser/libxml2/libxml2_writer_wrapper.c (original)
+++ webservices/axis2/trunk/c/modules/xml/parser/libxml2/libxml2_writer_wrapper.c Wed May 10 02:07:08 2006
@@ -32,10 +32,6 @@
#define AXIS2_XMLNS_NAMESPACE_URI "http://www.w3.org/XML/1998/namespace"
#define AXIS2_XMLNS_PREFIX "xml"
-#define AXIS2_LIBXML2_WRITER_MEMORY 1
-#define AXIS2_LIBXML2_WRITER_FILE 2
-#define AXIS2_LIBXML2_WRITER_DOC 3
-
/************************ structures *****************************************/
typedef struct uri_prefix_element
@@ -262,13 +258,13 @@
axis2_char_t *text,
int in_attr);
-axis2_char_t* AXIS2_CALL
+void* AXIS2_CALL
axis2_libxml2_writer_wrapper_get_xml(axis2_xml_writer_t *writer,
axis2_env_t **env);
-void* AXIS2_CALL
-axis2_libxml2_writer_wrapper_get_xml_doc(axis2_xml_writer_t *writer,
- axis2_env_t **env);
+int AXIS2_CALL
+axis2_libxml2_writer_wrapper_get_type(axis2_xml_writer_t *writer,
+ axis2_env_t **env);
/*********************** static functions ************************************/
static axis2_status_t
@@ -365,7 +361,7 @@
writer_impl->default_lang_namespace = NULL;
writer_impl->writer.ops = NULL;
- writer_impl->writer_type = AXIS2_LIBXML2_WRITER_FILE;
+ writer_impl->writer_type = AXIS2_XML_PARSER_TYPE_FILE;
writer_impl->compression = compression;
if(NULL != encoding)
@@ -415,7 +411,8 @@
axis2_xml_writer_create_for_memory(axis2_env_t **env,
axis2_char_t *encoding,
int is_prefix_default,
- int compression)
+ int compression,
+ int type)
{
axis2_libxml2_writer_wrapper_impl_t *writer_impl = NULL;
AXIS2_ENV_CHECK(env, NULL);
@@ -430,25 +427,41 @@
writer_impl->writer.ops = NULL;
writer_impl->encoding = NULL;
writer_impl->buffer = NULL;
+ writer_impl->doc = NULL;
writer_impl->in_empty_element = AXIS2_FALSE;
writer_impl->in_start_element = AXIS2_FALSE;
writer_impl->stack = NULL;
writer_impl->uri_prefix_map = NULL;
writer_impl->default_lang_namespace = NULL;
-
- writer_impl->writer_type = AXIS2_LIBXML2_WRITER_MEMORY;
writer_impl->compression = compression;
+
+ if (AXIS2_XML_PARSER_TYPE_BUFFER == type)
+ {
+ writer_impl->writer_type = AXIS2_XML_PARSER_TYPE_BUFFER;
+ writer_impl->buffer = xmlBufferCreate();
+ if(writer_impl->buffer == NULL)
+ {
+ axis2_libxml2_writer_wrapper_free(&(writer_impl->writer), env);
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ writer_impl->xml_writer = xmlNewTextWriterMemory(writer_impl->buffer, 0);
+ }
+ else if (AXIS2_XML_PARSER_TYPE_DOC == type)
+ {
+ writer_impl->writer_type = AXIS2_XML_PARSER_TYPE_DOC;
+ writer_impl->xml_writer = xmlNewTextWriterDoc(&writer_impl->doc, 0);
+ }
+ else
+ {
+ axis2_libxml2_writer_wrapper_free(&(writer_impl->writer), env);
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_XML_PARSER_INVALID_MEM_TYPE, AXIS2_FAILURE);
+ return NULL;
+ }
+
- writer_impl->buffer = xmlBufferCreate();
- if(writer_impl->buffer == NULL)
- {
- axis2_libxml2_writer_wrapper_free(&(writer_impl->writer), env);
- AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
- return NULL;
- }
- writer_impl->xml_writer = xmlNewTextWriterMemory(writer_impl->buffer, 0);
if(writer_impl->xml_writer == NULL)
{
axis2_libxml2_writer_wrapper_free(&(writer_impl->writer), env);
@@ -497,171 +510,6 @@
return &(writer_impl->writer);
}
-/*********************** writer create func for xml doc ***************************/
-
-AXIS2_DECLARE(axis2_xml_writer_t *)
-axis2_xml_writer_create_for_xml_doc(axis2_env_t **env,
- axis2_char_t *encoding,
- int is_prefix_default,
- int compression)
-{
- axis2_libxml2_writer_wrapper_impl_t *writer_impl = NULL;
- AXIS2_ENV_CHECK(env, NULL);
- writer_impl = (axis2_libxml2_writer_wrapper_impl_t *)AXIS2_MALLOC((*env)->allocator,
- sizeof(axis2_libxml2_writer_wrapper_impl_t));
- if(!writer_impl)
- {
- AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
- return NULL;
- }
-
- writer_impl->writer.ops = NULL;
- writer_impl->encoding = NULL;
- writer_impl->buffer = NULL;
- writer_impl->in_empty_element = AXIS2_FALSE;
- writer_impl->in_start_element = AXIS2_FALSE;
- writer_impl->stack = NULL;
- writer_impl->uri_prefix_map = NULL;
- writer_impl->default_lang_namespace = NULL;
-
- writer_impl->writer_type = AXIS2_LIBXML2_WRITER_DOC;
- writer_impl->compression = compression;
-
-
- writer_impl->xml_writer = xmlNewTextWriterDoc(&writer_impl->doc, 0);
-
- if(writer_impl->xml_writer == NULL)
- {
- axis2_libxml2_writer_wrapper_free(&(writer_impl->writer), env);
- AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_CREATING_XML_STREAM_WRITER , AXIS2_FAILURE);
- return NULL;
- }
-
- if(encoding)
- writer_impl->encoding = AXIS2_STRDUP(encoding , env);
- else
- writer_impl->encoding = AXIS2_STRDUP(ENCODING, env);
-
-
- writer_impl->uri_prefix_map = axis2_hash_make(env);
- if(!(writer_impl->uri_prefix_map))
- {
- axis2_libxml2_writer_wrapper_free(&(writer_impl->writer), env);
- AXIS2_ERROR_SET((*env)->error,
- AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-
- return NULL;
- }
- writer_impl->stack = axis2_stack_create(env);
- if(!(writer_impl->stack))
- {
- axis2_libxml2_writer_wrapper_free(&(writer_impl->writer), env);
- AXIS2_ERROR_SET((*env)->error,
- AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
- return NULL;
- }
-
- axis2_libxml2_writer_wrapper_set_default_lang_namespace(&(writer_impl->writer), env);
-
- writer_impl->writer.ops = (axis2_xml_writer_ops_t*)AXIS2_MALLOC((*env)->allocator,
- sizeof(axis2_xml_writer_ops_t));
- if(!(writer_impl->writer.ops))
- {
- axis2_libxml2_writer_wrapper_free(&(writer_impl->writer), env);
- AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
- return NULL;
- }
-
- /* ops */
- writer_impl->writer.ops->free =
- axis2_libxml2_writer_wrapper_free;
-
- writer_impl->writer.ops->write_start_element =
- axis2_libxml2_writer_wrapper_write_start_element;
-
- writer_impl->writer.ops->write_start_element_with_namespace =
- axis2_libxml2_writer_wrapper_write_start_element_with_namespace;
-
- writer_impl->writer.ops->write_start_element_with_namespace_prefix =
- axis2_libxml2_writer_wrapper_write_start_element_with_namespace_prefix;
-
- writer_impl->writer.ops->write_empty_element =
- axis2_libxml2_writer_wrapper_write_empty_element;
-
- writer_impl->writer.ops->write_empty_element_with_namespace =
- axis2_libxml2_writer_wrapper_write_empty_element_with_namespace;
-
- writer_impl->writer.ops->write_empty_element_with_namespace_prefix =
- axis2_libxml2_writer_wrapper_write_empty_element_with_namespace_prefix;
-
- writer_impl->writer.ops->write_end_element =
- axis2_libxml2_writer_wrapper_write_end_element;
-
- writer_impl->writer.ops->write_end_document =
- axis2_libxml2_writer_wrapper_write_end_document;
-
- writer_impl->writer.ops->write_attribute =
- axis2_libxml2_writer_wrapper_write_attribute;
-
- writer_impl->writer.ops->write_attribute_with_namespace =
- axis2_libxml2_writer_wrapper_write_attribute_with_namespace;
-
- writer_impl->writer.ops->write_attribute_with_namespace_prefix =
- axis2_libxml2_writer_wrapper_write_attribute_with_namespace_prefix;
-
- writer_impl->writer.ops->write_namespace =
- axis2_libxml2_writer_wrapper_write_namespace;
-
- writer_impl->writer.ops->write_default_namespace =
- axis2_libxml2_writer_wrapper_write_default_namespace;
-
- writer_impl->writer.ops->write_comment =
- axis2_libxml2_writer_wrapper_write_comment;
-
- writer_impl->writer.ops->write_processing_instruction =
- axis2_libxml2_writer_wrapper_write_processing_instruction;
-
- writer_impl->writer.ops->write_processing_instruction_data =
- axis2_libxml2_writer_wrapper_write_processing_instruction_data;
-
- writer_impl->writer.ops->write_cdata =
- axis2_libxml2_writer_wrapper_write_cdata;
-
- writer_impl->writer.ops->write_dtd =
- axis2_libxml2_writer_wrapper_write_dtd;
-
- writer_impl->writer.ops->write_entity_ref =
- axis2_libxml2_writer_wrapper_write_entity_ref;
-
- writer_impl->writer.ops->write_start_document =
- axis2_libxml2_writer_wrapper_write_start_document;
-
- writer_impl->writer.ops->write_start_document_with_version =
- axis2_libxml2_writer_wrapper_write_start_document_with_version;
-
- writer_impl->writer.ops->write_start_document_with_version_encoding =
- axis2_libxml2_writer_wrapper_write_start_document_with_version_encoding;
-
- writer_impl->writer.ops->write_characters =
- axis2_libxml2_writer_wrapper_write_characters;
-
- writer_impl->writer.ops->get_prefix =
- axis2_libxml2_writer_wrapper_get_prefix;
-
- writer_impl->writer.ops->set_prefix =
- axis2_libxml2_writer_wrapper_set_prefix;
-
- writer_impl->writer.ops->set_default_prefix =
- axis2_libxml2_writer_wrapper_set_default_prefix;
-
- writer_impl->writer.ops->write_encoded =
- axis2_libxml2_writer_wrapper_write_encoded;
-
- writer_impl->writer.ops->get_xml =
- axis2_libxml2_writer_wrapper_get_xml_doc;
-
- return &(writer_impl->writer);
-}
/*******************************************************************************/
static void
@@ -725,6 +573,8 @@
axis2_libxml2_writer_wrapper_write_encoded;
writer->ops->get_xml =
axis2_libxml2_writer_wrapper_get_xml;
+ writer->ops->get_type =
+ axis2_libxml2_writer_wrapper_get_type;
}
@@ -1603,21 +1453,21 @@
return AXIS2_FAILURE;
}
-axis2_char_t* AXIS2_CALL
+void* AXIS2_CALL
axis2_libxml2_writer_wrapper_get_xml(axis2_xml_writer_t *writer,
axis2_env_t **env)
{
axis2_libxml2_writer_wrapper_impl_t *writer_impl = NULL;
- axis2_char_t *output = NULL;
writer_impl = AXIS2_INTF_TO_IMPL(writer);
if(writer_impl->xml_writer)
{
xmlFreeTextWriter(writer_impl->xml_writer);
writer_impl->xml_writer = NULL;
}
- if(writer_impl->writer_type == AXIS2_LIBXML2_WRITER_MEMORY)
+ if(writer_impl->writer_type == AXIS2_XML_PARSER_TYPE_BUFFER)
{
-
+ axis2_char_t *output = NULL;
+
if(writer_impl->buffer != NULL)
{
output = AXIS2_MALLOC((*env)->allocator,
@@ -1626,33 +1476,28 @@
sprintf(output,
((const axis2_char_t*)(writer_impl->buffer->content)));
}
+ return (void*)output;
}
- else if(writer_impl->writer_type == AXIS2_LIBXML2_WRITER_FILE)
+ else if (writer_impl->writer_type == AXIS2_XML_PARSER_TYPE_DOC)
+ {
+ return (void*)writer_impl->doc;
+ }
+ else if(writer_impl->writer_type == AXIS2_XML_PARSER_TYPE_FILE)
{
printf("axis2_libxml2_writer_wrapper_get_xml does not support file writer\n");
}
- return output;
+ return NULL;
}
-void* AXIS2_CALL
-axis2_libxml2_writer_wrapper_get_xml_doc(axis2_xml_writer_t *writer,
- axis2_env_t **env)
+int AXIS2_CALL
+axis2_libxml2_writer_wrapper_get_type(axis2_xml_writer_t *writer,
+ axis2_env_t **env)
{
- axis2_libxml2_writer_wrapper_impl_t *writer_impl = NULL;
- writer_impl = AXIS2_INTF_TO_IMPL(writer);
-
- if(writer_impl->xml_writer)
- {
- xmlFreeTextWriter(writer_impl->xml_writer);
- writer_impl->xml_writer = NULL;
- }
+ axis2_libxml2_writer_wrapper_impl_t *writer_impl = NULL;
+ writer_impl = AXIS2_INTF_TO_IMPL(writer);
- if (writer_impl->writer_type == AXIS2_LIBXML2_WRITER_DOC)
- {
- return (void*)writer_impl->doc;
- }
- return NULL;
+ return writer_impl->writer_type;
}
static axis2_status_t
Modified: webservices/axis2/trunk/c/samples/client/echo/echo_client.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/samples/client/echo/echo_client.c?rev=405685&r1=405684&r2=405685&view=diff
==============================================================================
--- webservices/axis2/trunk/c/samples/client/echo/echo_client.c (original)
+++ webservices/axis2/trunk/c/samples/client/echo/echo_client.c Wed May 10 02:07:08 2006
@@ -187,11 +187,12 @@
axis2_char_t *buffer = NULL;
printf("\necho stub invoke SUCCESSFUL!\n");
- writer = axis2_xml_writer_create_for_memory(&env, NULL, AXIS2_TRUE, 0);
+ writer = axis2_xml_writer_create_for_memory(&env, NULL, AXIS2_TRUE, 0,
+ AXIS2_XML_PARSER_TYPE_BUFFER);
om_output = axis2_om_output_create (&env, writer);
AXIS2_OM_NODE_SERIALIZE (ret_node, &env, om_output);
- buffer = AXIS2_XML_WRITER_GET_XML(writer, &env);
+ buffer = (axis2_char_t*)AXIS2_XML_WRITER_GET_XML(writer, &env);
printf ("\nReceived OM node in XML : %s\n", buffer);
AXIS2_FREE(env->allocator, buffer);
AXIS2_OM_OUTPUT_FREE(om_output, &env);
@@ -250,11 +251,12 @@
AXIS2_OM_ELEMENT_SET_TEXT(text_om_ele, env, "echo5", text_om_node);
- xml_writer = axis2_xml_writer_create_for_memory(env, NULL, AXIS2_FALSE, AXIS2_FALSE);
+ xml_writer = axis2_xml_writer_create_for_memory(env, NULL, AXIS2_FALSE, AXIS2_FALSE,
+ AXIS2_XML_PARSER_TYPE_BUFFER);
om_output = axis2_om_output_create( env, xml_writer);
AXIS2_OM_NODE_SERIALIZE(echo_om_node, env, om_output);
- buffer = AXIS2_XML_WRITER_GET_XML(xml_writer, env);
+ buffer = (axis2_char_t*)AXIS2_XML_WRITER_GET_XML(xml_writer, env);
printf("\nSending OM node in XML : %s \n", buffer);
AXIS2_FREE((*env)->allocator, buffer);
AXIS2_OM_OUTPUT_FREE(om_output, env);
Modified: webservices/axis2/trunk/c/samples/client/math/math_client.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/samples/client/math/math_client.c?rev=405685&r1=405684&r2=405685&view=diff
==============================================================================
--- webservices/axis2/trunk/c/samples/client/math/math_client.c (original)
+++ webservices/axis2/trunk/c/samples/client/math/math_client.c Wed May 10 02:07:08 2006
@@ -116,11 +116,12 @@
axis2_xml_writer_t *writer = NULL;
axis2_om_output_t *om_output = NULL;
axis2_char_t *buffer = NULL;
- writer = axis2_xml_writer_create_for_memory(&env, NULL, AXIS2_TRUE, 0);
+ writer = axis2_xml_writer_create_for_memory(&env, NULL, AXIS2_TRUE, 0,
+ AXIS2_XML_PARSER_TYPE_BUFFER);
om_output = axis2_om_output_create (&env, writer);
AXIS2_OM_NODE_SERIALIZE (ret_node, &env, om_output);
- buffer = AXIS2_XML_WRITER_GET_XML(writer, &env);
+ buffer = (axis2_char_t*)AXIS2_XML_WRITER_GET_XML(writer, &env);
printf ("\nReceived invalid OM as result : %s\n", buffer);
if(NULL != buffer)
{
@@ -173,11 +174,12 @@
text_om_ele = axis2_om_element_create(env, math_om_node, "param2", NULL, &text_om_node);
AXIS2_OM_ELEMENT_SET_TEXT(text_om_ele, env, param2, text_om_node);
- xml_writer = axis2_xml_writer_create_for_memory(env, NULL, AXIS2_FALSE, AXIS2_FALSE);
+ xml_writer = axis2_xml_writer_create_for_memory(env, NULL, AXIS2_FALSE, AXIS2_FALSE,
+ AXIS2_XML_PARSER_TYPE_BUFFER);
om_output = axis2_om_output_create( env, xml_writer);
AXIS2_OM_NODE_SERIALIZE(math_om_node, env, om_output);
- buffer = AXIS2_XML_WRITER_GET_XML(xml_writer, env);
+ buffer = (axis2_char_t*)AXIS2_XML_WRITER_GET_XML(xml_writer, env);
AXIS2_LOG_DEBUG((*env)->log, AXIS2_LOG_SI, "\nSending OM node in XML : %s \n", buffer);
if(NULL != buffer)
{
Modified: webservices/axis2/trunk/c/samples/client/mtom/mtom_client.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/samples/client/mtom/mtom_client.c?rev=405685&r1=405684&r2=405685&view=diff
==============================================================================
--- webservices/axis2/trunk/c/samples/client/mtom/mtom_client.c (original)
+++ webservices/axis2/trunk/c/samples/client/mtom/mtom_client.c Wed May 10 02:07:08 2006
@@ -200,11 +200,12 @@
axis2_char_t *buffer = NULL;
printf("\nmtom stub invoke SUCCESSFUL!\n");
- writer = axis2_xml_writer_create_for_memory(&env, NULL, AXIS2_TRUE, 0);
+ writer = axis2_xml_writer_create_for_memory(&env, NULL, AXIS2_TRUE, 0,
+ AXIS2_XML_PARSER_TYPE_BUFFER);
om_output = axis2_om_output_create (&env, writer);
AXIS2_OM_NODE_SERIALIZE (ret_node, &env, om_output);
- buffer = AXIS2_XML_WRITER_GET_XML(writer, &env);
+ buffer = (axis2_char_t*)AXIS2_XML_WRITER_GET_XML(writer, &env);
printf ("\nReceived OM node in XML : %s\n", buffer);
AXIS2_FREE(env->allocator, buffer);
AXIS2_OM_OUTPUT_FREE(om_output, &env);
@@ -271,12 +272,13 @@
data_handler = axis2_data_handler_create(env, image_name, "image/jpeg");
data_text = axis2_om_text_create_with_data_handler(env, image_om_node, data_handler, &data_om_node);
- xml_writer = axis2_xml_writer_create_for_memory(env, NULL, AXIS2_FALSE, AXIS2_FALSE);
+ xml_writer = axis2_xml_writer_create_for_memory(env, NULL, AXIS2_FALSE, AXIS2_FALSE,
+ AXIS2_XML_PARSER_TYPE_BUFFER);
om_output = axis2_om_output_create( env, xml_writer);
AXIS2_OM_OUTPUT_SET_DO_OPTIMIZE(om_output, env, AXIS2_TRUE);
AXIS2_OM_NODE_SERIALIZE(mtom_om_node, env, om_output);
- buffer = AXIS2_XML_WRITER_GET_XML(xml_writer, env);
+ buffer = (axis2_char_t*)AXIS2_XML_WRITER_GET_XML(xml_writer, env);
printf("\nSending OM node in XML : %s \n", buffer);
AXIS2_FREE((*env)->allocator, buffer);
/*buffer = AXIS2_OM_OUTPUT_FLUSH(om_output, env);
Modified: webservices/axis2/trunk/c/samples/client/notify/notify_client.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/samples/client/notify/notify_client.c?rev=405685&r1=405684&r2=405685&view=diff
==============================================================================
--- webservices/axis2/trunk/c/samples/client/notify/notify_client.c (original)
+++ webservices/axis2/trunk/c/samples/client/notify/notify_client.c Wed May 10 02:07:08 2006
@@ -210,11 +210,12 @@
AXIS2_OM_ELEMENT_SET_TEXT(notify_om_ele, env, "notify5", notify_om_node);
- xml_writer = axis2_xml_writer_create_for_memory(env, NULL, AXIS2_FALSE, AXIS2_FALSE);
+ xml_writer = axis2_xml_writer_create_for_memory(env, NULL, AXIS2_FALSE, AXIS2_FALSE,
+ AXIS2_XML_PARSER_TYPE_BUFFER);
om_output = axis2_om_output_create( env, xml_writer);
AXIS2_OM_NODE_SERIALIZE(notify_om_node, env, om_output);
- buffer = AXIS2_XML_WRITER_GET_XML(xml_writer, env);
+ buffer = (axis2_char_t*)AXIS2_XML_WRITER_GET_XML(xml_writer, env);
printf("\nSending OM node in XML : %s \n", buffer);
return notify_om_node;
Modified: webservices/axis2/trunk/c/samples/server/echo/echo.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/samples/server/echo/echo.c?rev=405685&r1=405684&r2=405685&view=diff
==============================================================================
--- webservices/axis2/trunk/c/samples/server/echo/echo.c (original)
+++ webservices/axis2/trunk/c/samples/server/echo/echo.c Wed May 10 02:07:08 2006
@@ -14,6 +14,7 @@
* limitations under the License.
*/
#include "echo.h"
+#include <axis2_xml_writer.h>
#include <stdio.h>
axis2_om_node_t *
@@ -39,6 +40,20 @@
printf("Echo client ERROR: input parameter NULL\n");
return NULL;
}
+ else
+ {
+ axis2_xml_writer_t *writer = NULL;
+ axis2_om_output_t *om_output = NULL;
+ axis2_char_t *buffer = NULL;
+
+ writer = axis2_xml_writer_create_for_memory(env, NULL, AXIS2_TRUE, 0,
+ AXIS2_XML_PARSER_TYPE_BUFFER);
+ om_output = axis2_om_output_create (env, writer);
+
+ AXIS2_OM_NODE_SERIALIZE (node, env, om_output);
+ buffer = AXIS2_XML_WRITER_GET_XML(writer, env);
+ printf("buffer = %s \n", buffer);
+ }
text_parent_node = AXIS2_OM_NODE_GET_FIRST_CHILD(node, env);
if (!text_parent_node) /* 'text' node */
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=405685&r1=405684&r2=405685&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 Wed May 10 02:07:08 2006
@@ -353,18 +353,19 @@
xml_writer =
axis2_xml_writer_create_for_memory (env, NULL, AXIS2_FALSE,
- AXIS2_FALSE);
+ AXIS2_FALSE, AXIS2_XML_PARSER_TYPE_BUFFER);
om_output = axis2_om_output_create (env, xml_writer);
AXIS2_OM_NODE_SERIALIZE (echo_om_node, env, om_output);
- buffer = AXIS2_XML_WRITER_GET_XML (xml_writer, env);
+ buffer = (axis2_char_t*)AXIS2_XML_WRITER_GET_XML (xml_writer, env);
AXIS2_LOG_DEBUG ((*env)->log, AXIS2_LOG_SI,
"\nSending OM node in XML : %s \n", buffer);
- writer = axis2_xml_writer_create_for_memory (env, NULL, AXIS2_TRUE, 0);
+ writer = axis2_xml_writer_create_for_memory (env, NULL, AXIS2_TRUE, 0,
+ AXIS2_XML_PARSER_TYPE_BUFFER);
om_output = axis2_om_output_create (env, writer);
AXIS2_OM_NODE_SERIALIZE (envelope_node, env, om_output);
- buffer = AXIS2_XML_WRITER_GET_XML (writer, env);
+ buffer = (axis2_char_t*)AXIS2_XML_WRITER_GET_XML (writer, env);
printf ("Sending :\n%s\n", buffer);
return echo_om_node;
}
@@ -376,10 +377,11 @@
axis2_xml_writer_t *writer = NULL;
axis2_om_output_t *om_output = NULL;
axis2_char_t *buffer = NULL;
- writer = axis2_xml_writer_create_for_memory (env, NULL, AXIS2_TRUE, 0);
+ writer = axis2_xml_writer_create_for_memory (env, NULL, AXIS2_TRUE, 0,
+ AXIS2_XML_PARSER_TYPE_BUFFER);
om_output = axis2_om_output_create (env, writer);
AXIS2_OM_NODE_SERIALIZE (ret_node, env, om_output);
- buffer = AXIS2_XML_WRITER_GET_XML (writer, env);
+ buffer = (axis2_char_t*)AXIS2_XML_WRITER_GET_XML (writer, env);
printf ("Received : \n%s\n", buffer);
}
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=405685&r1=405684&r2=405685&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 Wed May 10 02:07:08 2006
@@ -293,11 +293,12 @@
text_om_ele = axis2_om_element_create(env, echo_om_node, input_type_buff, NULL, &text_om_node);
AXIS2_OM_ELEMENT_SET_TEXT(text_om_ele, env, word_to_echo, text_om_node);
- xml_writer = axis2_xml_writer_create_for_memory(env, NULL, AXIS2_FALSE, AXIS2_FALSE);
+ xml_writer = axis2_xml_writer_create_for_memory(env, NULL, AXIS2_FALSE, AXIS2_FALSE,
+ AXIS2_XML_PARSER_TYPE_BUFFER);
om_output = axis2_om_output_create( env, xml_writer);
AXIS2_OM_NODE_SERIALIZE(echo_om_node, env, om_output);
- buffer = AXIS2_XML_WRITER_GET_XML(xml_writer, env);
+ buffer = (axis2_char_t*)AXIS2_XML_WRITER_GET_XML(xml_writer, env);
AXIS2_LOG_DEBUG((*env)->log, AXIS2_LOG_SI, "\nSending OM node in XML : %s \n", buffer);
return echo_om_node;
@@ -309,10 +310,11 @@
axis2_xml_writer_t *writer = NULL;
axis2_om_output_t *om_output = NULL;
axis2_char_t *buffer = NULL;
- writer = axis2_xml_writer_create_for_memory(env, NULL, AXIS2_TRUE, 0);
+ writer = axis2_xml_writer_create_for_memory(env, NULL, AXIS2_TRUE, 0,
+ AXIS2_XML_PARSER_TYPE_BUFFER);
om_output = axis2_om_output_create (env, writer);
AXIS2_OM_NODE_SERIALIZE (ret_node, env, om_output);
- buffer = AXIS2_XML_WRITER_GET_XML(writer, env);
+ buffer = (axis2_char_t*)AXIS2_XML_WRITER_GET_XML(writer, env);
printf ("\nReceived OM as result : %s\n", buffer);
}
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=405685&r1=405684&r2=405685&view=diff
==============================================================================
--- webservices/axis2/trunk/c/test/xml/om/test_om.c (original)
+++ webservices/axis2/trunk/c/test/xml/om/test_om.c Wed May 10 02:07:08 2006
@@ -73,7 +73,7 @@
return -1;
/** create pull parser */
- reader = axis2_xml_reader_create_for_memory(&environment, read_input,NULL ,NULL, NULL);
+ reader = axis2_xml_reader_create_for_io(&environment, read_input,NULL ,NULL, NULL);
if(!reader)
{
@@ -165,12 +165,13 @@
printf ("Serialize pulled document\n");
- writer = axis2_xml_writer_create_for_memory(&environment, NULL, AXIS2_TRUE, 0);
+ writer = axis2_xml_writer_create_for_memory(&environment, NULL, AXIS2_TRUE, 0,
+ AXIS2_XML_PARSER_TYPE_BUFFER);
om_output = axis2_om_output_create (&environment, writer);
AXIS2_OM_NODE_SERIALIZE (node1, &environment , om_output);
- buffer = AXIS2_XML_WRITER_GET_XML(writer, &environment);
+ buffer = (axis2_char_t*)AXIS2_XML_WRITER_GET_XML(writer, &environment);
AXIS2_OM_OUTPUT_FREE(om_output, &environment);
if(buffer)
@@ -244,7 +245,8 @@
/* serializing stuff */
- writer = axis2_xml_writer_create_for_memory(&environment, NULL, AXIS2_TRUE, 0);
+ writer = axis2_xml_writer_create_for_memory(&environment, NULL, AXIS2_TRUE, 0,
+ AXIS2_XML_PARSER_TYPE_BUFFER);
om_output = axis2_om_output_create (&environment, writer);
printf ("Serialize built document\n");
@@ -259,7 +261,7 @@
/* end serializing stuff */
AXIS2_OM_NODE_FREE_TREE(node1,&environment);
- output_buffer = AXIS2_XML_WRITER_GET_XML(writer, &environment);
+ output_buffer = (axis2_char_t*)AXIS2_XML_WRITER_GET_XML(writer, &environment);
AXIS2_OM_OUTPUT_FREE(om_output, &environment);
if(output_buffer)
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=405685&r1=405684&r2=405685&view=diff
==============================================================================
--- webservices/axis2/trunk/c/test/xml/soap/test_soap.c (original)
+++ webservices/axis2/trunk/c/test/xml/soap/test_soap.c Wed May 10 02:07:08 2006
@@ -112,7 +112,7 @@
return -1;
printf(" \n\n _________ Test SOAP BUILD ___________ \n\n ");
- xml_reader = axis2_xml_reader_create_for_memory(env, read_soap,close_soap ,NULL, NULL);
+ xml_reader = axis2_xml_reader_create_for_io(env, read_soap,close_soap ,NULL, NULL);
if(!xml_reader)
{
printf("%s \n", AXIS2_ERROR_GET_MESSAGE((*env)->error));
@@ -203,7 +203,8 @@
}
}
- xml_writer = axis2_xml_writer_create_for_memory(env, NULL, AXIS2_FALSE, AXIS2_FALSE);
+ xml_writer = axis2_xml_writer_create_for_memory(env, NULL, AXIS2_FALSE, AXIS2_FALSE,
+ AXIS2_XML_PARSER_TYPE_BUFFER);
if(!xml_writer)
{
AXIS2_SOAP_BUILDER_FREE(soap_builder, env);
@@ -221,7 +222,7 @@
AXIS2_SOAP_ENVELOPE_SERIALIZE(soap_envelope, env, om_output, AXIS2_FALSE);
- buffer = AXIS2_XML_WRITER_GET_XML(xml_writer, env);
+ buffer = (axis2_char_t*)AXIS2_XML_WRITER_GET_XML(xml_writer, env);
printf("\n\nThe serialized xml is >>>>>>>>>>>>>\n\n\n%s \n\n\n", buffer);
@@ -294,13 +295,14 @@
fault_code = axis2_soap_fault_code_create_with_parent(env, soap_fault);
- xml_writer = axis2_xml_writer_create_for_memory(env, NULL, AXIS2_FALSE, AXIS2_FALSE);
+ xml_writer = axis2_xml_writer_create_for_memory(env, NULL, AXIS2_FALSE, AXIS2_FALSE,
+ AXIS2_XML_PARSER_TYPE_BUFFER);
om_output = axis2_om_output_create( env, xml_writer);
AXIS2_SOAP_ENVELOPE_SERIALIZE(soap_envelope, env, om_output, AXIS2_FALSE);
- buffer = AXIS2_XML_WRITER_GET_XML(xml_writer, env);
+ buffer = (axis2_char_t*)AXIS2_XML_WRITER_GET_XML(xml_writer, env);
printf("%s \n", buffer);
@@ -336,10 +338,11 @@
axis2_soap_fault_detail_create_with_parent(env, soap_fault);
axis2_soap_fault_role_create_with_parent(env, soap_fault);
- xml_writer = axis2_xml_writer_create_for_memory(env, NULL, AXIS2_FALSE, AXIS2_FALSE);
+ xml_writer = axis2_xml_writer_create_for_memory(env, NULL, AXIS2_FALSE, AXIS2_FALSE,
+ AXIS2_XML_PARSER_TYPE_BUFFER);
om_output = axis2_om_output_create( env, xml_writer);
AXIS2_SOAP_ENVELOPE_SERIALIZE(soap_envelope, env, om_output, AXIS2_FALSE);
- buffer = AXIS2_XML_WRITER_GET_XML(xml_writer, env);
+ buffer = (axis2_char_t*)AXIS2_XML_WRITER_GET_XML(xml_writer, env);
printf("%s \n", buffer);
AXIS2_FREE((*env)->allocator, buffer);
AXIS2_SOAP_ENVELOPE_FREE(soap_envelope, env);
Modified: webservices/axis2/trunk/c/xdocs/docs/om_tutorial.html
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/xdocs/docs/om_tutorial.html?rev=405685&r1=405684&r2=405685&view=diff
==============================================================================
--- webservices/axis2/trunk/c/xdocs/docs/om_tutorial.html (original)
+++ webservices/axis2/trunk/c/xdocs/docs/om_tutorial.html Wed May 10 02:07:08 2006
@@ -576,7 +576,7 @@
om_output = axis2_om_output_create(env, xml_writer);
AXIS2_SOAP_ENVELOPE_SERIALIZE(envelope, env, om_output);
-buffer = AXIS2_XML_WRITER_GET_XML(xml_writer, env);
+buffer = (axis2_char_t*)AXIS2_XML_WRITER_GET_XML(xml_writer, env);
printf("%s ", buffer);</pre>
<p>An easy way to serialize is to use the to_string function in om_element</p>
@@ -610,10 +610,10 @@
<p>axis2_xml_reader_create_for_file() functon can be used to read from a
file.</p>
-<p>axis2_xml_reader_create_for_memory uses a user defined callback function
+<p>axis2_xml_reader_create_for_io uses a user defined callback function
to pull xml.</p>
-<p>axis2_xml_reader_create_for_buffer can be used to read from an xml string
+<p>axis2_xml_reader_create_for_memory can be used to read from an xml string
that is in a character buffer.</p>
<p>Similarly xml_writer provides two create functions,</p>
@@ -739,7 +739,7 @@
axis2_char_t *buffer = NULL;
f = fopen("test.xml","r");
- xml_reader = axis2_xml_reader_create_for_memory(env, read_input_callback,
+ xml_reader = axis2_xml_reader_create_for_io(env, read_input_callback,
close_input_callback, NULL, NULL);
<b>if</b>(!xml_reader)
<b>return</b> -1;
@@ -776,12 +776,12 @@
}
AXIS2_OM_DOCUMENT_BUILD_ALL(document, env);
- xml_writer = axis2_xml_writer_create_for_memory(env, NULL, AXIS2_TRUE, 0);
+ xml_writer = axis2_xml_writer_create_for_memory(env, NULL, AXIS2_TRUE, 0, AXIS2_XML_PARSER_TYPE_BUFFER);
om_output = axis2_om_output_create(env, xml_writer);
AXIS2_OM_NODE_SERIALIZE(root_node, env, om_output);
- buffer = AXIS2_XML_WRITER_GET_XML(xml_writer, env);
+ buffer = (axis2_char_t*)AXIS2_XML_WRITER_GET_XML(xml_writer, env);
printf("The output XML is ->>>>\n %s ", buffer);
Modified: webservices/axis2/trunk/c/xdocs/docs/userguide2.html
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/xdocs/docs/userguide2.html?rev=405685&r1=405684&r2=405685&view=diff
==============================================================================
--- webservices/axis2/trunk/c/xdocs/docs/userguide2.html (original)
+++ webservices/axis2/trunk/c/xdocs/docs/userguide2.html Wed May 10 02:07:08 2006
@@ -453,7 +453,7 @@
<font color="#000000">writer</font> = <font
color="#000000">axis2_xml_writer_create_for_memory</font>(&<font
color="#000000">env</font>, <font color="#000000">NULL</font>, <font
-color="#000000">AXIS2_TRUE</font>, <font color="#0000FF">0</font>);<br>
+color="#000000">AXIS2_TRUE</font>, <font color="#0000FF">0</font>,| <font color="#0000FF">AXIS2_XML_PARSER_TYPE_BUFFER</font>);<br>
<font color="#000000">om_output</font> = <font
color="#000000">axis2_om_output_create</font> (&<font
color="#000000">env</font>, <font color="#000000">writer</font>);<br>
@@ -462,7 +462,7 @@
color="#000000">ret_node</font>, &<font color="#000000">env</font>, <font
color="#000000">om_output</font>);<br>
<font color="#000000">buffer</font> = <font
-color="#000000">AXIS2_XML_WRITER_GET_XML</font>(<font
+color="#000000">(axis2_char_t*)AXIS2_XML_WRITER_GET_XML</font>(<font
color="#000000">writer</font>, &<font color="#000000">env</font>);<br>
<font color="#000000">printf</font> (<font
color="#FF0000">"\nReceived OM node in XML : %s\n"</font>, <font
@@ -549,7 +549,7 @@
color="#000000">axis2_xml_writer_create_for_memory</font>(<font
color="#000000">env</font>, <font color="#000000">NULL</font>, <font
color="#000000">AXIS2_FALSE</font>, <font
-color="#000000">AXIS2_FALSE</font>);<br>
+color="#000000">AXIS2_FALSE</font>,| <font color="#0000FF">AXIS2_XML_PARSER_TYPE_BUFFER</font>);<br>
<font color="#000000">om_output</font> = <font
color="#000000">axis2_om_output_create</font>( <font
color="#000000">env</font>, <font color="#000000">xml_writer</font>);<br>
@@ -558,7 +558,7 @@
color="#000000">echo_om_node</font>, <font color="#000000">env</font>, <font
color="#000000">om_output</font>);<br>
<font color="#000000">buffer</font> = <font
-color="#000000">AXIS2_XML_WRITER_GET_XML</font>(<font
+color="#000000">(axis2_char_t*)AXIS2_XML_WRITER_GET_XML</font>(<font
color="#000000">xml_writer</font>, <font
color="#000000">env</font>); <br>
<font color="#000000">printf</font>(<font
@@ -757,11 +757,11 @@
<br>
<font color="#808080"><i>/*we just serialize the SOAP message and output to stdout */</i></font><br>
<font color="#000000">printf</font>(<font color="#FF0000">"\necho stub invoke SUCCESSFUL!\n"</font>);<br>
- <font color="#000000">writer</font> = <font color="#000000">axis2_xml_writer_create_for_memory</font>(<font color="#000000">env</font>, <font color="#000000">NULL</font>, <font color="#000000">AXIS2_TRUE</font>, <font color="#0000FF">0</font>);<br>
+ <font color="#000000">writer</font> = <font color="#000000">axis2_xml_writer_create_for_memory</font>(<font color="#000000">env</font>, <font color="#000000">NULL</font>, <font color="#000000">AXIS2_TRUE</font>, <font color="#0000FF">0</font>,| <font color="#0000FF">AXIS2_XML_PARSER_TYPE_BUFFER</font>);<br>
<font color="#000000">om_output</font> = <font color="#000000">axis2_om_output_create</font> (<font color="#000000">env</font>, <font color="#000000">writer</font>);<br>
<br>
<font color="#000000">AXIS2_OM_NODE_SERIALIZE</font> (<font color="#000000">ret_node</font>, <font color="#000000">env</font>, <font color="#000000">om_output</font>);<br>
- <font color="#000000">buffer</font> = <font color="#000000">AXIS2_XML_WRITER_GET_XML</font>(<font color="#000000">writer</font>, <font color="#000000">env</font>);<br>
+ <font color="#000000">buffer</font> = <font color="#000000">(axis2_char_t*)AXIS2_XML_WRITER_GET_XML</font>(<font color="#000000">writer</font>, <font color="#000000">env</font>);<br>
<font color="#000000">printf</font> (<font color="#FF0000">"\nReceived OM node in XML : %s\n"</font>, <font color="#000000">buffer</font>);<br>
<font color="#000000">AXIS2_OM_OUTPUT_FREE</font>(<font color="#000000">om_output</font>, <font color="#000000">env</font>);<br>
<font color="#000000">AXIS2_FREE</font>((*<font color="#000000">env</font>)-><font color="#000000">allocator</font>, <font color="#000000">buffer</font>);<br>