axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sam...@apache.org
Subject svn commit: r367659 - in /webservices/axis2/trunk/c: configure.ac include/axis2_http_transport.h include/axis2_stream.h modules/core/transport/http/axis2_http_transport_utils.c test/util/test_util.c
Date Tue, 10 Jan 2006 15:47:53 GMT
Author: samisa
Date: Tue Jan 10 07:47:33 2006
New Revision: 367659

URL: http://svn.apache.org/viewcvs?rev=367659&view=rev
Log:
fixed configure.ac

Modified:
    webservices/axis2/trunk/c/configure.ac
    webservices/axis2/trunk/c/include/axis2_http_transport.h
    webservices/axis2/trunk/c/include/axis2_stream.h
    webservices/axis2/trunk/c/modules/core/transport/http/axis2_http_transport_utils.c
    webservices/axis2/trunk/c/test/util/test_util.c

Modified: webservices/axis2/trunk/c/configure.ac
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/configure.ac?rev=367659&r1=367658&r2=367659&view=diff
==============================================================================
--- webservices/axis2/trunk/c/configure.ac (original)
+++ webservices/axis2/trunk/c/configure.ac Tue Jan 10 07:47:33 2006
@@ -125,7 +125,7 @@
     test/unit/core/deployment/Makefile \
     test/unit/util/Makefile \
     test/unit/xml/Makefile \
-    test/unit/xml/om/Makefile
+    test/unit/xml/om/Makefile\
     test/core/transport/Makefile\
     test/core/transport/http/Makefile
     ])

Modified: webservices/axis2/trunk/c/include/axis2_http_transport.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_http_transport.h?rev=367659&r1=367658&r2=367659&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_http_transport.h (original)
+++ webservices/axis2/trunk/c/include/axis2_http_transport.h Tue Jan 10 07:47:33 2006
@@ -238,6 +238,11 @@
     #define AXIS2_HTTP_HEADER_ACCEPT_TEXT_PLAIN "text/plain"
     
     /**
+     * HEADER_ACCEPT_TEXT_XML
+     */
+    #define AXIS2_HTTP_HEADER_ACCEPT_TEXT_XML "text/xml"
+
+    /**
      * HEADER_ACCEPT_APPL_SOAP
      */
     #define AXIS2_HTTP_HEADER_ACCEPT_APPL_SOAP "application/soap+xml"

Modified: webservices/axis2/trunk/c/include/axis2_stream.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_stream.h?rev=367659&r1=367658&r2=367659&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_stream.h (original)
+++ webservices/axis2/trunk/c/include/axis2_stream.h Tue Jan 10 07:47:33 2006
@@ -70,7 +70,7 @@
 	 * reads from stream
 	 * @param buffer buffer into which the content is to be read
 	 * @param count size of the buffer
-	 * @return so: of bytes read
+	 * @return no: of bytes read
 	 */
    
 	int (AXIS2_CALL *read) (axis2_stream_t *stream, axis2_env_t **env, 

Modified: webservices/axis2/trunk/c/modules/core/transport/http/axis2_http_transport_utils.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/transport/http/axis2_http_transport_utils.c?rev=367659&r1=367658&r2=367659&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/axis2_http_transport_utils.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/axis2_http_transport_utils.c Tue
Jan 10 07:47:33 2006
@@ -21,6 +21,8 @@
 #include <axis2_op.h>
 #include <axis2_qname.h>
 #include <axis2_http_transport.h>
+#include <axis2_soap_envelope.h>
+#include <axis2_soap_model_builder.h>
 
 /***************************** Function headers *******************************/
 
@@ -40,10 +42,10 @@
                         axis2_char_t *request_uri, axis2_conf_ctx_t *conf_ctx, 
                         axis2_hash_t *request_params);
     
-/*axis2_soap_envelope_t* AXIS2_CALL 
+axis2_soap_envelope_t* AXIS2_CALL 
 axis2_http_transport_utils_create_envelope_from_get_request
                         (axis2_env_t **env, axis2_char_t *request_uri,
-                        axis2_hash_t *request_params);*/
+                        axis2_hash_t *request_params);
     
 axis2_om_stax_builder_t* AXIS2_CALL 
 axis2_http_transport_utils_select_builder_for_mime
