axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r417135 [1/2] - in /webservices/axis2/trunk/c: axiom/src/om/ include/ modules/core/clientapi/ modules/core/context/ modules/core/deployment/ modules/core/description/ modules/core/engine/ modules/core/phaseresolver/ modules/core/receivers/ ...
Date Mon, 26 Jun 2006 07:05:22 GMT
Author: sahan
Date: Mon Jun 26 00:05:20 2006
New Revision: 417135

URL: http://svn.apache.org/viewvc?rev=417135&view=rev
Log:
1. Adding xml schema support to the axis2_svc and axis2_msg
2. Enabling REST GET case in both client side and server side

Modified:
    webservices/axis2/trunk/c/axiom/src/om/om_element.c
    webservices/axis2/trunk/c/include/axis2_http_transport.h
    webservices/axis2/trunk/c/include/axis2_http_transport_utils.h
    webservices/axis2/trunk/c/include/axis2_msg.h
    webservices/axis2/trunk/c/include/axis2_svc.h
    webservices/axis2/trunk/c/modules/core/clientapi/Makefile.am
    webservices/axis2/trunk/c/modules/core/context/Makefile.am
    webservices/axis2/trunk/c/modules/core/deployment/Makefile.am
    webservices/axis2/trunk/c/modules/core/description/Makefile.am
    webservices/axis2/trunk/c/modules/core/description/msg.c
    webservices/axis2/trunk/c/modules/core/description/svc.c
    webservices/axis2/trunk/c/modules/core/engine/Makefile.am
    webservices/axis2/trunk/c/modules/core/phaseresolver/Makefile.am
    webservices/axis2/trunk/c/modules/core/receivers/Makefile.am
    webservices/axis2/trunk/c/modules/core/transport/http/Makefile.am
    webservices/axis2/trunk/c/modules/core/transport/http/http_header.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/core/transport/http/receiver/Makefile.am
    webservices/axis2/trunk/c/modules/core/transport/http/sender/Makefile.am
    webservices/axis2/trunk/c/modules/core/transport/http/sender/rest_sender.c
    webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/Makefile.am
    webservices/axis2/trunk/c/modules/core/transport/http/server/simple_axis2_server/Makefile.am
    webservices/axis2/trunk/c/modules/core/util/Makefile.am
    webservices/axis2/trunk/c/modules/mod_addr/Makefile.am
    webservices/axis2/trunk/c/modules/wsdl/Makefile.am
    webservices/axis2/trunk/c/samples/user_guide/clients/echo_rest.c
    webservices/axis2/trunk/c/test/core/clientapi/Makefile.am
    webservices/axis2/trunk/c/test/core/context/Makefile.am
    webservices/axis2/trunk/c/test/core/deployment/Makefile.am
    webservices/axis2/trunk/c/test/core/description/Makefile.am
    webservices/axis2/trunk/c/test/core/engine/Makefile.am
    webservices/axis2/trunk/c/test/itest/whitemesa/round1/Makefile.am
    webservices/axis2/trunk/c/test/itest/whitemesa/round2/Makefile.am
    webservices/axis2/trunk/c/test/unit/Makefile.am
    webservices/axis2/trunk/c/test/unit/core/deployment/Makefile.am
    webservices/axis2/trunk/c/test/unit/core/description/Makefile.am
    webservices/axis2/trunk/c/test/unit/core/engine/Makefile.am
    webservices/axis2/trunk/c/test/unit/core/phaseresolver/Makefile.am
    webservices/axis2/trunk/c/test/unit/wsdl/Makefile.am
    webservices/axis2/trunk/c/util/include/axis2_error.h
    webservices/axis2/trunk/c/util/src/error.c
    webservices/axis2/trunk/c/util/src/network_handler.c

Modified: webservices/axis2/trunk/c/axiom/src/om/om_element.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/src/om/om_element.c?rev=417135&r1=417134&r2=417135&view=diff
==============================================================================
--- webservices/axis2/trunk/c/axiom/src/om/om_element.c (original)
+++ webservices/axis2/trunk/c/axiom/src/om/om_element.c Mon Jun 26 00:05:20 2006
@@ -443,7 +443,7 @@
     axis2_char_t *localpart = NULL;
     
     AXIS2_ENV_CHECK(env, NULL);
-    if (!qname || !(*node))
+    if (!qname || !node)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_NULL_PARAM, AXIS2_FAILURE);
         return NULL;           

Modified: webservices/axis2/trunk/c/include/axis2_http_transport.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/include/axis2_http_transport.h?rev=417135&r1=417134&r2=417135&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_http_transport.h (original)
+++ webservices/axis2/trunk/c/include/axis2_http_transport.h Mon Jun 26 00:05:20 2006
@@ -388,6 +388,11 @@
      */
     #define AXIS2_PROXY_HOST_PORT "proxy_port"
     
+    /**
+     * Constant for HTTP method
+     */
+    #define AXIS2_HTTP_METHOD "HTTP_METHOD"
+    
 /** @} */
     
 #ifdef __cplusplus

Modified: webservices/axis2/trunk/c/include/axis2_http_transport_utils.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/include/axis2_http_transport_utils.h?rev=417135&r1=417134&r2=417135&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_http_transport_utils.h (original)
+++ webservices/axis2/trunk/c/include/axis2_http_transport_utils.h Mon Jun 26 00:05:20 2006
@@ -81,12 +81,6 @@
                         axis2_conf_ctx_t *conf_ctx, 
                         axis2_hash_t *request_params);
     
-AXIS2_EXTERN axiom_soap_envelope_t* AXIS2_CALL
-axis2_http_transport_utils_create_envelope_from_get_request
-                        (const axis2_env_t *env, 
-                        const axis2_char_t *request_uri,
-                        axis2_hash_t *request_params);
-    
 AXIS2_EXTERN axiom_stax_builder_t* AXIS2_CALL
 axis2_http_transport_utils_select_builder_for_mime
                         (const axis2_env_t *env, axis2_char_t *request_uri,

Modified: webservices/axis2/trunk/c/include/axis2_msg.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/include/axis2_msg.h?rev=417135&r1=417134&r2=417135&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_msg.h (original)
+++ webservices/axis2/trunk/c/include/axis2_msg.h Mon Jun 26 00:05:20 2006
@@ -135,6 +135,11 @@
         axis2_msg_t *msg, 
         const axis2_env_t *env,
         const axis2_char_t *name);
+
+    xml_schema_element_t *(AXIS2_CALL *
+        get_schema_element)
+            (axis2_msg_t *msg,
+            const axis2_env_t *env);
 };
 
 /** 
@@ -201,6 +206,8 @@
 #define AXIS2_MSG_SET_NAME(msg, env, name) \
       ((msg)->ops->set_name(msg, env, name))
 
+#define AXIS2_MSG_GET_SCHEMA_ELEMENT(msg, env) \
+      ((msg)->ops->get_schema_element(msg, env))
 /************************** End of function macros ****************************/
 
 /** @} */

Modified: webservices/axis2/trunk/c/include/axis2_svc.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/include/axis2_svc.h?rev=417135&r1=417134&r2=417135&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_svc.h (original)
+++ webservices/axis2/trunk/c/include/axis2_svc.h Mon Jun 26 00:05:20 2006
@@ -37,6 +37,10 @@
 #include <axis2_wsdl_soap_op.h>
 #include <axis2_string.h>
 #include <axis2_wsdl_endpoint.h>
+#include <xml_schema.h>
+#include <xml_schema_external.h>
+#include <axis2_stream.h>
+#include <xml_schema_element.h>
 
 #ifdef __cplusplus
 extern "C"
@@ -401,7 +405,126 @@
     
     axis2_array_list_t *(AXIS2_CALL *
     get_modules) (axis2_svc_t *svc,
-                            const axis2_env_t *env);                
+                            const axis2_env_t *env);
+    
+    axis2_bool_t (AXIS2_CALL *
+    is_schema_location_adjusted)(axis2_svc_t *svc,
+                            const axis2_env_t *env);
+    
+    
+    axis2_status_t (AXIS2_CALL *
+    set_schema_location_adjusted)(axis2_svc_t *svc,
+                            const axis2_env_t *env,
+                            axis2_bool_t adjusted);
+    
+    axis2_hash_t* (AXIS2_CALL *
+    get_schema_mapping_table)(axis2_svc_t *svc,
+                            const axis2_env_t *env);
+    
+    axis2_status_t (AXIS2_CALL *
+    set_schema_mapping_table)(axis2_svc_t *svc,
+                            const axis2_env_t *env,
+                            axis2_hash_t *table);
+                            
+    axis2_char_t* (AXIS2_CALL *
+    get_schema_custom_schema_prefix)(axis2_svc_t *svc,
+                            const axis2_env_t *env);
+                            
+    axis2_status_t (AXIS2_CALL *
+    set_schema_custom_schema_prefix)(axis2_svc_t *svc,
+                            const axis2_env_t *env,
+                            axis2_char_t *prefix);
+                            
+    axis2_char_t* (AXIS2_CALL *
+    get_schema_custom_schema_suffix)(axis2_svc_t *svc,
+                            const axis2_env_t *env);
+                            
+    axis2_status_t (AXIS2_CALL *
+    set_schema_custom_schema_suffix)(axis2_svc_t *svc,
+                            const axis2_env_t *env,
+                            axis2_char_t *suffix);
+                            
+    axis2_status_t (AXIS2_CALL *
+    print_schema)(axis2_svc_t *svc,
+                            const axis2_env_t *env,
+                            axis2_stream_t *out_stream);
+    
+    xml_schema_t* (AXIS2_CALL *
+    get_schema)(axis2_svc_t *svc,
+                            const axis2_env_t *env,
+                            int index);
+                            
+    xml_schema_t* (AXIS2_CALL *
+    add_namespaces)(axis2_svc_t *svc,
+                            const axis2_env_t *env,
+                            int index);
+                            
+    axis2_array_list_t* (AXIS2_CALL *
+    get_schemas)(axis2_svc_t *svc,
+                            const axis2_env_t *env);
+    
+    axis2_status_t (AXIS2_CALL *
+    add_schema)(axis2_svc_t *svc,
+                            const axis2_env_t *env,
+                            xml_schema_t *schema);
+                            
+    axis2_status_t (AXIS2_CALL *
+    add_schemas)(axis2_svc_t *svc,
+                            const axis2_env_t *env,
+                            axis2_array_list_t *schemas);
+    
+    axis2_char_t* (AXIS2_CALL *
+    get_schema_target_ns)(axis2_svc_t *svc,
+                            const axis2_env_t *env);
+                            
+    axis2_status_t (AXIS2_CALL *
+    set_schema_target_ns)(axis2_svc_t *svc,
+                            const axis2_env_t *env,
+                            axis2_char_t *ns);
+                            
+    axis2_char_t* (AXIS2_CALL *
+    get_schema_target_ns_prefix)(axis2_svc_t *svc,
+                            const axis2_env_t *env);
+                            
+    axis2_status_t (AXIS2_CALL *
+    set_schema_target_ns_prefix)(axis2_svc_t *svc,
+                            const axis2_env_t *env,
+                            axis2_char_t *prefix);
+    
+    axis2_char_t* (AXIS2_CALL *
+    get_target_ns)(axis2_svc_t *svc,
+                            const axis2_env_t *env);
+                            
+    axis2_status_t (AXIS2_CALL *
+    set_target_ns)(axis2_svc_t *svc,
+                            const axis2_env_t *env,
+                            axis2_char_t *ns);                        
+    axis2_char_t* (AXIS2_CALL *
+    get_target_ns_prefix)(axis2_svc_t *svc,
+                            const axis2_env_t *env);
+                            
+    axis2_status_t (AXIS2_CALL *
+    set_target_ns_prefix)(axis2_svc_t *svc,
+                            const axis2_env_t *env,
+                            axis2_char_t *prefix);
+                            
+    xml_schema_element_t* (AXIS2_CALL *
+    get_schema_element)(axis2_svc_t *svc,
+                            const axis2_env_t *env,
+                            axis2_qname_t *qname);
+    
+    axis2_hash_t* (AXIS2_CALL *
+    get_ns_map)(axis2_svc_t *svc,
+                            const axis2_env_t *env);
+                            
+    axis2_status_t (AXIS2_CALL *
+    set_ns_map)(axis2_svc_t *svc,
+                            const axis2_env_t *env,
+                            axis2_hash_t *ns_map);
+    
+    axis2_status_t (AXIS2_CALL *
+    populate_schema_mappings)(axis2_svc_t *svc,
+                            const axis2_env_t *env);
 };
 
 /** 
@@ -579,7 +702,85 @@
         
 #define AXIS2_SVC_GET_MODULES(svc, env) \
         ((svc)->ops->get_modules(svc, env))
+        
+#define AXIS2_SVC_IS_SCHEMA_LOCATION_ADJUSTED(svc, env) \
+        ((svc)->ops->is_schema_location_adjusted(svc, env))
+        
+#define AXIS2_SVC_SET_SCHEMA_LOCATION_ADJUSTED(svc, env, adjusted) \
+        ((svc)->ops->set_schema_location_adjusted(svc, env, adjusted))
+        
+#define AXIS2_SVC_GET_SCHEMA_MAPPING_TABLE(svc, env) \
+        ((svc)->ops->get_schema_mapping_table(svc, env))
+
+#define AXIS2_SVC_SET_SCHEMA_MAPPING_TABLE(svc, env, table) \
+        ((svc)->ops->set_schema_mapping_table(svc, env, table))
+        
+#define AXIS2_SVC_GET_SCHEMA_CUSTOM_NAME_PREFIX(svc, env) \
+        ((svc)->ops->get_schema_custom_schema_prefix(svc, env))
+
+#define AXIS2_SVC_SET_SCHEMA_CUSTOM_NAME_PREFIX(svc, env, prefix) \
+        ((svc)->ops->set_schema_custom_schema_prefix(svc, env, prefix))
+
+#define AXIS2_SVC_GET_SCHEMA_CUSTOM_NAME_SUFFIX(svc, env) \
+        ((svc)->ops->get_schema_custom_schema_suffix(svc, env))
+
+#define AXIS2_SVC_SET_SCHEMA_CUSTOM_NAME_SUFFIX(svc, env, suffix) \
+        ((svc)->ops->set_schema_custom_schema_suffix(svc, env, suffix))    
+    
+#define AXIS2_SVC_PRINT_SCHEMA(svc, env) \
+        ((svc)->ops->print_schema(svc, env))    
+    
+#define AXIS2_SVC_GET_SCHEMA(svc, env, index) \
+        ((svc)->ops->get_schema(svc, env, index))
 
+#define AXIS2_SVC_ADD_NAMESPACES(svc, env, index) \
+        ((svc)->ops->add_namespaces(svc, env, index))
+
+#define AXIS2_SVC_GET_SCHEMAS(svc, env) \
+        ((svc)->ops->get_schemas(svc, env))
+    
+#define AXIS2_SVC_ADD_SCHEMA(svc, env, schema) \
+        ((svc)->ops->add_schema(svc, env, schema))
+    
+#define AXIS2_SVC_ADD_SCHEMAS(svc, env, schemas) \
+        ((svc)->ops->add_schemas(svc, env, schemas))
+
+#define AXIS2_SVC_GET_SCHEMA_TARGET_NAME_SPACE(svc, env) \
+        ((svc)->ops->get_schema_target_ns(svc, env))
+
+#define AXIS2_SVC_SET_SCHEMA_TARGET_NAME_SPACE(svc, env, ns) \
+        ((svc)->ops->set_schema_target_ns(svc, env, ns))
+        
+#define AXIS2_SVC_GET_SCHEMA_TARGET_NAME_SPACE_PREFIX(svc, env) \
+        ((svc)->ops->get_schema_target_ns_prefix(svc, env))
+
+#define AXIS2_SVC_SET_SCHEMA_TARGET_NAME_SPACE_PREFIX(svc, env, prefix) \
+        ((svc)->ops->set_schema_target_ns_prefix(svc, env, prefix))
+
+#define AXIS2_SVC_GET_TARGET_NAME_SPACE(svc, env) \
+        ((svc)->ops->get_target_ns(svc, env))
+
+#define AXIS2_SVC_SET_TARGET_NAME_SPACE(svc, env, ns) \
+        ((svc)->ops->set_target_ns(svc, env, ns))    
+
+#define AXIS2_SVC_GET_TARGET_NAME_SPACE_PREFIX(svc, env) \
+        ((svc)->ops->get_target_ns_prefix(svc, env))
+
+#define AXIS2_SVC_SET_TARGET_NAME_SPACE_PREFIX(svc, env, prefix) \
+        ((svc)->ops->set_target_ns_prefix(svc, env, prefix)) 
+    
+#define AXIS2_SVC_GET_SCHEMA_ELEMENT(svc, env) \
+        ((svc)->ops->get_schema_element(svc, env))
+    
+#define AXIS2_SVC_GET_NAME_SPACE_MAP(svc, env) \
+        ((svc)->ops->get_ns_map(svc, env))
+
+#define AXIS2_SVC_SET_NAME_SPACE_MAP(svc, env, ns_map) \
+        ((svc)->ops->set_ns_map(svc, env, ns_map)) 
+    
+#define AXIS2_SVC_POPULATE_SCHEMA_MAPPINGS(svc, env) \
+        ((svc)->ops->populate_schema_mappings(svc, env))
+    
 /**************************** End of function macros **************************/
 
 /** @} */

Modified: webservices/axis2/trunk/c/modules/core/clientapi/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/clientapi/Makefile.am?rev=417135&r1=417134&r2=417135&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/clientapi/Makefile.am (original)
+++ webservices/axis2/trunk/c/modules/core/clientapi/Makefile.am Mon Jun 26 00:05:20 2006
@@ -21,6 +21,7 @@
             -I$(top_builddir)/modules/wsdl \
             -I$(top_builddir)/modules/core/engine \
             -I$(top_builddir)/modules/core/deployment \
+            -I$(top_builddir)/xml_schema/include\
 			@AXIOMINC@ \
 			@UTILINC@ 
 

Modified: webservices/axis2/trunk/c/modules/core/context/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/context/Makefile.am?rev=417135&r1=417134&r2=417135&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/context/Makefile.am (original)
+++ webservices/axis2/trunk/c/modules/core/context/Makefile.am Mon Jun 26 00:05:20 2006
@@ -11,5 +11,6 @@
 INCLUDES = -I$(top_builddir)/include \
             -I$(top_builddir)/modules/wsdl \
             -I$(top_builddir)/modules/core/engine \
+            -I$(top_builddir)/xml_schema/include\
 			@AXIOMINC@ \
 			@UTILINC@ 

Modified: webservices/axis2/trunk/c/modules/core/deployment/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/deployment/Makefile.am?rev=417135&r1=417134&r2=417135&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/deployment/Makefile.am (original)
+++ webservices/axis2/trunk/c/modules/core/deployment/Makefile.am Mon Jun 26 00:05:20 2006
@@ -36,5 +36,6 @@
             -I$(top_builddir)/modules/core/phaseresolver \
             -I$(top_builddir)/modules/core/deployment \
             -I$(top_builddir)/modules/core/util \
+            -I$(top_builddir)/xml_schema/include\
 			@AXIOMINC@ \
 			@UTILINC@ 

Modified: webservices/axis2/trunk/c/modules/core/description/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/description/Makefile.am?rev=417135&r1=417134&r2=417135&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/description/Makefile.am (original)
+++ webservices/axis2/trunk/c/modules/core/description/Makefile.am Mon Jun 26 00:05:20 2006
@@ -19,4 +19,5 @@
             -I$(top_builddir)/modules/wsdl \
             -I$(top_builddir)/modules/core/engine \
 			@AXIOMINC@ \
-			@UTILINC@ 
+			@UTILINC@ \
+            -I$(top_builddir)/xml_schema/include

Modified: webservices/axis2/trunk/c/modules/core/description/msg.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/description/msg.c?rev=417135&r1=417134&r2=417135&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/description/msg.c (original)
+++ webservices/axis2/trunk/c/modules/core/description/msg.c Mon Jun 26 00:05:20 2006
@@ -16,6 +16,7 @@
  
 #include <axis2_msg.h>
 #include <axis2_property.h>
+#include <xml_schema_obj_collection.h>
 
 /** 
  * @brief Message struct impl
@@ -109,6 +110,10 @@
 axis2_msg_set_name(axis2_msg_t *msg, 
     const axis2_env_t *env,
     const axis2_char_t *name);
+    
+xml_schema_element_t *AXIS2_CALL
+axis2_msg_get_schema_element(axis2_msg_t *msg,
+    const axis2_env_t *env);
 
 
 /************************* End of function headers ****************************/   
@@ -183,6 +188,7 @@
    msg_impl->msg.ops->set_element_qname = axis2_msg_set_element_qname;
    msg_impl->msg.ops->get_name = axis2_msg_get_name;
    msg_impl->msg.ops->set_name = axis2_msg_set_name;
+   msg_impl->msg.ops->get_schema_element = axis2_msg_get_schema_element;
     
    return &(msg_impl->msg);
 }
@@ -467,31 +473,60 @@
     return AXIS2_SUCCESS;
 }
 