@@ -88,6 +90,14 @@
                         axis2_char_t *soap_action_header,
                         axis2_char_t *request_uri)
 {
+	axis2_soap_envelope_t *soap_envelope = NULL;
+	axis2_soap_model_builder_t *soap_builder = NULL;
+	axis2_om_stax_builder_t *om_builder = NULL;
+	axis2_bool_t is_soap11 = AXIS2_FALSE;
+	axis2_xml_reader_t *xml_reader = NULL;
+	axis2_char_t *char_set = NULL;
+	axis2_char_t *xml_char_set = NULL;
+	
     AXIS2_PARAM_CHECK((*env)->error, msg_ctx, AXIS2_FAILURE);
 	AXIS2_PARAM_CHECK((*env)->error, in_stream, AXIS2_FAILURE);
 	AXIS2_PARAM_CHECK((*env)->error, out_stream, AXIS2_FAILURE);
@@ -105,20 +115,60 @@
 		{
 			soap_action_header[strlen(soap_action_header) -1] = '\0';
 		}
-		AXIS2_MSG_CTX_SET_WSA_ACTION(msg_ctx, env, soap_action_header);
-		AXIS2_MSG_CTX_SET_SOAP_ACTION(msg_ctx, env, soap_action_header);
-		AXIS2_MSG_CTX_SET_TO(msg_ctx, env, axis2_endpoint_ref_create(env, 
-						request_uri));
-		AXIS2_MSG_CTX_SET_PROPERTY(msg_ctx, env, 
-						AXIS2_TRANSPORT_OUT, out_stream, AXIS2_FALSE);
-		AXIS2_MSG_CTX_SET_SERVER_SIDE(msg_ctx, env, AXIS2_TRUE);
-		
-		
 	}
+	AXIS2_MSG_CTX_SET_WSA_ACTION(msg_ctx, env, soap_action_header);
+	AXIS2_MSG_CTX_SET_SOAP_ACTION(msg_ctx, env, soap_action_header);
+	AXIS2_MSG_CTX_SET_TO(msg_ctx, env, axis2_endpoint_ref_create(env, 
+					request_uri));
+	AXIS2_MSG_CTX_SET_PROPERTY(msg_ctx, env, 
+					AXIS2_TRANSPORT_OUT, out_stream, AXIS2_FALSE);
+	AXIS2_MSG_CTX_SET_SERVER_SIDE(msg_ctx, env, AXIS2_TRUE);
+	
+	/* xml_reader = axis2_xml_reader_create_for_memory(env, );*/
+	char_set = axis2_http_transport_utils_get_charset_enc(env,content_type);
+	/* TODO set the charset of the stream before (at least default)
+	 *	we read them
+	 */
+	AXIS2_MSG_CTX_SET_PROPERTY(msg_ctx, env, AXIS2_CHARACTER_SET_ENCODING,
+					char_set, AXIS2_TRUE);
+	om_builder = axis2_om_stax_builder_create(env, xml_reader);
+	if(NULL != strstr(content_type, AXIS2_HTTP_HEADER_ACCEPT_APPL_SOAP))
+	{
+		is_soap11 = AXIS2_FALSE;
+		soap_builder = axis2_soap_model_builder_create(env, om_builder);
+		/* TODO set the soap12 namespace URI */
+		envelope = AXIS2_SOAP_MODEL_BUILDER_GET_SOAP_ENVELOPE(soap_builder,
+					env);
+	}
+	else if(NULL != strstr(content_type, AXIS2_HTTP_HEADER_ACCEPT_TEXT_XML))
+	{
+		is_soap11 = AXIS2_TRUE;
+		if(NULL != soap_action_header && AXIS2_STRLEN(soap_action_header)
+					> 0))
+		{
+			soap_builder = axis2_soap_model_builder_create(env, om_builder);
+			/* TODO set the soap11 namespace URI */
+			envelope = AXIS2_SOAP_MODEL_BUILDER_GET_DOCUMENT_ELEMENT(
+					soap_builder, env);
+		}
+		/* REST support
+		 * else
+		 * {
+		 *		envelope = AXIS2_SOAP_ENVELOPE_GET_DEFAULT_SOAP_ENVELOPE(
+		 *			env);
+		 *		AXIS2_SOAP_BODY_ADD_CHILD(AXIS2_SOAP_ENVELOPE_GET_BODY(
+		 *			envelope, env), AXIS2_OM_STAX_BUILDER_GET_DOCUMENT(
+		 *			om_builder, env));
+		 */			
+	}
+	xml_char_set = AXIS2_OM_DOCUAXIS2_OM_STAX_BUILDER_GET_DOCUMENT(env om_builder)
+	
+	
+	
 	/*
-        TODO code
-    */
-    return AXIS2_SUCCESS;
+		TODO code
+	*/
+	return AXIS2_SUCCESS;
 }
 
 