-/*
-TODO: implement when xml schema is in place
-xml_schema_element *AXIS2_CALL 
+
+xml_schema_element_t *AXIS2_CALL 
 axis2_msg_get_schema_element(axis2_msg_t *msg, 
     const axis2_env_t *env) 
 {
-    AxisService service = (AxisService) getParent().getParent();
-    axis2_array_list_t *schemas = service.getSchema();
-    for (int i = 0; i < schemas.size(); i++) {
-        XmlSchema schema = (XmlSchema) schemas.get(i);
-        if (schema.getItems() != null) {
-            Iterator schemaItems = schema.getItems().getIterator();
-            while (schemaItems.hasNext()) {
-                Object item = schemaItems.next();
-                if (item instanceof xml_schema_element) {
-                    xml_schema_element schema_element = (xml_schema_element) item;
-                    if (schema_element.getQName().equals(getElementQName())) {
-                        return schema_element;
+    axis2_msg_impl_t *msg_impl = NULL;
+    axis2_op_t *operation = NULL;
+    axis2_svc_t *svc = NULL;
+    axis2_array_list_t *schemas = NULL;
+    int i = 0;
+    int schemas_size = 0;
+    
+    AXIS2_ENV_CHECK(env, NULL);
+    
+    msg_impl = AXIS2_INTF_TO_IMPL(msg);
+    operation = axis2_msg_get_parent(msg, env);
+    svc = AXIS2_OP_GET_PARENT(operation, env);
+    schemas = AXIS2_SVC_GET_SCHEMAS(svc, env);
+    schemas_size = AXIS2_ARRAY_LIST_SIZE(schemas, env);
+    for (i = 0; i < schemas_size; i++) 
+    {
+        xml_schema_t *schema = NULL;
+        xml_schema_obj_collection_t *schema_collection = NULL;
+        
+        schema = AXIS2_ARRAY_LIST_GET(schemas, env, i);
+        schema_collection = XML_SCHEMA_GET_ITEMS(schema, env);
+        if (NULL != schema_collection) 
+        {
+            int count = 0;
+            int j = 0;
+            
+            count = XML_SCHEMA_OBJ_COLLECTION_GET_COUNT(schema_collection, env);
+            for(j = 0; j < count; j++)
+            {
+                xml_schema_obj_t *schema_obj = NULL;
+                schema_obj = XML_SCHEMA_OBJ_COLLECTION_GET_ITEM(
+                        schema_collection, env, j);
+                if(NULL == schema_obj && XML_SCHEMA_ELEMENT == 
+                        XML_SCHEMA_OBJ_GET_TYPE(schema_obj, env))
+                {
+                    axis2_qname_t *schema_qname = NULL;
+                    schema_qname = XML_SCHEMA_ELEMENT_GET_QNAME(schema_obj, env);
+                    if(NULL != msg_impl->element_qname && AXIS2_TRUE == 
+                        AXIS2_QNAME_EQUALS(msg_impl->element_qname, env,
+                        schema_qname))
+                    {
+                        return (xml_schema_element_t*)schema_obj;
                     }
                 }
             }
         }
     }
-    return null;
-}*/
+    return NULL;
+}
 
 axis2_char_t *AXIS2_CALL 
 axis2_msg_get_name(axis2_msg_t *msg, 

Modified: webservices/axis2/trunk/c/modules/core/description/svc.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/description/svc.c?rev=417135&r1=417134&r2=417135&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/description/svc.c (original)
+++ webservices/axis2/trunk/c/modules/core/description/svc.c Mon Jun 26 00:05:20 2006
@@ -17,6 +17,7 @@
 #include <axis2_svc.h>
 #include <axis2_addr.h>
 #include <axis2_property.h>
+#include <xml_schema_obj_collection.h>
 
 typedef struct axis2_svc_impl axis2_svc_impl_t;
    
@@ -26,17 +27,56 @@
  */ 
 struct axis2_svc_impl
 {
-   axis2_svc_t svc;
-   axis2_svc_grp_t *parent;
-   axis2_hash_t *wasaction_op_map;  
+    axis2_svc_t svc;
+    axis2_svc_grp_t *parent;
+    axis2_hash_t *wasaction_op_map;  
     axis2_char_t *axis_svc_name; 
     /** to keep the time that last update time of the service */
     long last_update;
     axis2_char_t *filename;
     /* axis2_wsdl_svc_t *service_impl; */
     /** to store module ref at deploy time parsing */
-    axis2_array_list_t *module_list;    
-
+    axis2_array_list_t *module_list;
+    /**
+     * WSDL related stuff
+     */
+    axis2_hash_t *ns_map;
+    /* count of the entires in the ns map */
+     int ns_count;
+    /* to keep the XMLScheama getting either from WSDL or 
+     * C2WSDL(in the future)
+     */
+    axis2_array_list_t *schema_list;    
+    /**
+     * A table that keeps a mapping of unique xsd names (Strings)
+     * against the schema objects. This is populated in the first
+     * instance the schemas are asked for and then used to serve
+     * the subsequent requests
+     */
+    axis2_hash_t *schema_mapping_table;
+    /**
+     * Keeps track whether the schema locations are adjusted
+     */
+    axis2_bool_t schema_loc_adjusted;
+    /**
+     * A custom schema Name prefix. if set this will be used to
+     * modify the schema names
+     */
+    axis2_char_t *custom_schema_name_prefix;
+    /**
+     * A custom schema name suffix. will be attached to the
+     * schema file name when the files are uniquely named.
+     * A good place to add a file extension if needed
+     */
+    axis2_char_t *custom_schema_name_suffix;
+    /* to store the target namespace for the schema */
+    axis2_char_t *schema_target_ns;
+    axis2_char_t *schema_target_ns_prefix;
+    /* to keep the service target name space */
+    axis2_char_t *target_ns;
+    axis2_char_t *target_ns_prefix;
+    /* Used for schema name calculations */
+    int sc_calc_count;
 };
 
 #define AXIS2_INTF_TO_IMPL(svc) ((axis2_svc_impl_t *)svc)
@@ -261,10 +301,150 @@
 axis2_array_list_t *AXIS2_CALL
 axis2_svc_get_modules(axis2_svc_t *svc,
                         const axis2_env_t *env);
+                        
+axis2_bool_t AXIS2_CALL
+axis2_svc_is_schema_location_adjusted(axis2_svc_t *svc,
+                        const axis2_env_t *env);
+
+
+axis2_status_t AXIS2_CALL
+axis2_svc_set_schema_location_adjusted(axis2_svc_t *svc,
+                        const axis2_env_t *env,
+                        axis2_bool_t adjusted);
+
+axis2_hash_t* AXIS2_CALL
+axis2_svc_get_schema_mapping_table(axis2_svc_t *svc,
+                        const axis2_env_t *env);
+
+axis2_status_t AXIS2_CALL
+axis2_svc_set_schema_mapping_table(axis2_svc_t *svc,
+                        const axis2_env_t *env,
+                        axis2_hash_t *table);
+                        
+axis2_char_t* AXIS2_CALL
+axis2_svc_get_schema_custom_schema_prefix(axis2_svc_t *svc,
+                        const axis2_env_t *env);
+                        
+axis2_status_t AXIS2_CALL
+axis2_svc_set_schema_custom_schema_prefix(axis2_svc_t *svc,
+                        const axis2_env_t *env,
+                        axis2_char_t *prefix);
+                        
+axis2_char_t* AXIS2_CALL
+axis2_svc_get_schema_custom_schema_suffix(axis2_svc_t *svc,
+                        const axis2_env_t *env);
+                        
+axis2_status_t AXIS2_CALL
+axis2_svc_set_schema_custom_schema_suffix(axis2_svc_t *svc,
+                        const axis2_env_t *env,
+                        axis2_char_t *suffix);
+                        
+axis2_status_t AXIS2_CALL
+axis2_svc_print_schema(axis2_svc_t *svc,
+                        const axis2_env_t *env,
+                        axis2_stream_t *out_stream);
+
+xml_schema_t* AXIS2_CALL
+axis2_svc_get_schema(axis2_svc_t *svc,
+                        const axis2_env_t *env,
+                        int index);
+                        
+xml_schema_t* AXIS2_CALL
+axis2_svc_add_namespaces(axis2_svc_t *svc,
+                        const axis2_env_t *env,
+                        int index);
+                        
+axis2_array_list_t* AXIS2_CALL
+axis2_svc_get_schemas(axis2_svc_t *svc,
+                        const axis2_env_t *env);
+
+axis2_status_t AXIS2_CALL
+axis2_svc_add_schema(axis2_svc_t *svc,
+                        const axis2_env_t *env,
+                        xml_schema_t *schema);
+                        
+axis2_status_t AXIS2_CALL
+axis2_svc_add_schemas(axis2_svc_t *svc,
+                        const axis2_env_t *env,
+                        axis2_array_list_t *schemas);
+
+axis2_char_t* AXIS2_CALL
+axis2_svc_get_schema_target_ns(axis2_svc_t *svc,
+                        const axis2_env_t *env);
+                        
+axis2_status_t AXIS2_CALL
+axis2_svc_set_schema_target_ns(axis2_svc_t *svc,
+                        const axis2_env_t *env,
+                        axis2_char_t *ns);
+                        
+axis2_char_t* AXIS2_CALL
+axis2_svc_get_schema_target_ns_prefix(axis2_svc_t *svc,
+                        const axis2_env_t *env);
+                        
+axis2_status_t AXIS2_CALL
+axis2_svc_set_schema_target_ns_prefix(axis2_svc_t *svc,
+                        const axis2_env_t *env,
+                        axis2_char_t *prefix);
+
+axis2_char_t* AXIS2_CALL
+axis2_svc_get_target_ns(axis2_svc_t *svc,
+                        const axis2_env_t *env);
+                        
+axis2_status_t AXIS2_CALL
+axis2_svc_set_target_ns(axis2_svc_t *svc,
+                        const axis2_env_t *env,
+                        axis2_char_t *ns);                        
+axis2_char_t* AXIS2_CALL
+axis2_svc_get_target_ns_prefix(axis2_svc_t *svc,
+                        const axis2_env_t *env);
+                        
+axis2_status_t AXIS2_CALL
+axis2_svc_set_target_ns_prefix(axis2_svc_t *svc,
+                        const axis2_env_t *env,
+                        axis2_char_t *prefix);
+                        
+xml_schema_element_t* AXIS2_CALL
+axis2_svc_get_schema_element(axis2_svc_t *svc,
+                        const axis2_env_t *env,
+                        axis2_qname_t *qname);
+
+axis2_hash_t* AXIS2_CALL
+axis2_svc_get_ns_map(axis2_svc_t *svc,
+                        const axis2_env_t *env);
+                        
+axis2_status_t AXIS2_CALL
+axis2_svc_set_ns_map(axis2_svc_t *svc,
+                        const axis2_env_t *env,
+                        axis2_hash_t *ns_map);
+
+axis2_status_t AXIS2_CALL
+axis2_svc_add_schema_ns(axis2_svc_t *svc,
+                        const axis2_env_t *env,
+                        axis2_char_t *ns);
+                        
+axis2_status_t AXIS2_CALL
+axis2_svc_populate_schema_mappings(axis2_svc_t *svc,
+                        const axis2_env_t *env);
 
+axis2_status_t AXIS2_CALL
+axis2_svc_calculate_schema_names(axis2_svc_t *svc,
+                        const axis2_env_t *env,
+                        xml_schema_t *schema,
+                        axis2_hash_t *names);
+                        
+axis2_status_t AXIS2_CALL
+axis2_svc_adjust_schema_names(axis2_svc_t *svc,
+                        const axis2_env_t *env,
+                        xml_schema_t *schema,
+                        axis2_hash_t *names);
+
+axis2_hash_t* AXIS2_CALL
+axis2_svc_swap_mapping_table(axis2_svc_t *svc,
+                        const axis2_env_t *env,
+                        axis2_hash_t *orig_table);
 /************************* End of function headers ***************************/
 
-axis2_svc_t * AXIS2_CALL
+AXIS2_EXTERN axis2_svc_t * AXIS2_CALL
 axis2_svc_create (const axis2_env_t *env)
 {
     axis2_svc_impl_t *svc_impl = NULL;
@@ -293,6 +473,18 @@
     svc_impl->svc.wsdl_svc = NULL;
     svc_impl->wasaction_op_map = NULL;
     svc_impl->module_list = NULL;
+    svc_impl->ns_map = NULL;
+    svc_impl->ns_count = 0;
+    svc_impl->schema_list = NULL;    
+    svc_impl->schema_mapping_table = NULL;
+    svc_impl->schema_loc_adjusted = AXIS2_FALSE;
+    svc_impl->custom_schema_name_prefix = NULL;
+    svc_impl->custom_schema_name_suffix = NULL;
+    svc_impl->schema_target_ns = NULL;
+    svc_impl->schema_target_ns_prefix = NULL;
+    svc_impl->target_ns = NULL;
+    svc_impl->target_ns_prefix = NULL;
+    svc_impl->sc_calc_count = 0;
     
     svc_impl->svc.param_container = axis2_param_container_create(env);      
    if(NULL == svc_impl->svc.param_container)
@@ -397,18 +589,32 @@
         return NULL;
     }
     
-   svc_impl->svc.ops->free = axis2_svc_free;
-   svc_impl->svc.ops->add_op = axis2_svc_add_op;
-   svc_impl->svc.ops->get_op_with_qname = axis2_svc_get_op_with_qname;
-   svc_impl->svc.ops->get_op_with_name = axis2_svc_get_op_with_name;
-   svc_impl->svc.ops->get_ops = axis2_svc_get_ops;
-   svc_impl->svc.ops->set_parent = axis2_svc_set_parent;
-   svc_impl->svc.ops->get_parent = axis2_svc_get_parent;
+    svc_impl->schema_list = axis2_array_list_create(env, 
+                        AXIS2_ARRAY_LIST_DEFAULT_CAPACITY);    
+    if(NULL == svc_impl->schema_list)
+    {
+        axis2_svc_free(&(svc_impl->svc), env);
+        return NULL;
+    }
+    
+    svc_impl->schema_loc_adjusted = AXIS2_FALSE;
+    svc_impl->schema_target_ns_prefix = AXIS2_STRDUP("ns", env);
+    svc_impl->target_ns = AXIS2_STRDUP("http://ws.apache.org/axis2", env);
+    svc_impl->target_ns_prefix = AXIS2_STRDUP("tns", env);
+    svc_impl->sc_calc_count = 0;
+   
+    svc_impl->svc.ops->free = axis2_svc_free;
+    svc_impl->svc.ops->add_op = axis2_svc_add_op;
+    svc_impl->svc.ops->get_op_with_qname = axis2_svc_get_op_with_qname;
+    svc_impl->svc.ops->get_op_with_name = axis2_svc_get_op_with_name;
+    svc_impl->svc.ops->get_ops = axis2_svc_get_ops;
+    svc_impl->svc.ops->set_parent = axis2_svc_set_parent;
+    svc_impl->svc.ops->get_parent = axis2_svc_get_parent;
     svc_impl->svc.ops->set_qname = axis2_svc_set_qname;
-   svc_impl->svc.ops->get_qname = axis2_svc_get_qname;
-   svc_impl->svc.ops->add_param = axis2_svc_add_param;
-   svc_impl->svc.ops->get_param = axis2_svc_get_param;
-   svc_impl->svc.ops->get_params = axis2_svc_get_params;
+    svc_impl->svc.ops->get_qname = axis2_svc_get_qname;
+    svc_impl->svc.ops->add_param = axis2_svc_add_param;
+    svc_impl->svc.ops->get_param = axis2_svc_get_param;
+    svc_impl->svc.ops->get_params = axis2_svc_get_params;
     svc_impl->svc.ops->is_param_locked = axis2_svc_is_param_locked;
     svc_impl->svc.ops->set_svc_interface = axis2_svc_set_svc_interface;
     svc_impl->svc.ops->get_svc_interface = axis2_svc_get_svc_interface;
@@ -448,7 +654,45 @@
     svc_impl->svc.ops->add_module_ref = axis2_svc_add_module_ref;
     svc_impl->svc.ops->get_modules = axis2_svc_get_modules;
     
-   return &(svc_impl->svc);   
+    svc_impl->svc.ops->is_schema_location_adjusted = 
+                        axis2_svc_is_schema_location_adjusted;
+    svc_impl->svc.ops->set_schema_location_adjusted = 
+                        axis2_svc_set_schema_location_adjusted;
+    svc_impl->svc.ops->get_schema_mapping_table = 
+                        axis2_svc_get_schema_mapping_table;
+    svc_impl->svc.ops->set_schema_mapping_table = 
+                        axis2_svc_set_schema_mapping_table;
+    svc_impl->svc.ops->get_schema_custom_schema_prefix = 
+                        axis2_svc_get_schema_custom_schema_prefix;
+    svc_impl->svc.ops->set_schema_custom_schema_prefix = 
+                        axis2_svc_set_schema_custom_schema_prefix;
+    svc_impl->svc.ops->get_schema_custom_schema_suffix = 
+                        axis2_svc_get_schema_custom_schema_suffix;
+    svc_impl->svc.ops->set_schema_custom_schema_suffix = 
+                        axis2_svc_set_schema_custom_schema_suffix;
+    svc_impl->svc.ops->print_schema = axis2_svc_print_schema;
+    svc_impl->svc.ops->get_schema = axis2_svc_get_schema;
+    svc_impl->svc.ops->add_namespaces = axis2_svc_add_namespaces;
+    svc_impl->svc.ops->get_schemas = axis2_svc_get_schemas;
+    svc_impl->svc.ops->add_schema = axis2_svc_add_schema;
+    svc_impl->svc.ops->add_schemas = axis2_svc_add_schemas;
+    svc_impl->svc.ops->get_schema_target_ns = axis2_svc_get_schema_target_ns;
+    svc_impl->svc.ops->set_schema_target_ns = axis2_svc_set_schema_target_ns;
+    svc_impl->svc.ops->get_schema_target_ns_prefix = 
+                        axis2_svc_get_schema_target_ns_prefix;
+    svc_impl->svc.ops->set_schema_target_ns_prefix = 
+                        axis2_svc_set_schema_target_ns_prefix;
+    svc_impl->svc.ops->get_target_ns = axis2_svc_get_target_ns;
+    svc_impl->svc.ops->set_target_ns = axis2_svc_set_target_ns;
+    svc_impl->svc.ops->get_target_ns_prefix = axis2_svc_get_target_ns_prefix;
+    svc_impl->svc.ops->set_target_ns_prefix = axis2_svc_set_target_ns_prefix;
+    svc_impl->svc.ops->get_schema_element = axis2_svc_get_schema_element;
+    svc_impl->svc.ops->get_ns_map = axis2_svc_get_ns_map;
+    svc_impl->svc.ops->set_ns_map = axis2_svc_set_ns_map;
+    svc_impl->svc.ops->populate_schema_mappings = 
+                        axis2_svc_populate_schema_mappings;
+    
+    return &(svc_impl->svc);   
 }
 
 axis2_svc_t * AXIS2_CALL
@@ -477,6 +721,7 @@
    return &(svc_impl->svc);
 }
 
+
 AXIS2_EXTERN axis2_svc_t * AXIS2_CALL
 axis2_svc_create_with_wsdl_svc (const axis2_env_t *env, 
                                 axis2_wsdl_svc_t *wsdl_svc)
@@ -1636,4 +1881,648 @@
     AXIS2_ENV_CHECK(env, NULL);
     
     return AXIS2_INTF_TO_IMPL(svc)->module_list;
+}
+
+axis2_bool_t AXIS2_CALL
+axis2_svc_is_schema_location_adjusted(axis2_svc_t *svc,
+                        const axis2_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FALSE);
+    return AXIS2_INTF_TO_IMPL(svc)->schema_loc_adjusted;
+}
+
+
+axis2_status_t AXIS2_CALL
+axis2_svc_set_schema_location_adjusted(axis2_svc_t *svc,
+                        const axis2_env_t *env,
+                        axis2_bool_t adjusted)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_INTF_TO_IMPL(svc)->schema_loc_adjusted = adjusted;
+    return AXIS2_SUCCESS;
+}
+
+axis2_hash_t* AXIS2_CALL
+axis2_svc_get_schema_mapping_table(axis2_svc_t *svc,
+                        const axis2_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, NULL);
+    return AXIS2_INTF_TO_IMPL(svc)->schema_mapping_table;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_svc_set_schema_mapping_table(axis2_svc_t *svc,
+                        const axis2_env_t *env,
+                        axis2_hash_t *table)
+{
+    axis2_svc_impl_t *svc_impl = NULL;
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, table, AXIS2_FAILURE);
+    
+    svc_impl = AXIS2_INTF_TO_IMPL(svc);
+    if(NULL != svc_impl->schema_mapping_table)
+    {
+        axis2_hash_free(svc_impl->schema_mapping_table, env);
+        svc_impl->schema_mapping_table = NULL;
+    }
+    svc_impl->schema_mapping_table = table;
+    return AXIS2_SUCCESS;
+}
+                        
+axis2_char_t* AXIS2_CALL
+axis2_svc_get_schema_custom_schema_prefix(axis2_svc_t *svc,
+                        const axis2_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, NULL);
+    return AXIS2_INTF_TO_IMPL(svc)->custom_schema_name_prefix;
+}
+                        
+axis2_status_t AXIS2_CALL
+axis2_svc_set_schema_custom_schema_prefix(axis2_svc_t *svc,
+                        const axis2_env_t *env,
+                        axis2_char_t *prefix)
+{
+    axis2_svc_impl_t *svc_impl = NULL;
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    
+    svc_impl = AXIS2_INTF_TO_IMPL(svc);
+    if(NULL != svc_impl->custom_schema_name_prefix)
+    {
+        AXIS2_FREE(env->allocator, svc_impl->custom_schema_name_prefix);
+        svc_impl->custom_schema_name_prefix = NULL;
+    }
+    svc_impl->custom_schema_name_prefix = AXIS2_STRDUP(prefix, env);
+    if(NULL == svc_impl->custom_schema_name_prefix)
+    {
+        return AXIS2_FAILURE;
+    }
+    return AXIS2_SUCCESS;
+}
+
+                        
+axis2_char_t* AXIS2_CALL
+axis2_svc_get_schema_custom_schema_suffix(axis2_svc_t *svc,
+                        const axis2_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, NULL);
+    return AXIS2_INTF_TO_IMPL(svc)->custom_schema_name_suffix;
+}
+                        
+axis2_status_t AXIS2_CALL
+axis2_svc_set_schema_custom_schema_suffix(axis2_svc_t *svc,
+                        const axis2_env_t *env,
+                        axis2_char_t *suffix)
+{
+    axis2_svc_impl_t *svc_impl = NULL;
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    
+    svc_impl = AXIS2_INTF_TO_IMPL(svc);
+    if(NULL != svc_impl->custom_schema_name_suffix)
+    {
+        AXIS2_FREE(env->allocator, svc_impl->custom_schema_name_suffix);
+        svc_impl->custom_schema_name_suffix = NULL;
+    }
+    svc_impl->custom_schema_name_suffix = AXIS2_STRDUP(suffix, env);
+    if(NULL == svc_impl->custom_schema_name_suffix)
+    {
+        return AXIS2_FAILURE;
+    }
+    return AXIS2_SUCCESS;
+}
+                        
+axis2_status_t AXIS2_CALL
+axis2_svc_print_schema(axis2_svc_t *svc,
+                        const axis2_env_t *env,
+                        axis2_stream_t *out_stream)
+{
+    axis2_svc_impl_t *svc_impl = NULL;
+    int size = 0;
+    int i = 0;
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    
+    svc_impl = AXIS2_INTF_TO_IMPL(svc);
+    if(NULL == svc_impl->schema_list)
+    {
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_EMPTY_SCHEMA_LIST, 
+                        AXIS2_FAILURE);
+        return AXIS2_FAILURE;
+    }
+    
+    size = AXIS2_ARRAY_LIST_SIZE(svc_impl->schema_list, env);
+    for(i = 0; i < size; i++)
+    {
+        xml_schema_t *schema = NULL;
+        axis2_char_t *buffer = NULL;
+        schema = AXIS2_ARRAY_LIST_GET(svc_impl->schema_list, env, i);
+        buffer = XML_SCHEMA_SERIALIZE(schema, env);
+        if(NULL != buffer)
+        {
+            AXIS2_STREAM_WRITE(out_stream, env, buffer, AXIS2_STRLEN(buffer));
+        }
+        AXIS2_FREE(env->allocator, buffer);
+    }
+    return AXIS2_SUCCESS;
+}
+
+xml_schema_t* AXIS2_CALL
+axis2_svc_get_schema(axis2_svc_t *svc,
+                        const axis2_env_t *env,
+                        int index)
+{
+    AXIS2_ENV_CHECK(env, NULL);
+    return axis2_svc_add_namespaces(svc, env, index);
+}
+                        
+xml_schema_t* AXIS2_CALL
+axis2_svc_add_namespaces(axis2_svc_t *svc,
+                        const axis2_env_t *env,
+                        int index)
+{
+    xml_schema_t *schema = NULL;
+    axis2_svc_impl_t *svc_impl = NULL;
+    axis2_hash_t *prefix_map = NULL;
+    axis2_hash_index_t *hi = NULL;
+    
+    AXIS2_ENV_CHECK(env, NULL);
+    
+    svc_impl = AXIS2_INTF_TO_IMPL(svc);
+    if(NULL == svc_impl->schema_list)
+    {
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_EMPTY_SCHEMA_LIST, 
+                        AXIS2_FAILURE);
+        return NULL;
+    }
+    schema = (xml_schema_t*)AXIS2_ARRAY_LIST_GET(svc_impl->schema_list, env, index);
+    prefix_map = XML_SCHEMA_GET_PREFIX_TO_NAMESPACE_MAP(schema, env);
+    if(NULL == prefix_map)
+    {
+        return NULL;
+    }
+    for (hi = axis2_hash_first (svc_impl->ns_map, env); NULL != hi; 
+                        hi = axis2_hash_next (env, hi))
+    {
+        axis2_char_t *value = NULL;
+        axis2_char_t *key = NULL;
+        axis2_hash_this (hi, (const void **)&key, NULL, (void **)&value);
+        if(NULL != value)
+        {
+            axis2_hash_set(prefix_map, key, AXIS2_HASH_KEY_STRING, value);
+        }
+     }
+     return schema;
+}
+
+axis2_array_list_t* AXIS2_CALL
+axis2_svc_get_schemas(axis2_svc_t *svc,
+                        const axis2_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, NULL);
+    return AXIS2_INTF_TO_IMPL(svc)->schema_list;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_svc_add_schema(axis2_svc_t *svc,
+                        const axis2_env_t *env,
+                        xml_schema_t *schema)
+{
+    axis2_svc_impl_t *svc_impl = NULL;
+    
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, schema, AXIS2_FAILURE);
+    
+    svc_impl = AXIS2_INTF_TO_IMPL(svc);
+    if(NULL == svc_impl->schema_list)
+    {
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_EMPTY_SCHEMA_LIST, 
+                        AXIS2_FAILURE);
+        return AXIS2_FAILURE;
+    }
+    AXIS2_ARRAY_LIST_ADD(svc_impl->schema_list, env, schema);
+    return axis2_svc_add_schema_ns(svc, env, XML_SCHEMA_GET_TARGET_NAMESPACE(
+                        schema, env));
+}
+                        
+axis2_status_t AXIS2_CALL
+axis2_svc_add_schemas(axis2_svc_t *svc,
+                        const axis2_env_t *env,
+                        axis2_array_list_t *schemas)
+{
+    int i = 0;
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, schemas, AXIS2_FAILURE);
+    
+    for(i = 0; i < AXIS2_ARRAY_LIST_SIZE(schemas, env); i++)
+    {
+        xml_schema_t *schema = AXIS2_ARRAY_LIST_GET(schemas, env, i);
+        axis2_svc_add_schema(svc, env, schema);
+    }
+    return AXIS2_SUCCESS;
+}
+
+axis2_char_t* AXIS2_CALL
+axis2_svc_get_schema_target_ns(axis2_svc_t *svc,
+                        const axis2_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, NULL);
+    return AXIS2_INTF_TO_IMPL(svc)->schema_target_ns;
+}
+                        
+axis2_status_t AXIS2_CALL
+axis2_svc_set_schema_target_ns(axis2_svc_t *svc,
+                        const axis2_env_t *env,
+                        axis2_char_t *ns)
+{
+    axis2_svc_impl_t *svc_impl = NULL;
+    
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, ns, AXIS2_FAILURE);
+    
+    svc_impl = AXIS2_INTF_TO_IMPL(svc);
+    if(NULL != svc_impl->schema_target_ns)
+    {
+        AXIS2_FREE(env->allocator, svc_impl->schema_target_ns);
+        svc_impl->schema_target_ns = NULL;
+    }
+    svc_impl->schema_target_ns = AXIS2_STRDUP(ns, env);
+    return AXIS2_SUCCESS;
+}
+                        
+axis2_char_t* AXIS2_CALL
+axis2_svc_get_schema_target_ns_prefix(axis2_svc_t *svc,
+                        const axis2_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, NULL);
+    return AXIS2_INTF_TO_IMPL(svc)->schema_target_ns_prefix;
+}
+                        
+axis2_status_t AXIS2_CALL
+axis2_svc_set_schema_target_ns_prefix(axis2_svc_t *svc,
+                        const axis2_env_t *env,
+                        axis2_char_t *prefix)
+{
+    axis2_svc_impl_t *svc_impl = NULL;
+    
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, prefix, AXIS2_FAILURE);
+    
+    svc_impl = AXIS2_INTF_TO_IMPL(svc);
+    if(NULL != svc_impl->schema_target_ns_prefix)
+    {
+        AXIS2_FREE(env->allocator, svc_impl->schema_target_ns_prefix);
+        svc_impl->schema_target_ns_prefix = NULL;
+    }
+    svc_impl->schema_target_ns_prefix = AXIS2_STRDUP(prefix, env);
+    return AXIS2_SUCCESS;
+}
+
+axis2_char_t* AXIS2_CALL
+axis2_svc_get_target_ns(axis2_svc_t *svc,
+                        const axis2_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, NULL);
+    return AXIS2_INTF_TO_IMPL(svc)->target_ns;
+}
+                        
+axis2_status_t AXIS2_CALL
+axis2_svc_set_target_ns(axis2_svc_t *svc,
+                        const axis2_env_t *env,
+                        axis2_char_t *ns)
+{
+    axis2_svc_impl_t *svc_impl = NULL;
+    
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, ns, AXIS2_FAILURE);
+    
+    svc_impl = AXIS2_INTF_TO_IMPL(svc);
+    if(NULL != svc_impl->target_ns)
+    {
+        AXIS2_FREE(env->allocator, svc_impl->target_ns);
+        svc_impl->target_ns = NULL;
+    }
+    svc_impl->target_ns = AXIS2_STRDUP(ns, env);
+    return AXIS2_SUCCESS;
+}
+
+axis2_char_t* AXIS2_CALL
+axis2_svc_get_target_ns_prefix(axis2_svc_t *svc,
+                        const axis2_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, NULL);
+    return AXIS2_INTF_TO_IMPL(svc)->target_ns_prefix;
+}
+                        
+axis2_status_t AXIS2_CALL
+axis2_svc_set_target_ns_prefix(axis2_svc_t *svc,
+                        const axis2_env_t *env,
+                        axis2_char_t *prefix)
+{
+    axis2_svc_impl_t *svc_impl = NULL;
+    
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, prefix, AXIS2_FAILURE);
+    
+    svc_impl = AXIS2_INTF_TO_IMPL(svc);
+    if(NULL != svc_impl->target_ns_prefix)
+    {
+        AXIS2_FREE(env->allocator, svc_impl->target_ns_prefix);
+        svc_impl->target_ns_prefix = NULL;
+    }
+    svc_impl->target_ns_prefix = AXIS2_STRDUP(prefix, env);
+    return AXIS2_SUCCESS;
+}
+                        
+xml_schema_element_t* AXIS2_CALL
+axis2_svc_get_schema_element(axis2_svc_t *svc,
+                        const axis2_env_t *env,
+                        axis2_qname_t *qname)
+{
+    axis2_svc_impl_t *svc_impl = NULL;
+    int i = 0;
+    
+    AXIS2_ENV_CHECK(env, NULL);
+    
+    svc_impl = AXIS2_INTF_TO_IMPL(svc);
+    for(i = 0; i < AXIS2_ARRAY_LIST_SIZE(svc_impl->schema_list, env); i++)
+    {
+        xml_schema_t *schema = NULL;
+        xml_schema_element_t *schema_element = NULL;
+        schema = AXIS2_ARRAY_LIST_GET(svc_impl->schema_list, env, i);
+        if(NULL != schema)
+        {
+            schema_element = XML_SCHEMA_GET_ELEMENT_BY_QNAME(schema, env, 
+                            qname);
+            if(NULL != schema_element)
+            {
+                return schema_element;
+            }
+        }
+    }
+    return NULL;
+}
+
+axis2_hash_t* AXIS2_CALL
+axis2_svc_get_ns_map(axis2_svc_t *svc,
+                        const axis2_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, NULL);
+    return AXIS2_INTF_TO_IMPL(svc)->ns_map;
+}
+                        
+axis2_status_t AXIS2_CALL
+axis2_svc_set_ns_map(axis2_svc_t *svc,
+                        const axis2_env_t *env,
+                        axis2_hash_t *ns_map)
+{
+    axis2_svc_impl_t *svc_impl = NULL;
+    axis2_hash_index_t *hi = NULL;
+    
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, ns_map, AXIS2_FAILURE);
+    
+    svc_impl = AXIS2_INTF_TO_IMPL(svc);
+    
+    if(NULL != svc_impl->ns_map)
+    {
+        for (hi = axis2_hash_first (svc_impl->ns_map, env); NULL != hi; 
+                        hi = axis2_hash_next (env, hi))
+        {
+            axis2_char_t *value = NULL;
+            axis2_char_t *key = NULL;
+            axis2_hash_this (hi, (const void **)&key, NULL, 
+                        (void **)&value);
+            if(NULL != key)
+            {
+                AXIS2_FREE(env->allocator, key);
+                key = NULL;
+            }
+            if(NULL != value)
+            {
+                AXIS2_FREE(env->allocator, value);
+                value = NULL;
+            }
+        }
+        axis2_hash_free(svc_impl->ns_map, env);
+    }
+    svc_impl->ns_map = ns_map;
+    return AXIS2_SUCCESS;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_svc_add_schema_ns(axis2_svc_t *svc,
+                        const axis2_env_t *env,
+                        axis2_char_t *ns)
+{
+    axis2_svc_impl_t *svc_impl = NULL;
+    axis2_bool_t found = AXIS2_FALSE;
+    axis2_hash_index_t *hi = NULL;
+    
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, ns, AXIS2_FAILURE);
+    
+    svc_impl = AXIS2_INTF_TO_IMPL(svc);
+    if(NULL != svc_impl->ns_map && axis2_hash_count(svc_impl->ns_map) > 0)
+    {
+        for (hi = axis2_hash_first (svc_impl->ns_map, env); NULL != hi; 
+                        hi = axis2_hash_next (env, hi))
+        {
+            axis2_char_t *value = NULL;
+            axis2_char_t *key = NULL;
+            axis2_hash_this (hi, (const void **)&key, NULL, 
+                        (void **)&value);
+            if(0 == AXIS2_STRCMP(value, ns))
+            {
+                found = AXIS2_TRUE;
+                break;
+            }
+        }
+    }
+    if(NULL == svc_impl->ns_map)
+    {
+        svc_impl->ns_map = axis2_hash_make(env);
+        svc_impl->ns_map = NULL;
+    }
+    if(AXIS2_FALSE == found)
+    {
+        axis2_char_t str_count[32];
+        axis2_char_t *tmp_val = NULL;
+        axis2_char_t *key = NULL;
+
+        tmp_val = AXIS2_STRDUP(ns, env);
+        sprintf(str_count, "%d", svc_impl->ns_count);
+        key = AXIS2_STRACAT("ns", str_count, env);
+        axis2_hash_set(svc_impl->ns_map, key, AXIS2_HASH_KEY_STRING, tmp_val);
+        svc_impl->ns_count++;
+    }
+    return AXIS2_SUCCESS;
+}
+                        
+axis2_status_t AXIS2_CALL
+axis2_svc_populate_schema_mappings(axis2_svc_t *svc,
+                        const axis2_env_t *env)
+{
+    axis2_array_list_t *schemas = NULL;
+    axis2_svc_impl_t *svc_impl = NULL;
+    
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    
+    svc_impl = AXIS2_INTF_TO_IMPL(svc);
+    schemas = axis2_svc_get_schemas(svc, env);
+    if(NULL == schemas)
+    {
+        return AXIS2_FAILURE;
+    }
+    if(AXIS2_FALSE == axis2_svc_is_schema_location_adjusted(svc, env))
+    {
+        int count = 0;
+        int i = 0;
+        axis2_hash_t *name_table = axis2_hash_make(env);
+        axis2_hash_t *schema_table = NULL;
+        
+        count = AXIS2_ARRAY_LIST_SIZE(schemas, env);
+        /* calculate unique names for the schemas */
+        for(i = 0; i < count; i++)
+        {
+            xml_schema_t *schema = AXIS2_ARRAY_LIST_GET(schemas, env, i);
+            axis2_svc_calculate_schema_names(svc, env, schema, name_table);
+        }
+        /* adjust the schema locations as per the calculated names */
+        for(i = 0; i < count; i++)
+        {
+            xml_schema_t *schema = AXIS2_ARRAY_LIST_GET(schemas, env, i);
+            axis2_svc_adjust_schema_names(svc, env, schema, name_table);
+        }
+        /* reverse the nametable so that there is a mapping from the
+         * name to the schema
+         */
+        schema_table = axis2_svc_swap_mapping_table(svc, env, name_table);
+        axis2_svc_set_schema_mapping_table(svc, env, schema_table);
+    }
+    return AXIS2_SUCCESS;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_svc_calculate_schema_names(axis2_svc_t *svc,
+                        const axis2_env_t *env,
+                        xml_schema_t *schema,
+                        axis2_hash_t *name_table)
+{
+    axis2_svc_impl_t *svc_impl = NULL;
+    xml_schema_obj_collection_t *collection = NULL;
+    xml_schema_obj_t *schema_obj = NULL;
+    int count = 0;
+    int i = 0;
+    
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, schema, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, name_table, AXIS2_FAILURE);
+    
+    svc_impl = AXIS2_INTF_TO_IMPL(svc);
+    collection = XML_SCHEMA_GET_INCLUDES(schema, env);
+    count = XML_SCHEMA_OBJ_COLLECTION_GET_COUNT(collection, env);
+    
+    for(i = 0; i < count; i++)
+    {
+        schema_obj = XML_SCHEMA_OBJ_COLLECTION_GET_ITEM(collection, env, i);
+        if(XML_SCHEMA_EXTERNAL == XML_SCHEMA_OBJ_GET_TYPE(schema_obj, env))
+        {
+            xml_schema_external_t *schema_external = NULL;
+            xml_schema_t *schema1 = NULL;
+            schema_external = (xml_schema_external_t *)schema_obj;
+            schema1 = XML_SCHEMA_EXTERNAL_GET_SCHEMA(schema_external, env);
+            if(NULL != schema1)
+            {
+                axis2_char_t *name = NULL;
+                axis2_char_t str_count[32];
+                sprintf(str_count, "%d", svc_impl->sc_calc_count++);
+                axis2_svc_calculate_schema_names(svc, env, schema1, name_table);
+                name = axis2_strcat(env, "xsd", str_count, 
+                        svc_impl->custom_schema_name_suffix, NULL);
+                axis2_hash_set(name_table, schema1, AXIS2_HASH_KEY_STRING,
+                        name);
+            }
+        }
+    }
+    return AXIS2_SUCCESS;
+}
+                        
+axis2_status_t AXIS2_CALL
+axis2_svc_adjust_schema_names(axis2_svc_t *svc,
+                        const axis2_env_t *env,
+                        xml_schema_t *schema,
+                        axis2_hash_t *names)
+{
+    axis2_svc_impl_t *svc_impl = NULL;
+    xml_schema_obj_collection_t *collection = NULL;
+    xml_schema_obj_t *schema_obj = NULL;
+    int count = 0;
+    int i = 0;
+    
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, schema, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, names, AXIS2_FAILURE);
+    
+    svc_impl = AXIS2_INTF_TO_IMPL(svc);
+    collection = XML_SCHEMA_GET_INCLUDES(schema, env);
+    count = XML_SCHEMA_OBJ_COLLECTION_GET_COUNT(collection, env);
+    for(i = 0; i < count; i++)
+    {
+        schema_obj = XML_SCHEMA_OBJ_COLLECTION_GET_ITEM(collection, env, i);
+        if(XML_SCHEMA_EXTERNAL == XML_SCHEMA_OBJ_GET_TYPE(schema_obj, env))
+        {
+            xml_schema_external_t *schema_external = NULL;
+            xml_schema_t *schema1 = NULL;
+            schema_external = (xml_schema_external_t *)schema_obj;
+            schema1 = XML_SCHEMA_EXTERNAL_GET_SCHEMA(schema_external, env);
+            if(NULL != schema1)
+            {
+                axis2_char_t *name = NULL;
+                axis2_char_t *value = NULL;
+                
+                axis2_svc_adjust_schema_names(svc, env, schema1, names);
+                value = (axis2_char_t*) axis2_hash_get(names, schema1, 
+                        AXIS2_HASH_KEY_STRING);
+                if(NULL != value)
+                {
+                    if(NULL != svc_impl->custom_schema_name_prefix)
+                    {
+                        name = axis2_strcat(env, 
+                        svc_impl->custom_schema_name_prefix, value, NULL);
+                    }
+                    else
+                    {
+                        name = axis2_strcat(env, "?xsd=", value, NULL);
+                    }
+                    XML_SCHEMA_EXTERNAL_SET_SCHEMA_LOCATION(schema_external, env,
+                        name);
+                }
+            }
+        }
+    }
+    return AXIS2_SUCCESS;
+}
+
+axis2_hash_t* AXIS2_CALL
+axis2_svc_swap_mapping_table(axis2_svc_t *svc,
+                        const axis2_env_t *env,
+                        axis2_hash_t *orig_table)
+{
+    axis2_hash_t *new_table = NULL;
+    axis2_hash_index_t *hi = NULL;
+    
+    AXIS2_ENV_CHECK(env, NULL);
+    AXIS2_PARAM_CHECK(env->error, orig_table, AXIS2_FAILURE);
+    
+    new_table = axis2_hash_make(env);
+    
+    for(hi = axis2_hash_first(orig_table, env); NULL != env; 
+                        hi = axis2_hash_next(env, hi))
+    {
+        void *value = NULL;
+        void *key = NULL;
+        
+        axis2_hash_this (hi, (const void **)&key, NULL, 
+                    (void **)&value);
+        axis2_hash_set(new_table, value, AXIS2_HASH_KEY_STRING, key);
+    }
+    return new_table;
 }