@@ -134,13 +184,13 @@
 }
 
 
-/*axis2_soap_envelope_t* AXIS2_CALL 
+axis2_soap_envelope_t* AXIS2_CALL 
 axis2_http_transport_utils_create_envelope_from_get_request
                         (axis2_env_t **env, axis2_char_t *request_uri,
                         axis2_hash_t *request_params)
 {
     return NULL;
-}*/
+}
 
 
 axis2_om_stax_builder_t* AXIS2_CALL 

Modified: webservices/axis2/trunk/c/test/util/test_util.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/test/util/test_util.c?rev=367659&r1=367658&r2=367659&view=diff
==============================================================================
--- webservices/axis2/trunk/c/test/util/test_util.c (original)
+++ webservices/axis2/trunk/c/test/util/test_util.c Tue Jan 10 07:47:33 2006
@@ -32,8 +32,7 @@
 {
 	axis2_allocator_t *allocator = axis2_allocator_init (NULL);
     axis2_error_t *error = axis2_error_create (allocator);
-	axis2_stream_t *stream = axis2_stream_create (allocator, NULL);
-    axis2_env_t *env = axis2_env_create_with_error_stream (allocator, error, stream);
+    axis2_env_t *env = axis2_env_create_with_error(allocator, error);
 	return env;
 }
 
@@ -109,8 +108,7 @@
 	{
 		axis2_allocator_t *allocator = axis2_allocator_init (NULL);
 		axis2_error_t *error = axis2_error_create (allocator);
-		axis2_stream_t *stream = axis2_stream_create (allocator, NULL);
-        *env = axis2_env_create_with_error_stream (allocator, error, stream);
+        *env = axis2_env_create_with_error(allocator, error);
 		AXIS2_ERROR_SET_STATUS_CODE((*env)->error, AXIS2_FAILURE);
 		AXIS2_ERROR_SET_ERROR_NUMBER((*env)->error, AXIS2_ERROR_ENVIRONMENT_IS_NULL);	
 		return AXIS2_STRDUP("env is null!!!", env);
@@ -146,7 +144,7 @@
     a *entry = NULL;
     
     
-    al = axis2_array_list_create (&env, 10);
+    al = axis2_array_list_create (&env, 1);
     
     entry = (a *) AXIS2_MALLOC(env->allocator, sizeof (a));
     entry->value = AXIS2_STRDUP("value1", &env);
@@ -166,6 +164,14 @@
     
     entry = (a *) AXIS2_MALLOC(env->allocator, sizeof (a));
     entry->value = AXIS2_STRDUP("value5", &env);
+    AXIS2_ARRAY_LIST_ADD (al, &env, (void*)entry);
+
+    entry = (a *) AXIS2_MALLOC(env->allocator, sizeof (a));
+    entry->value = AXIS2_STRDUP("value6", &env);
+    AXIS2_ARRAY_LIST_ADD (al, &env, (void*)entry);
+
+    entry = (a *) AXIS2_MALLOC(env->allocator, sizeof (a));
+    entry->value = AXIS2_STRDUP("value7", &env);
     AXIS2_ARRAY_LIST_SET (al, &env, 3, (void*)entry);
     AXIS2_ARRAY_LIST_REMOVE (al, &env, 2);
     



Mime
View raw message