Modified: webservices/axis2/trunk/c/modules/core/engine/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/engine/Makefile.am?rev=417135&r1=417134&r2=417135&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/engine/Makefile.am (original)
+++ webservices/axis2/trunk/c/modules/core/engine/Makefile.am Mon Jun 26 00:05:20 2006
@@ -34,5 +34,6 @@
             -I$(top_builddir)/modules/core/context \
             -I$(top_builddir)/modules/core/util \
             -I$(top_builddir)/modules/core/clientapi \
+            -I$(top_builddir)/xml_schema/include\
 			@AXIOMINC@ \
 			@UTILINC@ 

Modified: webservices/axis2/trunk/c/modules/core/phaseresolver/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/phaseresolver/Makefile.am?rev=417135&r1=417134&r2=417135&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/phaseresolver/Makefile.am (original)
+++ webservices/axis2/trunk/c/modules/core/phaseresolver/Makefile.am Mon Jun 26 00:05:20 2006
@@ -7,5 +7,6 @@
 INCLUDES = -I$(top_builddir)/include \
             -I$(top_builddir)/modules/wsdl \
             -I$(top_builddir)/modules/core/engine \
+            -I$(top_builddir)/xml_schema/include\
 			@AXIOMINC@ \
 			@UTILINC@ 

Modified: webservices/axis2/trunk/c/modules/core/receivers/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/receivers/Makefile.am?rev=417135&r1=417134&r2=417135&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/receivers/Makefile.am (original)
+++ webservices/axis2/trunk/c/modules/core/receivers/Makefile.am Mon Jun 26 00:05:20 2006
@@ -9,5 +9,6 @@
             -I$(top_builddir)/modules/wsdl \
             -I$(top_builddir)/modules/core/engine \
             -I$(top_builddir)/modules/core/util \
+            -I$(top_builddir)/xml_schema/include\
 			@AXIOMINC@ \
 			@UTILINC@ 

Modified: webservices/axis2/trunk/c/modules/core/transport/http/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/transport/http/Makefile.am?rev=417135&r1=417134&r2=417135&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/Makefile.am (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/Makefile.am Mon Jun 26 00:05:20 2006
@@ -15,5 +15,6 @@
 INCLUDES = -I$(top_builddir)/include \
             -I$(top_builddir)/modules/wsdl \
             -I$(top_builddir)/modules/core/engine \
+            -I$(top_builddir)/xml_schema/include\
 			@AXIOMINC@ \
 			@UTILINC@ 

Modified: webservices/axis2/trunk/c/modules/core/transport/http/http_header.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/transport/http/http_header.c?rev=417135&r1=417134&r2=417135&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/http_header.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/http_header.c Mon Jun 26 00:05:20 2006
@@ -52,7 +52,7 @@
 
 /***************************** End of function headers ************************/
 
-AXIS2_EXTERN axis2_http_header_t * AXIS2_CALL AXIS2_CALL
+AXIS2_EXTERN axis2_http_header_t * AXIS2_CALL
 axis2_http_header_create (const axis2_env_t *env, 
     const axis2_char_t *name, 
     const axis2_char_t *value)

Modified: webservices/axis2/trunk/c/modules/core/transport/http/http_transport_utils.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/transport/http/http_transport_utils.c?rev=417135&r1=417134&r2=417135&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 Jun 26 00:05:20 2006
@@ -33,6 +33,13 @@
 #include <axis2_property.h>
 #include <axis2_utils.h>
 #include <axiom_mime_parser.h>
+#include <xml_schema_type.h>
+#include <xml_schema_group_base.h>
+#include <xml_schema_obj_collection.h>
+#include <xml_schema_particle.h>
+#include <xml_schema_complex_type.h>
+#include <axis2_disp.h>
+#include <axis2_msg.h>
 
 #define AXIOM_MIME_BOUNDARY_BYTE 45
 
@@ -61,12 +68,6 @@
                         axis2_conf_ctx_t *conf_ctx, 
                         axis2_hash_t *request_params);
     
-AXIS2_EXTERN axiom_soap_envelope_t* AXIS2_CALL
-axis2_http_transport_utils_create_envelope_from_get_request
-                        (const axis2_env_t *env, 
-                        const axis2_char_t *request_uri,
-                        axis2_hash_t *request_params);
-    
 AXIS2_EXTERN axiom_stax_builder_t*  AXIS2_CALL
 axis2_http_transport_utils_select_builder_for_mime
                         (const axis2_env_t *env, axis2_char_t *request_uri,
@@ -99,9 +100,11 @@
 AXIS2_EXTERN axis2_char_t*  AXIS2_CALL
 axis2_http_transport_utils_get_services_html(const axis2_env_t *env, 
                      axis2_conf_ctx_t *conf_ctx);
+                     
 AXIS2_EXTERN axis2_char_t* AXIS2_CALL
 axis2_http_transport_utils_get_charset_enc(const axis2_env_t *env, 
                   const axis2_char_t *content_type);
+                  
 int AXIS2_CALL
 axis2_http_transport_utils_on_data_request(char *buffer, int size, void *ctx);
 
@@ -109,10 +112,22 @@
 axis2_http_transport_utils_create_soap_msg(const axis2_env_t *env, 
                         axis2_msg_ctx_t *msg_ctx, 
                         const axis2_char_t *soap_ns_uri);
+                        
 AXIS2_EXTERN axis2_char_t* AXIS2_CALL
 axis2_http_transport_utils_get_value_from_content_type(const axis2_env_t *env, 
                   const axis2_char_t *content_type, 
                   const axis2_char_t *key);
+                  
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+axis2_http_transport_utils_dispatch_and_verify(const axis2_env_t *env,
+                        axis2_msg_ctx_t *msg_ctx);
+
+AXIS2_EXTERN axiom_soap_envelope_t* AXIS2_CALL
+axis2_http_transport_utils_handle_media_type_url_encoded(const axis2_env_t *env,
+                        axis2_msg_ctx_t *msg_ctx, 
+                        axis2_hash_t *param_map, 
+                        axis2_char_t *method, 
+                        xml_schema_element_t *schema_element);
 /***************************** End of function headers ************************/
 
 AXIS2_EXTERN axis2_status_t  AXIS2_CALL 
@@ -126,82 +141,82 @@
                         axis2_char_t *soap_action_header,
                         const axis2_char_t *request_uri)
 {
-   axiom_soap_envelope_t *soap_envelope = NULL;
-   axiom_soap_builder_t *soap_builder = NULL;
-   axiom_stax_builder_t *om_builder = NULL;
-   axis2_bool_t is_soap11 = AXIS2_FALSE;
-   axiom_xml_reader_t *xml_reader = NULL;
-   axis2_char_t *char_set = NULL;
-   /*axis2_char_t *xml_char_set = NULL;*/
-   axis2_conf_ctx_t *conf_ctx = NULL;
-   axis2_callback_info_t callback_ctx;
-   axis2_hash_t *headers = NULL;
-   axis2_engine_t *engine = NULL;
-   axiom_soap_body_t *soap_body = NULL;
+    axiom_soap_envelope_t *soap_envelope = NULL;
+    axiom_soap_builder_t *soap_builder = NULL;
+    axiom_stax_builder_t *om_builder = NULL;
+    axis2_bool_t is_soap11 = AXIS2_FALSE;
+    axiom_xml_reader_t *xml_reader = NULL;
+    axis2_char_t *char_set = NULL;
+    /*axis2_char_t *xml_char_set = NULL;*/
+    axis2_conf_ctx_t *conf_ctx = NULL;
+    axis2_callback_info_t callback_ctx;
+    axis2_hash_t *headers = NULL;
+    axis2_engine_t *engine = NULL;
+    axiom_soap_body_t *soap_body = NULL;
     axis2_property_t *property = NULL;
     axis2_status_t status = AXIS2_FAILURE;
     axis2_hash_t *binary_data_map = 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);
-   AXIS2_PARAM_CHECK(env->error, content_type, AXIS2_FAILURE);
-   AXIS2_PARAM_CHECK(env->error, request_uri, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, in_stream, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, out_stream, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, content_type, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, request_uri, AXIS2_FAILURE);
+   
+    conf_ctx = AXIS2_MSG_CTX_GET_CONF_CTX(msg_ctx, env);
+   
+    callback_ctx.in_stream = in_stream;
+    callback_ctx.env = env;
+    callback_ctx.content_length = content_length;
+    callback_ctx.unread_len = content_length;
+    callback_ctx.chunked_stream = NULL;
    
-   conf_ctx = AXIS2_MSG_CTX_GET_CONF_CTX(msg_ctx, env);
-   
-   callback_ctx.in_stream = in_stream;
-   callback_ctx.env = env;
-   callback_ctx.content_length = content_length;
-   callback_ctx.unread_len = content_length;
-   callback_ctx.chunked_stream = NULL;
-   
-   if(NULL != soap_action_header && (strlen(soap_action_header) > 0) )   
-   {
-      /* remove leading and trailing " s */
-      if('"' == soap_action_header[0])
-      {
-         memmove(soap_action_header, soap_action_header+sizeof(axis2_char_t),
-                  strlen(soap_action_header) + sizeof(axis2_char_t));
-      }
-      if('"' == soap_action_header[strlen(soap_action_header) -1])
-      {
-         soap_action_header[strlen(soap_action_header) -1] = '\0';
-      }
-   }
-   property = AXIS2_MSG_CTX_GET_PROPERTY(msg_ctx, env, AXIS2_TRANSPORT_HEADERS, 
-                  AXIS2_FALSE);
+    if(NULL != soap_action_header && (strlen(soap_action_header) > 0) )   
+    {
+        /* remove leading and trailing " s */
+        if('"' == soap_action_header[0])
+        {
+            memmove(soap_action_header, soap_action_header+sizeof(axis2_char_t),
+                        strlen(soap_action_header) + sizeof(axis2_char_t));
+        }
+        if('"' == soap_action_header[strlen(soap_action_header) -1])
+        {
+            soap_action_header[strlen(soap_action_header) -1] = '\0';
+        }
+    }
+    property = AXIS2_MSG_CTX_GET_PROPERTY(msg_ctx, env, AXIS2_TRANSPORT_HEADERS, 
+                        AXIS2_FALSE);
     if(property)
     {
         headers = AXIS2_PROPERTY_GET_VALUE(property, env);
         property = NULL;
     }
-   if(NULL != headers)
-   {
-      axis2_http_header_t *encoding_header = NULL;
-      encoding_header = (axis2_http_header_t*)axis2_hash_get(headers, 
-                  AXIS2_HTTP_HEADER_TRANSFER_ENCODING,
-                  AXIS2_HASH_KEY_STRING);
-      if(NULL != encoding_header)
-      {
-         axis2_char_t *encoding_value = NULL;
-         encoding_value = AXIS2_HTTP_HEADER_GET_VALUE(encoding_header, env);
-         if(NULL != encoding_value && 0 == AXIS2_STRCASECMP(encoding_value, 
-                  AXIS2_HTTP_HEADER_TRANSFER_ENCODING_CHUNKED))
-         {
-            callback_ctx.chunked_stream = axis2_http_chunked_stream_create(
-                     env, in_stream);
-            if(NULL == callback_ctx.chunked_stream)
+    if(NULL != headers)
+    {
+        axis2_http_header_t *encoding_header = NULL;
+        encoding_header = (axis2_http_header_t*)axis2_hash_get(headers, 
+                        AXIS2_HTTP_HEADER_TRANSFER_ENCODING,
+                        AXIS2_HASH_KEY_STRING);
+        if(NULL != encoding_header)
+        {
+            axis2_char_t *encoding_value = NULL;
+            encoding_value = AXIS2_HTTP_HEADER_GET_VALUE(encoding_header, env);
+            if(NULL != encoding_value && 0 == AXIS2_STRCASECMP(encoding_value, 
+                        AXIS2_HTTP_HEADER_TRANSFER_ENCODING_CHUNKED))
             {
-               AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error occured in"
-                     " creating in chunked stream.");
-               return AXIS2_FAILURE;            
+                callback_ctx.chunked_stream = axis2_http_chunked_stream_create(
+                        env, in_stream);
+                if(NULL == callback_ctx.chunked_stream)
+                {
+                    AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error occured in"
+                        " creating in chunked stream.");
+                    return AXIS2_FAILURE;            
+                }
+                AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "HTTP"
+                        " stream chunked");
             }
-            AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "HTTP"
-                  " stream chunked");
-         }
-      }
-   }
+        }
+    }
     
     if (NULL != strstr(content_type, AXIS2_HTTP_HEADER_ACCEPT_MULTIPART_RELATED))
     {
@@ -331,7 +346,7 @@
             soap_builder = NULL;
             return AXIS2_FAILURE;
          }
-      }
+    }
         else
         {
             /* REST support */
@@ -354,7 +369,7 @@
             }
         }
              
-   }
+    }
     
     if (binary_data_map)
     {
@@ -385,9 +400,9 @@
     *}
     */
    
-   AXIS2_MSG_CTX_SET_SOAP_ENVELOPE(msg_ctx, env, soap_envelope);
+    AXIS2_MSG_CTX_SET_SOAP_ENVELOPE(msg_ctx, env, soap_envelope);
    
-   engine = axis2_engine_create(env, conf_ctx);
+    engine = axis2_engine_create(env, conf_ctx);
     
     if (!soap_envelope)
         return AXIS2_FAILURE;
@@ -398,21 +413,22 @@
     if (NULL == soap_body)
         return AXIS2_FAILURE;
     
-   if(AXIS2_TRUE == AXIOM_SOAP_BODY_HAS_FAULT(soap_body, env))
-   {
-      status = AXIS2_ENGINE_RECEIVE_FAULT(engine, env, msg_ctx);
-   }
-   else
-   {
-      status = AXIS2_ENGINE_RECEIVE(engine, env, msg_ctx);
-   }
-   if(NULL == AXIS2_MSG_CTX_GET_SOAP_ENVELOPE(msg_ctx, env) && 
+    if(AXIS2_TRUE == AXIOM_SOAP_BODY_HAS_FAULT(soap_body, env))
+    {
+        status = AXIS2_ENGINE_RECEIVE_FAULT(engine, env, msg_ctx);
+    }
+    else
+    {
+        status = AXIS2_ENGINE_RECEIVE(engine, env, msg_ctx);
+    }
+    if(NULL == AXIS2_MSG_CTX_GET_SOAP_ENVELOPE(msg_ctx, env) && 
                   AXIS2_FALSE == is_soap11)
-   {
-      axiom_soap_envelope_t *def_envelope = 
-            axiom_soap_envelope_create_default_soap_envelope(env, AXIOM_SOAP12);
-      AXIS2_MSG_CTX_SET_SOAP_ENVELOPE(msg_ctx, env, def_envelope);
-   }
+    {
+        axiom_soap_envelope_t *def_envelope = 
+                        axiom_soap_envelope_create_default_soap_envelope(env, 
+                        AXIOM_SOAP12);
+        AXIS2_MSG_CTX_SET_SOAP_ENVELOPE(msg_ctx, env, def_envelope);
+    }
     if(NULL != engine)
     {
         AXIS2_ENGINE_FREE(engine, env);
@@ -433,128 +449,62 @@
                         axis2_conf_ctx_t *conf_ctx, 
                         axis2_hash_t *request_params)
 {
-   axiom_soap_envelope_t *soap_envelope = NULL;
-   axis2_engine_t *engine = NULL;
+    axiom_soap_envelope_t *soap_envelope = NULL;
+    axis2_engine_t *engine = NULL;
     axis2_property_t *property = NULL;
-      
-   AXIS2_PARAM_CHECK(env->error, msg_ctx, AXIS2_FALSE);
-   AXIS2_PARAM_CHECK(env->error, in_stream, AXIS2_FALSE);
-   AXIS2_PARAM_CHECK(env->error, out_stream, AXIS2_FALSE);
-   AXIS2_PARAM_CHECK(env->error, content_type, AXIS2_FALSE);
-   AXIS2_PARAM_CHECK(env->error, request_uri, AXIS2_FALSE);
-   AXIS2_PARAM_CHECK(env->error, request_params, AXIS2_FALSE);
+    axis2_op_t *op = NULL;
+    xml_schema_element_t *schema_element = NULL;
+    
+    AXIS2_PARAM_CHECK(env->error, msg_ctx, AXIS2_FALSE);
+    AXIS2_PARAM_CHECK(env->error, in_stream, AXIS2_FALSE);
+    AXIS2_PARAM_CHECK(env->error, out_stream, AXIS2_FALSE);
+    AXIS2_PARAM_CHECK(env->error, content_type, AXIS2_FALSE);
+    AXIS2_PARAM_CHECK(env->error, request_uri, AXIS2_FALSE);
+    AXIS2_PARAM_CHECK(env->error, request_params, AXIS2_FALSE);
    
-   if(NULL != soap_action_header)   
-   {
-      /* remove leading and trailing " s */
-      if('"' == soap_action_header[0])
-      {
-         memmove(soap_action_header, soap_action_header+sizeof(axis2_char_t),
-                  strlen(soap_action_header) + sizeof(axis2_char_t));
-      }
-      if('"' == soap_action_header[strlen(soap_action_header) -1])
-      {
-         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_TO(msg_ctx, env, axis2_endpoint_ref_create(env, 
+                        request_uri));
     
     property = axis2_property_create(env);
     AXIS2_PROPERTY_SET_SCOPE(property, env, AXIS2_SCOPE_REQUEST);
     AXIS2_PROPERTY_SET_FREE_FUNC(property, env, axis2_stream_free_void_arg);
     AXIS2_PROPERTY_SET_VALUE(property, env, out_stream);
-   AXIS2_MSG_CTX_SET_PROPERTY(msg_ctx, env, 
+    AXIS2_MSG_CTX_SET_PROPERTY(msg_ctx, env, 
                AXIS2_TRANSPORT_OUT, property, AXIS2_FALSE);
 
-   AXIS2_MSG_CTX_SET_SERVER_SIDE(msg_ctx, env, AXIS2_TRUE);
-   
-   soap_envelope = axis2_http_transport_utils_create_envelope_from_get_request(
-               env, request_uri, request_params);
-   if(NULL == soap_envelope)
-   {
-      return AXIS2_FALSE;
-   }
-   else
-   {
-      AXIS2_MSG_CTX_SET_DOING_REST(msg_ctx, env, AXIS2_TRUE);
-      AXIS2_MSG_CTX_SET_SOAP_ENVELOPE(msg_ctx, env, soap_envelope);
-      engine = axis2_engine_create(env, conf_ctx);
-      AXIS2_ENGINE_RECEIVE(engine, env, msg_ctx);
-      return AXIS2_TRUE;
-   }
+    AXIS2_MSG_CTX_SET_SERVER_SIDE(msg_ctx, env, AXIS2_TRUE);
+    if(AXIS2_SUCCESS != axis2_http_transport_utils_dispatch_and_verify(env, 
+                        msg_ctx))
+    {
+        return AXIS2_FALSE;
+    }
+    op = AXIS2_MSG_CTX_GET_OP(msg_ctx, env);
+    if(NULL != op)
+    {
+        axis2_msg_t *msg = NULL;        
+        msg = AXIS2_OP_GET_MSG(op, env, AXIS2_MSG_IN);
+        schema_element = AXIS2_MSG_GET_SCHEMA_ELEMENT(msg, env);
+    }
+    soap_envelope = axis2_http_transport_utils_handle_media_type_url_encoded(
+                env, msg_ctx, request_params, AXIS2_HTTP_HEADER_GET, 
+                schema_element);
+    if(NULL == soap_envelope)
+    {
+        return AXIS2_FALSE;
+    }
+    else
+    {
+        AXIS2_MSG_CTX_SET_DOING_REST(msg_ctx, env, AXIS2_TRUE);
+        AXIS2_MSG_CTX_SET_SOAP_ENVELOPE(msg_ctx, env, soap_envelope);
+        engine = axis2_engine_create(env, conf_ctx);
+        AXIS2_ENGINE_RECEIVE(engine, env, msg_ctx);
+        return AXIS2_TRUE;
+    }
     return AXIS2_FALSE;
 }
 
 
-AXIS2_EXTERN axiom_soap_envelope_t* AXIS2_CALL
-axis2_http_transport_utils_create_envelope_from_get_request
-                        (const axis2_env_t *env, 
-                        const axis2_char_t *request_uri,
-                        axis2_hash_t *request_params)
-{
-   axis2_char_t **values = NULL;
-   axiom_soap_envelope_t *envelope = NULL;
-   axiom_namespace_t *om_ns = NULL;
-   axiom_namespace_t *def_om_ns = NULL;
-   axiom_node_t *document_node = NULL;
-   axiom_node_t *op_node = NULL;
-   axiom_element_t *op_ele = NULL;
-   axis2_hash_index_t *hi = NULL;
-   AXIS2_PARAM_CHECK(env->error, request_uri, NULL);
-   AXIS2_PARAM_CHECK(env->error, request_params, NULL);
-   
-   values = axis2_parse_request_url_for_svc_and_op(env, request_uri);
-   if(NULL == values)
-   {
-      return NULL;
-   }
-   if(NULL == values[0] && NULL != values[1])
-   {
-      AXIS2_FREE(env->allocator, values[1]);
-      AXIS2_FREE(env->allocator, values);
-      return NULL;
-   }
-   if(NULL != values[0] && NULL == values[1])
-   {
-      AXIS2_FREE(env->allocator, values[0]);
-      AXIS2_FREE(env->allocator, values);
-      return NULL;
-   }
-   if(NULL == values[0] && NULL == values[1])
-   {
-      AXIS2_FREE(env->allocator, values);
-      return NULL;
-   }
-   envelope = axiom_soap_envelope_create_default_soap_envelope(env, AXIOM_SOAP12);
-    
-   om_ns = axiom_namespace_create(env, values[0], "services");
-   
-    def_om_ns = axiom_namespace_create(env, "", NULL);
-   
-    document_node = AXIOM_SOAP_BODY_GET_BASE_NODE(AXIOM_SOAP_ENVELOPE_GET_BODY(
-                  envelope, env), env);
-   op_ele = axiom_element_create(env, document_node, values[1], om_ns, 
-                  &op_node);
-   
-   for(hi = axis2_hash_first(request_params, env); NULL != hi; 
-                  axis2_hash_next(env, hi))
-   {
-      void *name = NULL;
-      void *value = NULL;
-      axiom_element_t *tmp_ele = NULL;
-      axiom_node_t *tmp_node = NULL;
-      axis2_hash_this(hi, (const void **)&name, NULL, (void**)&value);
-      tmp_ele = axiom_element_create(env, op_node, (axis2_char_t*)name,
-                  def_om_ns, &tmp_node);
-      AXIOM_ELEMENT_SET_TEXT(tmp_ele, env, (axis2_char_t*)value, tmp_node);
-   }
-    return envelope;
-}
-
-
 AXIS2_EXTERN axiom_stax_builder_t*  AXIS2_CALL
 axis2_http_transport_utils_select_builder_for_mime
                         (const axis2_env_t *env, axis2_char_t *request_uri,
@@ -979,11 +929,11 @@
     axis2_char_t *content_type = NULL;
     axis2_stream_t *in_stream = NULL;
     axis2_callback_info_t *callback_ctx = NULL;
-   axis2_char_t *trans_enc = NULL;
-   int *content_length = NULL;
-   axis2_property_t *property = NULL;
+    axis2_char_t *trans_enc = NULL;
+    int *content_length = NULL;
+    axis2_property_t *property = NULL;
     AXIS2_ENV_CHECK(env, NULL);
-   AXIS2_PARAM_CHECK(env->error, msg_ctx, NULL);
+    AXIS2_PARAM_CHECK(env->error, msg_ctx, NULL);
     AXIS2_PARAM_CHECK(env->error, soap_ns_uri, NULL);
     
     
@@ -1001,24 +951,24 @@
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
     }
-   callback_ctx->in_stream = in_stream;
-   callback_ctx->env = env;
-   callback_ctx->content_length = -1;
-   callback_ctx->unread_len = -1;
-   callback_ctx->chunked_stream = NULL;
+    callback_ctx->in_stream = in_stream;
+    callback_ctx->env = env;
+    callback_ctx->content_length = -1;
+    callback_ctx->unread_len = -1;
+    callback_ctx->chunked_stream = NULL;
    
-   property = AXIS2_MSG_CTX_GET_PROPERTY(msg_ctx, env, 
+    property = AXIS2_MSG_CTX_GET_PROPERTY(msg_ctx, env, 
                   AXIS2_HTTP_HEADER_CONTENT_LENGTH, AXIS2_FALSE);
     if(property)
     {
         content_length = AXIS2_PROPERTY_GET_VALUE(property, env);
         property = NULL;
     }
-   if(content_length != NULL)
-   {
-      callback_ctx->content_length = *content_length;
-      callback_ctx->unread_len = *content_length;
-   }
+    if(content_length != NULL)
+    {
+        callback_ctx->content_length = *content_length;
+        callback_ctx->unread_len = *content_length;
+    }
     if(NULL == in_stream)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NULL_IN_STREAM_IN_MSG_CTX,
@@ -1032,16 +982,16 @@
         trans_enc = AXIS2_PROPERTY_GET_VALUE(property, env);
         property = NULL;
     }
-   if(NULL != trans_enc && 0 == AXIS2_STRCMP(trans_enc, 
+    if(NULL != trans_enc && 0 == AXIS2_STRCMP(trans_enc, 
                   AXIS2_HTTP_HEADER_TRANSFER_ENCODING_CHUNKED))
-   {
-      callback_ctx->chunked_stream = axis2_http_chunked_stream_create(env, 
+    {
+        callback_ctx->chunked_stream = axis2_http_chunked_stream_create(env, 
                   in_stream);
-      if(NULL == callback_ctx->chunked_stream)
-      {
-         return NULL;
-      }
-   }
+        if(NULL == callback_ctx->chunked_stream)
+        {
+            return NULL;
+        }
+    }
    
     
     op_ctx = AXIS2_MSG_CTX_GET_OP_CTX(msg_ctx, env);
@@ -1188,4 +1138,156 @@
    tmp2 =  AXIS2_STRDUP(tmp + 1, env);
    AXIS2_FREE(env->allocator, tmp_content_type);
    return tmp2;
+}
+
+AXIS2_EXTERN axiom_soap_envelope_t* AXIS2_CALL
+axis2_http_transport_utils_handle_media_type_url_encoded(const axis2_env_t *env,
+                        axis2_msg_ctx_t *msg_ctx, 
+                        axis2_hash_t *param_map, 
+                        axis2_char_t *method, 
+                        xml_schema_element_t *schema_element)
+{
+    axiom_soap_envelope_t *soap_env = NULL;
+    axiom_soap_body_t *soap_body = NULL;
+    
+    AXIS2_ENV_CHECK(env, NULL);
+    AXIS2_PARAM_CHECK(env->error, msg_ctx, NULL);
+    AXIS2_PARAM_CHECK(env->error, method, NULL);
+    
+    
+    soap_env = axiom_soap_envelope_create_default_soap_envelope(env, 
+                        AXIOM_SOAP11);
+    soap_body = AXIOM_SOAP_ENVELOPE_GET_BODY(soap_env, env);
+    if(NULL == soap_body)
+    {
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_SOAP_ENVELOPE_OR_SOAP_BODY_NULL,
+                        AXIS2_FAILURE);
+        return NULL;
+    }
+    if(NULL == schema_element)
+    {
+        axiom_element_t *body_child = NULL;
+        axiom_node_t *body_child_node = NULL;
+        
+        body_child = axiom_element_create_with_qname(env, NULL, 
+                        AXIS2_OP_GET_QNAME(AXIS2_MSG_CTX_GET_OP(msg_ctx, env), 
+                        env), &body_child_node);
+        AXIOM_SOAP_BODY_ADD_CHILD(soap_body, env, body_child_node);
+        if(NULL != param_map)
+        {
+            axis2_hash_index_t *hi = NULL;
+            for(hi = axis2_hash_first(param_map, env); hi != NULL; 
+                        hi = axis2_hash_next(env, hi))
+            {
+                axis2_char_t *name = NULL;
+                axis2_char_t *value = NULL;
+                axiom_node_t *node = NULL;
+                axiom_element_t *element = NULL;
+                
+                axis2_hash_this(hi, (const void **)&name, NULL,(void **)&value);
+                element = axiom_element_create(env, NULL, name, NULL, &node);
+                AXIOM_ELEMENT_SET_TEXT(element, env, value, node);
+                AXIOM_NODE_ADD_CHILD(body_child_node, env, node);
+            }
+        }
+    }
+    else
+    {
+        axis2_char_t *target_ns = NULL;
+        axis2_qname_t *bfc_qname = NULL;
+        axiom_element_t *body_child = NULL;
+        axiom_node_t *body_child_node = NULL;
+        
+        target_ns = AXIS2_QNAME_GET_URI(XML_SCHEMA_ELEMENT_GET_QNAME(
+                        schema_element, env), env);
+        bfc_qname = axis2_qname_create(env, XML_SCHEMA_ELEMENT_GET_NAME(
+                        schema_element, env), target_ns, NULL);
+        
+        body_child = axiom_element_create_with_qname(env, NULL, bfc_qname, 
+                        &body_child_node);
+        AXIOM_SOAP_BODY_ADD_CHILD(soap_body, env, body_child_node);
+        if(0 == AXIS2_STRCMP(method, AXIS2_HTTP_HEADER_GET) || 
+                        0 == AXIS2_STRCMP(method, AXIS2_HTTP_HEADER_POST))
+        {
+            xml_schema_type_t *schema_type = NULL;
+            schema_type = XML_SCHEMA_ELEMENT_GET_SCHEMA_TYPE(schema_element, 
+                        env);
+            if(XML_SCHEMA_COMPLEX_TYPE == XML_SCHEMA_TYPE_GET_TYPE(schema_type, 
+                        env))
+            {
+                xml_schema_particle_t *schema_particle = NULL;
+                schema_particle = XML_SCHEMA_COMPLEX_TYPE_GET_PARTICLE(
+                        schema_type, env);
+                if(XML_SCHEMA_SEQUENCE == 
+                        XML_SCHEMA_PARTICLE_GET_TYPE(schema_particle, env))
+                {
+                    xml_schema_group_base_t *sequence = NULL;
+                    xml_schema_obj_collection_t *seq_items = NULL;
+                    int count = 0;
+                    int i = 0;
+                    
+                    sequence = (xml_schema_group_base_t*)schema_particle;
+                    seq_items = XML_SCHEMA_GROUP_BASE_GET_ITEMS(sequence, env);
+                    count = XML_SCHEMA_OBJ_COLLECTION_GET_COUNT(seq_items, env);
+                    for(i = 0; i < count; i++)
+                    {
+                        xml_schema_element_t *inner_element = NULL;
+                        axis2_char_t *element_name = NULL;
+                        axis2_char_t *param_val = NULL;
+                        axiom_element_t *om_element = NULL;
+                        axiom_node_t *om_node = NULL;
+                        
+                        inner_element = (xml_schema_element_t*)
+                            XML_SCHEMA_OBJ_COLLECTION_GET_ITEM(seq_items, env,
+                            i);
+                        element_name = XML_SCHEMA_ELEMENT_GET_NAME(inner_element,
+                            env);
+                        param_val = axis2_hash_get(param_map, element_name,
+                            AXIS2_HASH_KEY_STRING);
+                        if(NULL == param_val)
+                        {
+                            AXIS2_ERROR_SET(env->error, 
+                                AXIS2_ERROR_REQD_PARAM_MISSING, AXIS2_FAILURE);
+                            return NULL;
+                        }
+                        om_element = axiom_element_create(env, body_child_node,
+                            element_name, NULL, &om_node);
+                        AXIOM_ELEMENT_SET_TEXT(om_element, env, param_val,
+                            om_node);
+                    }
+                }
+            }
+            else
+            {
+                AXIS2_ERROR_SET(env->error, AXIS2_ERROR_UNSUPPORTED_SCHEMA_TYPE,
+                        AXIS2_FAILURE);
+                return NULL;
+            }
+        }
+    }
+    return soap_env;
+}
+
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+axis2_http_transport_utils_dispatch_and_verify(const axis2_env_t *env,
+                        axis2_msg_ctx_t *msg_ctx)
+{
+    axis2_disp_t *req_uri_disp = NULL;
+    axis2_handler_t *handler = NULL;
+    
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK(env->error, msg_ctx, AXIS2_FAILURE);
+    
+    req_uri_disp = axis2_req_uri_disp_create(env);
+    handler = AXIS2_DISP_GET_BASE(req_uri_disp, env);
+    AXIS2_HANDLER_INVOKE(handler, env, msg_ctx);
+    
+    if(NULL == AXIS2_MSG_CTX_GET_SVC(msg_ctx, env) || NULL == 
+                        AXIS2_MSG_CTX_GET_OP(msg_ctx, env))
+    {
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_SVC_OR_OP_NOT_FOUND, 
+                        AXIS2_FAILURE);
+        return AXIS2_FAILURE;
+    }
+    return AXIS2_SUCCESS;
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message