You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ma...@apache.org on 2008/06/11 07:08:42 UTC

svn commit: r666526 [3/3] - in /webservices/axis2/branches/c/post_1_4_mtom/c: ./ axiom/ axiom/include/ axiom/src/om/ axiom/src/parser/ axiom/src/parser/libxml2/ axiom/src/soap/ axiom/test/om/ axiom/test/soap/ build/win32/ guththila/include/ guththila/s...

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/server/IIS/axis2_isapi_plugin.c
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/server/IIS/axis2_isapi_plugin.c?rev=666526&r1=666525&r2=666526&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/server/IIS/axis2_isapi_plugin.c (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/server/IIS/axis2_isapi_plugin.c Tue Jun 10 22:08:36 2008
@@ -1,75 +1,99 @@
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */  
-    
-#include <windows.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <httpfilt.h>
-#include <httpext.h>
-
-
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */  
+
+#include <windows.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <httpfilt.h>
+#include <httpext.h>
+
+#include "axis2_iis_constants.h"
+#include "axis2_iis_worker.h"
+
 /* Axis headers */ 
 #include <axutil_error_default.h>
 #include <axutil_log_default.h>
 #include <axutil_thread_pool.h>
 #include <axiom_xml_reader.h>
-#include <axutil_log.h>
+#include <axutil_log.h>
+
+#ifndef _WIN32_WINNT 
+#define _WIN32_WINNT 0x0500 
+#endif 
+
+#define	AXIS2_IIS_LOG_FILE_TAG		 "log_file"
+#define AXIS2_IIS_LOG_LEVEL_TAG		 "log_level" 
+#define AXIS2_IIS_REPO_PATH_TAG		 "axis2c_home"
+#define AXIS2_IIS_EXTENSION_URI_TAG	 "extension_uri"
+#define AXIS2_IIS_REDIRECT_WORD_TAG	 "redirect_uri"
+#define AXIS2_IIS_AXIS2_LOCATION	 "axis2_location"
+#define AXIS2_IIS_SERVICE_URL_PREFIX "services"
+
+#define AXIS2_IIS_LOG_TRACE_VERB	 "trace"
+#define AXIS2_IIS_LOG_ERROR_VERB	 "error"
+#define AXIS2_IIS_LOG_INFO_VERB		 "info"
+#define AXIS2_IIS_LOG_USER_VERB      "user"
+#define AXIS2_IIS_LOG_CRITICAL_VERB	 "critical"
+#define AXIS2_IIS_LOG_WARN_VERB		 "warning"
+#define AXIS2_IIS_LOG_DEBUG_VERB	 "debug"
 
-#include "axis2_isapi_plugin.h"
-#include "axis2_iis_worker.h"
-#include "axis2_iis_constants.h"
-
-#define	AXIS2_IIS_LOG_FILE_TAG		("log_file")
-#define AXIS2_IIS_LOG_LEVEL_TAG		("log_level")
-#define AXIS2_IIS_REPO_PATH_TAG		("axis2c_home")
-#define AXIS2_IIS_EXTENSION_URI_TAG	("extension_uri")
-#define AXIS2_IIS_REDIRECT_WORD_TAG	("redirect_uri")
-
-#define AXIS2_IIS_LOG_TRACE_VERB	("trace")
-#define AXIS2_IIS_LOG_ERROR_VERB	("error")
-#define AXIS2_IIS_LOG_INFO_VERB		("info")
-#define AXIS2_IIS_LOG_USER_VERB         ("user")
-#define AXIS2_IIS_LOG_CRITICAL_VERB	("critical")
-#define AXIS2_IIS_LOG_WARN_VERB		("warning")
-#define AXIS2_IIS_LOG_DEBUG_VERB	("debug")
+#define MAX_FILE_PATH				 256
+#define REGISTRY_LOCATION			 "Software\\Apache Axis2c\\IIS ISAPI Redirector"
 
-#define MAX_FILE_PATH				256
-#define REGISTRY_LOCATION			("Software\\Apache Axis2c\\IIS ISAPI Redirector")
 static int is_inited = FALSE;
-static axis2_iis_worker_t *axis2_worker = NULL;
-static const axutil_env_t *axutil_env = NULL;
-static axis2_char_t repo_path[MAX_FILE_PATH] = "c:\\axis2c";
-static axis2_char_t log_file[MAX_FILE_PATH] = "axis2.log";
-static axutil_log_levels_t log_level = AXIS2_LOG_LEVEL_CRITICAL;
-static axis2_char_t redirect_word[INTERNET_MAX_URL_LENGTH] =
-"/axis2/mod_axis2_IIS.dll\?";
+static axis2_iis_worker_t *axis2_worker		 = NULL;
+static const axutil_env_t *axutil_env		 = NULL;
+
+/* Configuration parameters */
+static axis2_char_t *axis2_location			 = "axis2";
+static axis2_char_t *axis2_service_url_prefix= "services";
+static axis2_char_t repo_path[MAX_FILE_PATH];
+static axis2_char_t log_file[MAX_FILE_PATH];
+static axutil_log_levels_t log_level		 = AXIS2_LOG_LEVEL_CRITICAL;
+
+/* Path variables */ 
+static char szOriginalPath[_MAX_PATH + 1];
+static char szPath[_MAX_PATH + 1];
+
+axis2_char_t    general_error[] = "<html>\r\n" 
+                        "<head><title> An IIS server error occurred. </title></head>\r\n" 
+                        "<h1> An IIS server error occurred </h1>\r\n" 
+                        "<hr>\r\n" 
+                        "An error occurred in IIS while processing this request."; 
+
+axis2_char_t	initializing_error[] = "<html>\r\n" 
+                        "<head><title> An IIS server error occurred. </title></head>\r\n" 
+                        "<h1> An IIS server error occurred </h1>\r\n" 
+                        "<hr>\r\n" 
+                        "An error occurred while initilizing Axis2/C. Please verify the configuration"; 
+
 
 /*
  * This is a utility functipn for reading configuration data from the registery.
  */ 
-static axis2_status_t read_registery_init_data(
-    );
+static axis2_status_t AXIS2_CALL 
+read_registery_init_data();
 
 /*
  * Utility function for reading 
  */ 
-static axis2_status_t get_registry_config_parameter(
+static axis2_status_t AXIS2_CALL get_registry_config_parameter(
     HKEY hkey,
     const char *tag,
     char *b,
@@ -78,146 +102,289 @@
 /*
  * Parse the given string and return the corresponding log_level
  */ 
-axutil_log_levels_t axis2_iis_parse_log_level(char level[]);
-
-/*
- * This is the entry point for the extention. The filter will redirect a 
- * given request to this extentiom. 
- */ 
-BOOL WINAPI GetExtensionVersion(HSE_VERSION_INFO * pVer) 
-{
-    /* Create the extension version string, and copy string to HSE_VERSION_INFO structure.*/ 
-    pVer->dwExtensionVersion =
-        MAKELONG(HSE_VERSION_MINOR, HSE_VERSION_MAJOR);
-    /* Copy description string into HSE_VERSION_INFO structure.*/ 
-    strcpy(pVer->lpszExtensionDesc, "Apache Axis2c ISAPI Redirector");
-    return TRUE;
-}
-
-/*
- * This is the entri point for every request to the axis2c. The redirected response 
- * will come here. This method invoke the axis2 engine and build the response result 
- * and send it.
- */ 
-DWORD WINAPI HttpExtensionProc(LPEXTENSION_CONTROL_BLOCK lpECB) 
-{
-    lpECB->dwHttpStatusCode = HTTP_INTERNAL_SERVER_ERROR;
-    if (axis2_worker)
-        AXIS2_IIS_WORKER_PROCESS_REQUEST(axis2_worker, axutil_env, lpECB);
-    else
-        return HSE_STATUS_ERROR;
-    return HSE_STATUS_SUCCESS;}
-
-/**
- * This method initializes the axis2 engine. All the required variables are set to 
- * their initial values in this method.
-*/ 
-axis2_status_t init_axis2() 
-{
-    /*
-     * These are the varibles required to initialize axis.
-     */ 
-    axis2_status_t status = FALSE;
-    /* We need to init xml readers before we go into threaded env */     
-    if (!is_inited)
-    {
-        axiom_xml_reader_init();
-        status = read_registery_init_data();
-        axutil_error_init();
-        axutil_env = axutil_env_create_all(log_file, log_level);
-        if (axutil_env == NULL)
-        {
-            return FALSE;
-        }
-        axis2_worker = axis2_iis_worker_create(axutil_env, repo_path);
-        if (axis2_worker == NULL)
-        {
-            return FALSE;
-        }
-        is_inited = TRUE;
-    }
-    return TRUE;
-}
-BOOL WINAPI TerminateExtension(DWORD dwFlags) 
-{
-    return TRUE;
-}
-axis2_status_t axis2_terminate() 
-{
-    /*  axiom_xml_reader_cleanup();*/
-    /*  AXIS2_IIS_WORKER_FREE(axis2_worker, axutil_env);*/
-    /*  axutil_env_free(axutil_env);*/
-    return TRUE;
-}
-
-axis2_status_t get_extension_url(char url[], char ret_url[]) 
-{
-    /* Should contain "/axis2/"*/
-    ret_url[0] = '\0';
-
-    /* The url should begin with "/axis2/"*/
-    if (url[0] == '/' && (url[1] == 'a' || url[1] == 'A') 
-        &&(url[2] == 'x' || url[2] == 'X') 
-        &&(url[3] == 'i' || url[3] == 'I') 
-        &&(url[4] == 's' || url[4] == 'S') 
-        &&url[5] == '2' && url[6] == '/')
-    {
-        /* Append the string to redirect the request*/
-        strcpy(ret_url, redirect_word);
-        strcat(ret_url, &url[7]);
-        return TRUE;
-    }
-    if (url[0] == '/' && (url[1] == 'a' || url[1] == 'A') 
-        &&(url[2] == 'x' || url[2] == 'X') 
-        &&(url[3] == 'i' || url[3] == 'I') 
-        &&(url[4] == 's' || url[4] == 'S')         &&url[5] == '2' && url[6] == '\0')
-    {
-        strcpy(ret_url, redirect_word);
-        return TRUE;
-    }
-    return FALSE;
-}
-axis2_status_t read_registery_init_data() 
+axutil_log_levels_t AXIS2_CALL axis2_iis_parse_log_level(char level[]);
+
+/*
+ * Initialize axis. This function is called in the begining of the module loading.
+ * It initializes the axis by reading values from the configuration and creating the
+ * required structures for the axis2c
+*/
+axis2_status_t AXIS2_CALL init_axis2();
+    
+/* 
+ * This is the function to be called after the processing 
+ * is over for non Axis2 requets
+ */
+VOID 
+WINAPI 
+ExecUrlCompletion ( 
+    EXTENSION_CONTROL_BLOCK *   pecb, 
+    PVOID                       pContext, 
+    DWORD                       cbIO, 
+    DWORD                       dwError 
+    ); 
+
+/* 
+ * If somethign went wrong in the IIS server when 
+ * we are proccessing we send this 
+ */
+BOOL 
+send_error(		
+	EXTENSION_CONTROL_BLOCK * pecb, 
+    CHAR error[]); 
+
+axis2_status_t AXIS2_CALL init_axis2();
+
+BOOL 
+WINAPI 
+GetExtensionVersion(HSE_VERSION_INFO * pVer)  
+{     
+    pVer->dwExtensionVersion = MAKELONG( HSE_VERSION_MINOR, 
+                                         HSE_VERSION_MAJOR); 
+    strncpy( pVer->lpszExtensionDesc, 
+             "WildCardMap Sample ISAPI Extension", HSE_MAX_EXT_DLL_NAME_LEN ); 
+
+    pVer->lpszExtensionDesc[HSE_MAX_EXT_DLL_NAME_LEN-1] = '\0'; 
+	server_version = 5;
+	return TRUE; 
+} 
+
+DWORD 
+WINAPI 
+HttpExtensionProc(EXTENSION_CONTROL_BLOCK * pecb) 
+
+{ 
+    HSE_EXEC_URL_INFO   ExecUrlInfo; 
+    DWORD               cbData = INTERNET_MAX_URL_LENGTH; 
+    char				url[INTERNET_MAX_URL_LENGTH]; 
+	axis2_bool_t		is_for_us = AXIS2_FALSE;
+
+    /* Get the URL */      
+    if ( pecb->GetServerVariable( pecb->ConnID, 
+                                  "URL", 
+                                  url, 
+                                  &cbData ) == FALSE ) 
+    { 
+        return HSE_STATUS_ERROR;  
+    } 
+	/* Check weather we have a request for Axis2/C */
+	if (strlen(url) > strlen(axis2_location))
+    {
+		int i = 0;
+		is_for_us = AXIS2_TRUE;	
+		while (axis2_location[i] != '\0')
+		{
+			if (axis2_location[i] != (url + 1)[i]) {
+				is_for_us = AXIS2_FALSE;
+				break;
+			}
+			i++;
+		}		
+	}
+		
+	if (is_for_us)
+	{		
+		if (!is_inited) 
+		{			
+			DWORD dwBufferSize = 0;
+			axis2_char_t server_software[256];
+			axis2_char_t *version = NULL;
+
+			ZeroMemory(szOriginalPath, sizeof szOriginalPath);
+			dwBufferSize = sizeof szOriginalPath;
+
+#if _WIN32_WINNT >= 0x0502
+			GetDllDirectory( dwBufferSize, szOriginalPath );
+#else
+			GetCurrentDirectory( dwBufferSize, szOriginalPath );
+#endif
+			ZeroMemory(szPath, sizeof szPath);
+			dwBufferSize = sizeof szPath;
+			/* Get the current physical paht */
+			if (pecb->GetServerVariable(pecb->ConnID, "APPL_PHYSICAL_PATH", szPath, &dwBufferSize) == FALSE)
+			{
+				send_error(pecb, initializing_error);
+				return HSE_STATUS_ERROR;				
+			}
+			/* Retrieve the server version */
+			dwBufferSize = 32;
+			if (pecb->GetServerVariable(pecb->ConnID, "SERVER_SOFTWARE", server_software, &dwBufferSize) == FALSE)
+			{
+				send_error(pecb, initializing_error);
+				return HSE_STATUS_ERROR;				
+			}
+			version = axutil_strchr(server_software, '/');	
+			if (version)
+			{
+				server_version = atoi(version + 1);
+			}
+#if _WIN32_WINNT >= 0x0502
+			SetDllDirectory( szPath );
+#else
+			SetCurrentDirectory( szPath );
+#endif
+			/* If we haven't initialized axis2/c before initialization failed */
+			if (AXIS2_FAILURE == init_axis2())
+			{
+				send_error(pecb, initializing_error);
+			}
+#if _WIN32_WINNT >= 0x0502
+			SetDllDirectory( szOriginalPath );
+#else
+			SetCurrentDirectory( szOriginalPath );
+#endif
+		}	
+
+		/* Windows cannot find the correct dlls unless the path is set*/ 
+#if _WIN32_WINNT >= 0x0502
+		SetDllDirectory( szPath );
+#else
+		SetCurrentDirectory( szPath );
+#endif
+		pecb->dwHttpStatusCode = HTTP_INTERNAL_SERVER_ERROR;
+		/* We are sure that worker is not NULL since it is NULL init_axis2 would have failed */
+		axis2_iis_worker_process_request(axis2_worker, axutil_env, pecb);
+
+	    /* Windows cannot find the correct dlls unless the dir is set
+		 but we want to reset to previous dir after the load */
+#if _WIN32_WINNT >= 0x0502
+		SetDllDirectory( szOriginalPath );
+#else
+		SetCurrentDirectory( szOriginalPath );
+#endif
+		return HSE_STATUS_SUCCESS;
+	}
+	else if (server_version >= 6)
+	{
+		/* For IIS 5.1 or earlier this code is never executed. Since the URL is 
+		redirected to Axis2/C by the Filter */
+
+		/* If not for Axis2/C let the request go to who ever wants it */
+		ExecUrlInfo.pszUrl = NULL;          /* Use original request URL */
+		ExecUrlInfo.pszMethod = NULL;       /* Use original request method */
+		ExecUrlInfo.pszChildHeaders = NULL; /* Use original request headers */
+		ExecUrlInfo.pUserInfo = NULL;       /* Use original request user info */
+		ExecUrlInfo.pEntity = NULL;         /* Use original request entity */
+		
+		/* Provent recursion */
+		ExecUrlInfo.dwExecUrlFlags = HSE_EXEC_URL_IGNORE_CURRENT_INTERCEPTOR; 
+	     
+		/* Associate the completion routine and the current URL with this request. */ 
+		if ( pecb->ServerSupportFunction( pecb->ConnID, 
+										  HSE_REQ_IO_COMPLETION, 
+										  ExecUrlCompletion, 
+										  NULL,  
+										  NULL) == FALSE ) 
+		{        
+			return HSE_STATUS_ERROR; 
+		} 
+	    		
+		/* Ok, now that everything is set up, let's call the child request */     
+		if ( pecb->ServerSupportFunction( pecb->ConnID, 
+										  HSE_REQ_EXEC_URL, 
+										  &ExecUrlInfo, 
+										  NULL, 
+										  NULL ) == FALSE ) 
+		{         
+			return HSE_STATUS_ERROR; 
+		} 
+		/* Return pending and let the completion clean up */ 
+		return HSE_STATUS_PENDING; 
+	} 
+	return HSE_STATUS_ERROR;
+} 
+
+VOID 
+WINAPI 
+ExecUrlCompletion ( 
+    EXTENSION_CONTROL_BLOCK *   pecb, 
+    PVOID                       pContext, 
+    DWORD                       cbIO, 
+    DWORD                       dwError 
+    ) 
+{ 
+	/* We are done so notify */
+    pecb->ServerSupportFunction( 
+        pecb->ConnID, 
+        HSE_REQ_DONE_WITH_SESSION, 
+        NULL, 
+        NULL, 
+        NULL); 
+} 
+
+
+BOOL 
+send_error(		
+	EXTENSION_CONTROL_BLOCK * pecb, 
+    axis2_char_t error[]) 
+{ 
+    DWORD   cbData;             
+    pecb->dwHttpStatusCode = 500;     
+    /* Send headers and response */    
+    pecb->ServerSupportFunction( pecb->ConnID, 
+                                 HSE_REQ_SEND_RESPONSE_HEADER, 
+                                 "500 Server Error", 
+                                 NULL, 
+                                 (LPDWORD)"Content-Type: text/html\r\n\r\n" ); 
+
+    cbData = axutil_strlen( error ); 
+    return pecb->WriteClient( pecb->ConnID, 
+                              error, 
+                              &cbData, 
+                              HSE_IO_SYNC ); 
+} 
+
+axis2_status_t AXIS2_CALL read_registery_init_data() 
 {
     long rc = 0;
     axis2_status_t ok = TRUE;
     char tmpbuf[INTERNET_MAX_URL_LENGTH];
     HKEY hkey;
+	AXIS2_IMPORT extern axis2_char_t *axis2_request_url_prefix;
 
-    rc =
-        RegOpenKeyEx(HKEY_LOCAL_MACHINE,         REGISTRY_LOCATION, (DWORD) 0,
-        KEY_READ, &hkey);
+    rc = RegOpenKeyEx(HKEY_LOCAL_MACHINE, REGISTRY_LOCATION, (DWORD) 0, KEY_READ, &hkey);
     if (ERROR_SUCCESS != rc)
     {
-        return FALSE;
+        return AXIS2_FAILURE;
     }
-    if (get_registry_config_parameter
-        (hkey,         AXIS2_IIS_REPO_PATH_TAG,         tmpbuf, sizeof(repo_path)))
+    if (get_registry_config_parameter(hkey, AXIS2_IIS_REPO_PATH_TAG, tmpbuf, sizeof(repo_path)))
     {
         strcpy(repo_path, tmpbuf);
     }
     else
     {
-        ok = FALSE;
+		return AXIS2_FAILURE;
     }
-    if (get_registry_config_parameter
-        (hkey,         AXIS2_IIS_LOG_FILE_TAG,         tmpbuf, sizeof(log_file)))
+    if (get_registry_config_parameter(hkey, AXIS2_IIS_LOG_FILE_TAG, tmpbuf, sizeof(log_file)))
     {
         strcpy(log_file, tmpbuf);
     }
     else
     {
-        ok = FALSE;
+		return AXIS2_FAILURE;
     }
-    if (get_registry_config_parameter
-        (hkey,         AXIS2_IIS_LOG_LEVEL_TAG,         tmpbuf, sizeof(tmpbuf)))
+    if (get_registry_config_parameter(hkey, AXIS2_IIS_LOG_LEVEL_TAG, tmpbuf, sizeof(tmpbuf)))
     {
         log_level = axis2_iis_parse_log_level(tmpbuf);
     }
+	else 
+	{
+		return AXIS2_FAILURE;
+	}
+	if (get_registry_config_parameter(hkey, AXIS2_IIS_SERVICE_URL_PREFIX, tmpbuf, sizeof(tmpbuf)))
+	{
+		axis2_request_url_prefix = _strdup(tmpbuf); 
+	}
+	if (get_registry_config_parameter(hkey, AXIS2_IIS_AXIS2_LOCATION, tmpbuf, sizeof(tmpbuf)))
+	{
+		axis2_location = _strdup(tmpbuf); 
+	}
     RegCloseKey(hkey);
     return ok;
 }
-axutil_log_levels_t axis2_iis_parse_log_level(char level[]) 
+
+axutil_log_levels_t AXIS2_CALL 
+axis2_iis_parse_log_level(char level[]) 
 {
     if (0 == AXIS2_STRICMP(level, AXIS2_IIS_LOG_TRACE_VERB))
     {
@@ -247,10 +414,11 @@
     {
         return AXIS2_LOG_LEVEL_CRITICAL;
     }
-    return AXIS2_LOG_LEVEL_CRITICAL;
+    return AXIS2_LOG_LEVEL_DEBUG;
 }
-axis2_status_t get_registry_config_parameter(HKEY hkey,                                              const char *tag,
-                                             char *b, DWORD sz) 
+
+axis2_status_t AXIS2_CALL 
+get_registry_config_parameter(HKEY hkey, const char *tag, char *b, DWORD sz) 
 {
     DWORD type = 0;
     LONG lrc;
@@ -263,3 +431,40 @@
     b[sz] = '\0';
     return TRUE;
 }
+
+/**
+ * This method initializes the axis2 engine. All the required variables are set to 
+ * their initial values in this method.
+*/ 
+axis2_status_t AXIS2_CALL init_axis2() 
+{
+    /*
+     * These are the varibles required to initialize axis.
+     */ 
+    axis2_status_t status = FALSE;
+    /* We need to init xml readers before we go into threaded env */     
+    if (!is_inited)
+    {
+        axiom_xml_reader_init();
+        status = read_registery_init_data();
+		if (status == AXIS2_FAILURE)
+		{
+			return AXIS2_FAILURE;
+		}
+        axutil_error_init();
+		/* Initialize the environement */
+        axutil_env = axutil_env_create_all(log_file, log_level);
+        if (!axutil_env)
+        {
+            return AXIS2_FAILURE;
+        }
+        axis2_worker = axis2_iis_worker_create(axutil_env, repo_path);
+        if (!axis2_worker)
+        {
+            return AXIS2_FAILURE;
+        }
+        is_inited = AXIS2_TRUE;
+		return AXIS2_SUCCESS;
+    }
+    return AXIS2_FAILURE;
+}

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/server/IIS/iis_iaspi_plugin_51/axis2_isapi_51.c
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/server/IIS/iis_iaspi_plugin_51/axis2_isapi_51.c?rev=666526&r1=666525&r2=666526&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/server/IIS/iis_iaspi_plugin_51/axis2_isapi_51.c (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/server/IIS/iis_iaspi_plugin_51/axis2_isapi_51.c Tue Jun 10 22:08:36 2008
@@ -22,81 +22,83 @@
 #include <string.h>
 #include <httpfilt.h>
     
-#include "..\\axis2_isapi_plugin.h"
+#include <axis2_const.h>
+#include <axis2_defines.h>
+#include <axutil_env.h>
+#include <axutil_stream.h>
+
 #include "..\\axis2_iis_constants.h"
-    
 
+static axis2_char_t redirect_word[INTERNET_MAX_URL_LENGTH] = "/axis2/mod_axis2_IIS.dll\?";
 /*
-This function is called by the IIS server at the server 
-initialization. So this is the ideal plcae for initializing 
-axis2c.
-*/ 
-    BOOL WINAPI GetFilterVersion(PHTTP_FILTER_VERSION pVer) 
-{
-    
DWORD rc = FALSE;
-    
ULONG http_filter_revision = HTTP_FILTER_REVISION;
-    
pVer->dwFilterVersion = pVer->dwServerFilterVersion;
-    
if (pVer->dwFilterVersion > http_filter_revision)
-    {
-        
pVer->dwFilterVersion = http_filter_revision;
-    
}
-    
-        /*
-           Receive notifictions when
-           1. Server preprocessed the headers.
-           2. Log 
-           3. All the request coming in secure and none secure ports.
-         */ 
-        pVer->dwFlags =
-        (SF_NOTIFY_ORDER_HIGH | 
SF_NOTIFY_PREPROC_HEADERS |
-         
SF_NOTIFY_SECURE_PORT | 
SF_NOTIFY_NONSECURE_PORT |
-         
SF_NOTIFY_AUTH_COMPLETE 
);
-    
-        /* Give a short discription about the module.*/
-        strcpy(pVer->lpszFilterDesc, "axis2c filter");
-    
-        /* initialize axis2*/
-        rc = init_axis2();
-    

return rc;
-
}
-
-
+ * Search a given uri to find weather it matches a uri for the axis2
+ * The uri format for axis2 is of the form
+ * scheme://server:port/axis2/other_parts
+ * This function search  a give uri for the /axis2/. If a match
+ * is found it will replace the /axis2 part of the url with /axis2/mod_iis.dll?
+*/
+axis2_status_t AXIS2_CALL 
+get_extension_url(char url[], char ret_url[]);
 
 /*
-When a notification happens this function is called by the IIS.
+ * This function is called by the IIS server at the server 
+ * initialization. So this is the ideal plcae for initializing 
+ * axis2c.
 */ 
-    DWORD WINAPI HttpFilterProc(
PHTTP_FILTER_CONTEXT pfc,
-                                
DWORD notificationType,
-                                
LPVOID pvNotification) 
-{
-    

DWORD bufferLength = INTERNET_MAX_URL_LENGTH;
-    
char url[INTERNET_MAX_URL_LENGTH];
-    
char modified_url[INTERNET_MAX_URL_LENGTH];
-    


if (notificationType == SF_NOTIFY_PREPROC_HEADERS)
-        
-    {
-        
pfc->GetServerVariable(pfc, "HTTP_URL", url, &bufferLength);
-        
if (get_extension_url(url, modified_url))
-            
-        {
-            
((PHTTP_FILTER_PREPROC_HEADERS) pvNotification)->SetHeader(pfc,
-                                                                        "url",
-                                                                        modified_url);
-            
return SF_STATUS_REQ_HANDLED_NOTIFICATION;
-        
}
-    
}
-    
return SF_STATUS_REQ_NEXT_NOTIFICATION;
-
}
-
-
+BOOL WINAPI GetFilterVersion(PHTTP_FILTER_VERSION pVer) 
+{
	ULONG http_filter_revision = HTTP_FILTER_REVISION;
	pVer->dwFilterVersion = pVer->dwServerFilterVersion;
	if (pVer->dwFilterVersion > http_filter_revision)
+	{
		pVer->dwFilterVersion = http_filter_revision;
	}
+
+	/*
+	Receive notifictions when
+	1. Server preprocessed the headers.
+	2. Log 
+	3. All the request coming in secure and none secure ports.
+	*/ 
+	pVer->dwFlags =
+		(SF_NOTIFY_ORDER_HIGH | 
		SF_NOTIFY_PREPROC_HEADERS |
		SF_NOTIFY_SECURE_PORT | 
		SF_NOTIFY_NONSECURE_PORT |
		SF_NOTIFY_AUTH_COMPLETE 
		);
+
+	/* Give a short discription about the module.*/
+	strcpy(pVer->lpszFilterDesc, "axis2c filter");
+	/* initialize axis2*/
+
	return TRUE;
}
 
 /*
-This is the exit point of the filter. Here we shut down 
-the axis2 engine.
+When a notification happens this function is called by the IIS.
 */ 
-    BOOL WINAPI TerminateFilter(DWORD dwfalgs) 
+DWORD WINAPI HttpFilterProc(
		PHTTP_FILTER_CONTEXT pfc,
		DWORD notificationType,
		LPVOID pvNotification) 
+{
	DWORD bufferLength = INTERNET_MAX_URL_LENGTH;
	char url[INTERNET_MAX_URL_LENGTH];
	char modified_url[INTERNET_MAX_URL_LENGTH];
+
	if (notificationType == SF_NOTIFY_PREPROC_HEADERS)
+	{
		pfc->GetServerVariable(pfc, "HTTP_URL", url, &bufferLength);
		if (get_extension_url(url, modified_url))
+		{
			((PHTTP_FILTER_PREPROC_HEADERS) pvNotification)->SetHeader(pfc,
+				"url",
+				modified_url);
			return SF_STATUS_REQ_HANDLED_NOTIFICATION;
		}
	}
	return SF_STATUS_REQ_NEXT_NOTIFICATION;
}
+
+axis2_status_t AXIS2_CALL 
+get_extension_url(char url[], char ret_url[]) 
 {
-    
return axis2_terminate();
-
}
+    /* Should contain "/axis2/"*/
+    ret_url[0] = '\0';
 
-
+    /* The url should begin with "/axis2/"*/
+    if (url[0] == '/' && (url[1] == 'a' || url[1] == 'A') 
+        &&(url[2] == 'x' || url[2] == 'X') 
+        &&(url[3] == 'i' || url[3] == 'I') 
+        &&(url[4] == 's' || url[4] == 'S') 
+        &&url[5] == '2' && url[6] == '/')
+    {
+        /* Append the string to redirect the request*/
+        strcpy(ret_url, redirect_word);
+        strcat(ret_url, &url[7]);
+        return TRUE;
+    }
+    if (url[0] == '/' && (url[1] == 'a' || url[1] == 'A') 
+        &&(url[2] == 'x' || url[2] == 'X') 
+        &&(url[3] == 'i' || url[3] == 'I') 
+        &&(url[4] == 's' || url[4] == 'S')         &&url[5] == '2' && url[6] == '\0')
+    {
+        strcpy(ret_url, redirect_word);
+        return TRUE;
+    }
+    return FALSE;
+}
\ No newline at end of file

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/server/IIS/mod_axis2.def
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/server/IIS/mod_axis2.def?rev=666526&r1=666525&r2=666526&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/server/IIS/mod_axis2.def (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/server/IIS/mod_axis2.def Tue Jun 10 22:08:36 2008
@@ -1,9 +1,7 @@
 LIBRARY	"mod_axis2_IIS"
 
 EXPORTS
-	HttpFilterProc
-	GetFilterVersion
 	GetExtensionVersion
-	HttpExtensionProc	
-	TerminateFilter
-	TerminateExtension
\ No newline at end of file
+	HttpExtensionProc
+	GetFilterVersion
+	HttpFilterProc	
\ No newline at end of file

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/server/apache2/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/server/apache2/Makefile.am?rev=666526&r1=666525&r2=666526&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/server/apache2/Makefile.am (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/server/apache2/Makefile.am Tue Jun 10 22:08:36 2008
@@ -13,10 +13,7 @@
 		     $(top_builddir)/src/core/transport/http/util/libaxis2_http_util.la\
 		     $(top_builddir)/src/core/transport/http/common/libaxis2_http_common.la\
 		     $(top_builddir)/axiom/src/parser/$(WRAPPER_DIR)/libaxis2_parser.la\
-                    -lpthread \
-                    -L$(top_builddir)$(GUTHTHILA_LIBS) \
-					$(PARSER_LIBS) \
-					$(LIBXML2_LIBS)
+             -lpthread
 
 libmod_axis2_la_LDFLAGS = -version-info $(VERSION_NO)
 

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/server/apache2/apache2_worker.c
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/server/apache2/apache2_worker.c?rev=666526&r1=666525&r2=666526&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/server/apache2/apache2_worker.c (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/server/apache2/apache2_worker.c Tue Jun 10 22:08:36 2008
@@ -929,7 +929,7 @@
                 in_msg_ctx = msg_ctx_map[AXIS2_WSDL_MESSAGE_LABEL_IN];
                 if (in_msg_ctx)
                 {
-                    /* TODO: Add neccessary handling */
+                    /* TODO: Add necessary handling */
                 }
                 if (out_msg_ctx)
                 {
@@ -1028,7 +1028,7 @@
                 in_msg_ctx = msg_ctx_map[AXIS2_WSDL_MESSAGE_LABEL_IN];
                 if (in_msg_ctx)
                 {
-                    /* TODO: Add neccessary handling */
+                    /* TODO: Add necessary handling */
                 }
                 if (out_msg_ctx)
                 {

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/util/http_transport_utils.c
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/util/http_transport_utils.c?rev=666526&r1=666525&r2=666526&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/util/http_transport_utils.c (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/util/http_transport_utils.c Tue Jun 10 22:08:36 2008
@@ -547,6 +547,7 @@
             }
             axis2_msg_ctx_set_doing_rest(msg_ctx, env, AXIS2_TRUE);
             axis2_msg_ctx_set_rest_http_method(msg_ctx, env, AXIS2_HTTP_POST);
+			axis2_msg_ctx_set_soap_envelope(msg_ctx, env, soap_envelope);
         }
         else
         {
@@ -734,7 +735,7 @@
         if (value &&
             axutil_strstr(value, AXIS2_HTTP_HEADER_TRANSFER_ENCODING_CHUNKED))
         {
-            /* this is an UGLY hack to get some of the trnaports working 
+            /* this is an UGLY hack to get some of the transports working 
                e.g. PHP transport where it strips the chunking info in case of chunking 
                and also gives out a content lenght of 0.
                We need to fix the transport design to fix sutuations like this.
@@ -952,6 +953,7 @@
             }
             axis2_msg_ctx_set_doing_rest(msg_ctx, env, AXIS2_TRUE);
             axis2_msg_ctx_set_rest_http_method(msg_ctx, env, AXIS2_HTTP_PUT);
+			axis2_msg_ctx_set_soap_envelope(msg_ctx, env, soap_envelope);
         }
         else
         {
@@ -1100,21 +1102,19 @@
         axis2_msg_ctx_set_doing_rest(msg_ctx, env, AXIS2_FALSE);
     }
 
-    if (AXIS2_SUCCESS != axis2_http_transport_utils_dispatch_and_verify(env,
-                                                                        msg_ctx))
-    {
-        return AXIS2_FALSE;
-    }
-
     soap_envelope =
-        axis2_http_transport_utils_handle_media_type_url_encoded(env, msg_ctx,
-                                                                 request_params,
+        axis2_http_transport_utils_handle_media_type_url_encoded(env, msg_ctx, 
+																 request_params,
                                                                  AXIS2_HTTP_HEAD);
     if (!soap_envelope)
     {
         return AXIS2_FALSE;
     }
     axis2_msg_ctx_set_soap_envelope(msg_ctx, env, soap_envelope);
+	if (AXIS2_SUCCESS != axis2_http_transport_utils_dispatch_and_verify(env, msg_ctx))
+	{
+		return AXIS2_FALSE;
+	}
     engine = axis2_engine_create(env, conf_ctx);
     axis2_engine_receive(engine, env, msg_ctx);
     return AXIS2_TRUE;
@@ -1167,12 +1167,6 @@
         axis2_msg_ctx_set_doing_rest(msg_ctx, env, AXIS2_FALSE);
     }
 
-    if (AXIS2_SUCCESS != axis2_http_transport_utils_dispatch_and_verify(env,
-                                                                        msg_ctx))
-    {
-        return AXIS2_FALSE;
-    }
-
     soap_envelope =
         axis2_http_transport_utils_handle_media_type_url_encoded(env, msg_ctx,
                                                                  request_params,
@@ -1182,6 +1176,11 @@
         return AXIS2_FALSE;
     }
     axis2_msg_ctx_set_soap_envelope(msg_ctx, env, soap_envelope);
+	if (AXIS2_SUCCESS != axis2_http_transport_utils_dispatch_and_verify(env, msg_ctx))
+	{
+		return AXIS2_FALSE;
+	}
+
     engine = axis2_engine_create(env, conf_ctx);
     axis2_engine_receive(engine, env, msg_ctx);
     return AXIS2_TRUE;
@@ -1234,11 +1233,6 @@
         axis2_msg_ctx_set_doing_rest(msg_ctx, env, AXIS2_FALSE);
     }
 
-    if (AXIS2_SUCCESS != axis2_http_transport_utils_dispatch_and_verify(env,
-                                                                        msg_ctx))
-    {
-        return AXIS2_FALSE;
-    }
 
     soap_envelope =
         axis2_http_transport_utils_handle_media_type_url_encoded(env, msg_ctx,
@@ -1248,7 +1242,14 @@
     {
         return AXIS2_FALSE;
     }
-    axis2_msg_ctx_set_soap_envelope(msg_ctx, env, soap_envelope);
+    
+	axis2_msg_ctx_set_soap_envelope(msg_ctx, env, soap_envelope);
+
+
+	if (AXIS2_SUCCESS != axis2_http_transport_utils_dispatch_and_verify(env, msg_ctx))
+	{
+		return AXIS2_FALSE;
+	}
     engine = axis2_engine_create(env, conf_ctx);
     axis2_engine_receive(engine, env, msg_ctx);
     return AXIS2_TRUE;
@@ -1841,6 +1842,7 @@
     axutil_property_t *property = NULL;
     axutil_hash_t *binary_data_map = NULL;
     axiom_soap_envelope_t *soap_envelope = NULL;
+	axutil_stream_t *stream = NULL;
 
     AXIS2_PARAM_CHECK(env->error, msg_ctx, NULL);
     AXIS2_PARAM_CHECK(env->error, soap_ns_uri, NULL);
@@ -1942,7 +1944,6 @@
         if (mime_boundary)
         {
             axiom_mime_parser_t *mime_parser = NULL;
-            axutil_stream_t *stream = NULL;
             int soap_body_len = 0;
             axis2_char_t *soap_body_str = NULL;
             axutil_param_t *buffer_size_param = NULL;
@@ -2030,6 +2031,15 @@
 
             axiom_mime_parser_free(mime_parser, env);
             mime_parser = NULL;
+			if(mime_boundary)
+			{
+	    		AXIS2_FREE(env->allocator, mime_boundary);
+			}
+
+			if(soap_body_str)
+			{
+			    AXIS2_FREE(env->allocator, soap_body_str); 
+			}
         }
     }
 
@@ -2084,6 +2094,11 @@
                 axiom_soap_body_has_fault(soap_body, env);
             }
         }
+		if(stream)
+		{
+			axutil_stream_free(stream, env);
+			callback_ctx->in_stream = NULL;
+		}
     }
     else
     {
@@ -2118,6 +2133,7 @@
         axiom_soap_body_add_child(def_body, env, root_node);
         axiom_stax_builder_free_self(om_builder, env);
     }
+
     return soap_envelope;
 }
 

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/src/core/util/core_utils.c
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/src/core/util/core_utils.c?rev=666526&r1=666525&r2=666526&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/src/core/util/core_utils.c (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/src/core/util/core_utils.c Tue Jun 10 22:08:36 2008
@@ -423,3 +423,115 @@
     return AXIS2_FAILURE;
 }
 
+
+AXIS2_EXTERN axis2_op_t *AXIS2_CALL
+axis2_core_utils_get_rest_op_with_method_and_location(
+	const axis2_svc_t * svc,
+	const axutil_env_t * env,
+	const axis2_char_t * method,
+	const axis2_char_t * location,
+	int * param_count,
+	axis2_char_t **** params)
+	{
+	axutil_array_list_t *op_list = NULL;
+	axis2_char_t *loc_str = NULL;
+	axis2_char_t *loc_str_tmp = NULL;
+	axis2_char_t *rindex = NULL;
+	axis2_bool_t pass_one = AXIS2_TRUE;
+	axis2_bool_t loop_state = AXIS2_TRUE;
+	AXIS2_PARAM_CHECK(env->error, location, NULL);
+	AXIS2_PARAM_CHECK(env->error, method, NULL);
+
+	loc_str = axutil_strtrim(env, location, NULL);
+	if (!loc_str)
+		{
+		return NULL;
+		}
+	loc_str_tmp = loc_str;
+	if (loc_str_tmp[0] == '/')
+		{
+		loc_str_tmp++;
+		}
+	if (strchr(loc_str_tmp, '?'))
+		{
+		axis2_char_t *temp = NULL;
+
+		temp = strchr(loc_str_tmp, '?');
+		temp[0] = '\0';
+		}
+	while(loop_state)
+		{
+		rindex = axutil_rindex(loc_str_tmp, '/');
+
+		if (rindex && *rindex)
+			{
+			loc_str_tmp = axutil_string_substring_ending_at(loc_str_tmp, (int)(rindex - loc_str_tmp));
+			/* We are sure that the difference lies within the int range */
+			}
+		else if (pass_one)
+			{
+			pass_one = AXIS2_FALSE;
+			}
+		else
+			{
+			int i = 0;
+			i = (int)strlen(loc_str_tmp);
+			/* We are sure that the difference lies within the int range */
+			if (i == 0)
+				{
+				break;
+				}
+			loc_str_tmp[i - 1] = '\0';
+			}
+
+		if (!loc_str_tmp || !*loc_str_tmp)
+			{
+			break;
+			}
+		op_list = axis2_svc_get_rest_op_list_with_method_and_location(svc, env,
+			method, loc_str_tmp);
+		if (op_list && axutil_array_list_size(op_list, env) != 0)
+			{
+			int i = 0;
+			int size = 0;
+
+			size = axutil_array_list_size(op_list, env);
+			for (i = 0; i < size; i++)
+				{
+				axis2_op_t *op_temp = NULL;
+				axis2_char_t *op_location = NULL;
+				int match_count = 0;
+				axis2_char_t ***matches = NULL;
+				axis2_status_t status = AXIS2_FAILURE;
+
+				op_temp = axutil_array_list_get(op_list, env, i);
+				op_location = axis2_op_get_rest_http_location(op_temp, env);
+				if (!op_location)
+					{
+					continue;
+					}
+				status = axutil_parse_rest_url_for_params(env, op_location, location,
+					&match_count, &matches);
+				if (status == AXIS2_SUCCESS)
+					{
+					*params = matches;
+					*param_count = match_count;
+					AXIS2_FREE (env->allocator, loc_str);
+					return op_temp;
+					}
+				else if (matches)
+					{
+					for (i = 0; i < match_count; i++)
+						{
+						AXIS2_FREE (env->allocator, matches[i]);
+						}
+					AXIS2_FREE (env->allocator, matches);
+					}
+				}
+			}
+		}
+	AXIS2_FREE (env->allocator, loc_str);
+	return NULL;
+	}
+
+

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/src/modules/mod_addr/addr_out_handler.c
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/src/modules/mod_addr/addr_out_handler.c?rev=666526&r1=666525&r2=666526&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/src/modules/mod_addr/addr_out_handler.c (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/src/modules/mod_addr/addr_out_handler.c Tue Jun 10 22:08:36 2008
@@ -478,9 +478,10 @@
                                                        AXIS2_WSA_MESSAGE_ID,
                                                        &soap_header, addr_ns);
         }
-
+        
         relates_to =
             axis2_msg_info_headers_get_relates_to(msg_info_headers, env);
+
         if (relates_to)
         {
             const axis2_char_t *value = NULL;
@@ -714,7 +715,7 @@
         }
 
         size = axutil_array_list_size(ref_param_list, env);
-        for (i = 0; size; i++)
+        for (i = 0; i < size; i++)
         {
             axiom_node_t *ref_node =
                 (axiom_node_t *) axutil_array_list_get(ref_param_list, env, i);

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/test/core/addr/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/test/core/addr/Makefile.am?rev=666526&r1=666525&r2=666526&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/test/core/addr/Makefile.am (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/test/core/addr/Makefile.am Tue Jun 10 22:08:36 2008
@@ -9,11 +9,9 @@
                     ../../../util/src/libaxutil.la \
                     ../../../axiom/src/om/libaxis2_axiom.la \
                     ../../../axiom/src/parser/$(WRAPPER_DIR)/libaxis2_parser.la \
-		                                 $(top_builddir)/neethi/src/libneethi.la \
+		            $(top_builddir)/neethi/src/libneethi.la \
 					$(top_builddir)/src/core/engine/libaxis2_engine.la \
-					$(top_builddir)/src/core/transport/http/common/libaxis2_http_common.la \
-	                -L$(top_builddir)$(GUTHTHILA_LIBS) \
-	                $(LIBXML2_LIBS)
+					$(top_builddir)/src/core/transport/http/common/libaxis2_http_common.la
 
 INCLUDES = -I${CUTEST_HOME}/include \
             -I$(top_builddir)/src/xml/guththila \

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/test/core/clientapi/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/test/core/clientapi/Makefile.am?rev=666526&r1=666525&r2=666526&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/test/core/clientapi/Makefile.am (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/test/core/clientapi/Makefile.am Tue Jun 10 22:08:36 2008
@@ -11,12 +11,10 @@
                     ../../../util/src/libaxutil.la \
                     ../../../axiom/src/om/libaxis2_axiom.la \
                     ../../../axiom/src/parser/$(WRAPPER_DIR)/libaxis2_parser.la \
-			$(top_builddir)/neethi/src/libneethi.la \
+					$(top_builddir)/neethi/src/libneethi.la \
                     -lpthread \
                     $(top_builddir)/src/core/engine/libaxis2_engine.la \
-                    $(top_builddir)/src/core/transport/http/sender/libaxis2_http_sender.la \
-                    $(LIBXML2_LIBS) \
-                    -L$(top_builddir)$(GUTHTHILA_LIBS)
+                    $(top_builddir)/src/core/transport/http/sender/libaxis2_http_sender.la
 
 test_client_LDADD   =  \
                     ../../../util/src/libaxutil.la \
@@ -25,20 +23,16 @@
 			$(top_builddir)/neethi/src/libneethi.la \
                     -lpthread \
                     $(top_builddir)/src/core/engine/libaxis2_engine.la \
-                    $(top_builddir)/src/core/transport/http/sender/libaxis2_http_sender.la \
-                    $(LIBXML2_LIBS) \
-                    -L$(top_builddir)$(GUTHTHILA_LIBS)
+                    $(top_builddir)/src/core/transport/http/sender/libaxis2_http_sender.la
 
 test_svc_client_handler_count_LDADD   =  \
 					../../../util/src/libaxutil.la \
 					../../../axiom/src/om/libaxis2_axiom.la \
 					../../../axiom/src/parser/$(WRAPPER_DIR)/libaxis2_parser.la \
-			$(top_builddir)/neethi/src/libneethi.la \
+					$(top_builddir)/neethi/src/libneethi.la \
 					-lpthread \
 					$(top_builddir)/src/core/engine/libaxis2_engine.la \
-					$(top_builddir)/src/core/transport/http/sender/libaxis2_http_sender.la \
-					$(LIBXML2_LIBS) \
-					-L$(top_builddir)$(GUTHTHILA_LIBS)
+					$(top_builddir)/src/core/transport/http/sender/libaxis2_http_sender.la
 
 
 INCLUDES = -I${CUTEST_HOME}/include \

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/test/core/context/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/test/core/context/Makefile.am?rev=666526&r1=666525&r2=666526&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/test/core/context/Makefile.am (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/test/core/context/Makefile.am Tue Jun 10 22:08:36 2008
@@ -11,9 +11,7 @@
 						../../../axiom/src/parser/$(WRAPPER_DIR)/libaxis2_parser.la \
 						$(top_builddir)/src/core/engine/libaxis2_engine.la \
 						$(top_builddir)/src/core/transport/http/common/libaxis2_http_common.la \
-						                             $(top_builddir)/neethi/src/libneethi.la \
-			        	-L$(top_builddir)$(GUTHTHILA_LIBS) \
-			        	$(LIBXML2_LIBS)
+						$(top_builddir)/neethi/src/libneethi.la
 
 INCLUDES = -I${CUTEST_HOME}/include \
             -I$(top_builddir)/src/xml/guththila/src \

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/test/core/deployment/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/test/core/deployment/Makefile.am?rev=666526&r1=666525&r2=666526&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/test/core/deployment/Makefile.am (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/test/core/deployment/Makefile.am Tue Jun 10 22:08:36 2008
@@ -8,12 +8,10 @@
                     ../../../util/src/libaxutil.la \
                     ../../../axiom/src/om/libaxis2_axiom.la \
                     ../../../axiom/src/parser/$(WRAPPER_DIR)/libaxis2_parser.la \
-		                                 $(top_builddir)/neethi/src/libneethi.la \
-			$(top_builddir)/src/core/engine/libaxis2_engine.la \
-			$(top_builddir)/src/core/transport/http/common/libaxis2_http_common.la \
-                    -L$(top_builddir)$(GUTHTHILA_LIBS) \
-                    $(LIBXML2_LIBS)
-                    
+		            $(top_builddir)/neethi/src/libneethi.la \
+					$(top_builddir)/src/core/engine/libaxis2_engine.la \
+					$(top_builddir)/src/core/transport/http/common/libaxis2_http_common.la
+
 INCLUDES = -I$(top_builddir)/include \
             -I$(top_builddir)/src/core/description \
             -I$(top_builddir)/src/core/context \
@@ -25,4 +23,3 @@
             -I ../../../util/include \
             -I ../../../axiom/include \
             -I ../../../neethi/include
-			

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/test/core/description/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/test/core/description/Makefile.am?rev=666526&r1=666525&r2=666526&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/test/core/description/Makefile.am (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/test/core/description/Makefile.am Tue Jun 10 22:08:36 2008
@@ -11,9 +11,8 @@
 			-lpthread \
 			$(top_builddir)/neethi/src/libneethi.la \
 			$(top_builddir)/src/core/engine/libaxis2_engine.la \
-			$(top_builddir)/src/core/transport/http/common/libaxis2_http_common.la \
-                    $(LIBXML2_LIBS)
-                    
+			$(top_builddir)/src/core/transport/http/common/libaxis2_http_common.la
+
 INCLUDES = -I$(top_builddir)/include \
             -I$(top_builddir)/src/core/description \
             -I$(top_builddir)/src/core/context \

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/test/core/engine/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/test/core/engine/Makefile.am?rev=666526&r1=666525&r2=666526&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/test/core/engine/Makefile.am (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/test/core/engine/Makefile.am Tue Jun 10 22:08:36 2008
@@ -12,9 +12,7 @@
                     ../../../axiom/src/parser/$(WRAPPER_DIR)/libaxis2_parser.la \
 		$(top_builddir)/src/core/engine/libaxis2_engine.la \
 		$(top_builddir)/src/core/transport/http/common/libaxis2_http_common.la \
-		                             $(top_builddir)/neethi/src/libneethi.la \
-	                -L$(top_builddir)$(GUTHTHILA_LIBS) \
-	                $(LIBXML2_LIBS)
+		                             $(top_builddir)/neethi/src/libneethi.la
 
 INCLUDES =	-I$(top_builddir)/src/xml/guththila \
             -I$(top_builddir)/include \

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/test/core/transport/http/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/test/core/transport/http/Makefile.am?rev=666526&r1=666525&r2=666526&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/test/core/transport/http/Makefile.am (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/test/core/transport/http/Makefile.am Tue Jun 10 22:08:36 2008
@@ -9,13 +9,11 @@
                                 $(LDFLAGS) \
 		                    ../../../../util/src/libaxutil.la \
        						../../../../axiom/src/om/libaxis2_axiom.la \
-						                             $(top_builddir)/neethi/src/libneethi.la \
+						    $(top_builddir)/neethi/src/libneethi.la \
 		                    ../../../../axiom/src/parser/$(WRAPPER_DIR)/libaxis2_parser.la \
 							$(top_builddir)/src/core/engine/libaxis2_engine.la \
-							$(top_builddir)/src/core/transport/http/sender/libaxis2_http_sender.la \
-							$(LIBXML2_LIBS) \
-                    		-L$(top_builddir)$(GUTHTHILA_LIBS)
-                    
+							$(top_builddir)/src/core/transport/http/sender/libaxis2_http_sender.la
+
 INCLUDES = -I${CUTEST_HOME}/include \
             -I$(top_builddir)/include \
             -I ../../../../util/include \

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/test/itest/whitemesa/round1/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/test/itest/whitemesa/round1/Makefile.am?rev=666526&r1=666525&r2=666526&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/test/itest/whitemesa/round1/Makefile.am (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/test/itest/whitemesa/round1/Makefile.am Tue Jun 10 22:08:36 2008
@@ -8,9 +8,7 @@
 					$(top_builddir)/src/core/engine/libaxis2_engine.la \
 					$(top_builddir)//src/core/transport/http/sender/libaxis2_http_sender.la \
 					$(top_builddir)/src/core/transport/http/receiver/libaxis2_http_receiver.la \
-					$(top_builddir)/src/core/transport/http/common/libaxis2_http_common.la \
-                    -L$(top_builddir)/$(GUTHTHILA_LIBS) \
-                    $(LIBXML2_LIBS)
+					$(top_builddir)/src/core/transport/http/common/libaxis2_http_common.la
 
 INCLUDES = -I$(top_builddir)/include \
             -I ../../../../util/include \

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/test/itest/whitemesa/round2/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/test/itest/whitemesa/round2/Makefile.am?rev=666526&r1=666525&r2=666526&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/test/itest/whitemesa/round2/Makefile.am (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/test/itest/whitemesa/round2/Makefile.am Tue Jun 10 22:08:36 2008
@@ -7,9 +7,7 @@
                     ../../../../axiom/src/parser/$(WRAPPER_DIR)/libaxis2_parser.la \
 					$(top_builddir)/modules/core/engine/libaxis2_engine.la \
 					$(top_builddir)/modules/core/transport/http/sender/libaxis2_http_sender.la \
-					$(top_builddir)/modules/core/transport/http/receiver/libaxis2_http_receiver.la \
-                    -L$(top_builddir)/$(GUTHTHILA_LIBS) \
-                    $(LIBXML2_LIBS)
+					$(top_builddir)/modules/core/transport/http/receiver/libaxis2_http_receiver.la
 
 INCLUDES = -I$(top_builddir)/include \
            -I ../../../../util/include \

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/tools/md5/configure.ac
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/tools/md5/configure.ac?rev=666526&r1=666525&r2=666526&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/tools/md5/configure.ac (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/tools/md5/configure.ac Tue Jun 10 22:08:36 2008
@@ -40,42 +40,6 @@
 AC_CHECK_LIB(z, inflate)
 dnl AC_CHECK_LIB(cutest, CuTestInit)
 
-AC_MSG_CHECKING(whether to build libxml2 xml parser library)
-AC_ARG_ENABLE(libxml2, [  --enable-libxml2    build libxml2 xml parser library wrapper. default=yes],
-[ case "${enableval}" in
-  no)
-    AC_MSG_RESULT(no)
-    WRAPPER_DIR=""
-    ;;
-  *)
-    AC_MSG_RESULT(yes)
-    WRAPPER_DIR="libxml2"
-
-    ;;
-  esac ],
-  AC_MSG_RESULT(yes)
-  WRAPPER_DIR="libxml2"
-)
-
-AC_MSG_CHECKING(whether to build guththila xml parser library)
-AC_ARG_ENABLE(guththila, [  --enable-guththila    build guththila xml parser library wrapper. default=no],
-[ case "${enableval}" in
-  no)
-    AC_MSG_RESULT(no)
-    ;;
-  *)
-    AC_MSG_RESULT(yes)
-    WRAPPER_DIR="guththila"
-    if test -d $srcdir/guththila; then
-        AC_CONFIG_SUBDIRS(guththila)
-    fi
-
-   GUTHTHILA_DIR="guththila"
-    ;;
-  esac ],
-  AC_MSG_RESULT(no)
-)
-
 
 AC_MSG_CHECKING(whether to build tests)
 AC_ARG_ENABLE(tests,

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/tools/tcpmon/configure.ac
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/tools/tcpmon/configure.ac?rev=666526&r1=666525&r2=666526&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/tools/tcpmon/configure.ac (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/tools/tcpmon/configure.ac Tue Jun 10 22:08:36 2008
@@ -40,42 +40,6 @@
 AC_CHECK_LIB(z, inflate)
 dnl AC_CHECK_LIB(cutest, CuTestInit)
 
-AC_MSG_CHECKING(whether to build libxml2 xml parser library)
-AC_ARG_ENABLE(libxml2, [  --enable-libxml2    build libxml2 xml parser library wrapper. default=yes],
-[ case "${enableval}" in
-  no)
-    AC_MSG_RESULT(no)
-    WRAPPER_DIR=""
-    ;;
-  *)
-    AC_MSG_RESULT(yes)
-    WRAPPER_DIR="libxml2"
-
-    ;;
-  esac ],
-  AC_MSG_RESULT(yes)
-  WRAPPER_DIR="libxml2"
-)
-
-AC_MSG_CHECKING(whether to build guththila xml parser library)
-AC_ARG_ENABLE(guththila, [  --enable-guththila    build guththila xml parser library wrapper. default=no],
-[ case "${enableval}" in
-  no)
-    AC_MSG_RESULT(no)
-    ;;
-  *)
-    AC_MSG_RESULT(yes)
-    WRAPPER_DIR="guththila"
-    if test -d $srcdir/guththila; then
-        AC_CONFIG_SUBDIRS(guththila)
-    fi
-
-   GUTHTHILA_DIR="guththila"
-    ;;
-  esac ],
-  AC_MSG_RESULT(no)
-)
-
 
 AC_MSG_CHECKING(whether to build tests)
 AC_ARG_ENABLE(tests,

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/tools/tcpmon/src/tcpmon.c
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/tools/tcpmon/src/tcpmon.c?rev=666526&r1=666525&r2=666526&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/tools/tcpmon/src/tcpmon.c (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/tools/tcpmon/src/tcpmon.c Tue Jun 10 22:08:36 2008
@@ -70,8 +70,8 @@
 {
     axutil_env_t *env = NULL;
     int c;
-    int listen_port = 9090,
-        target_port = 8080;
+    int listen_port = 9099,
+        target_port = 9090; /* the default port simple axis2 server is run on 9090  */
     int test_bit = 0;
     int format_bit = 0;
     int ii = 1;
@@ -83,9 +83,9 @@
              argv[0]);
         fprintf(stdout, " Options :\n");
         fprintf(stdout,
-                "\t-lp LISTEN_PORT \tport number to listen on, default is 9090\n");
+                "\t-lp LISTEN_PORT \tport number to listen on, default is 9099\n");
         fprintf(stdout,
-                "\t-tp TARGET_PORT \tport number to connect and re-direct messages, default is 8080\n");
+                "\t-tp TARGET_PORT \tport number to connect and re-direct messages, default is 9090\n");
         fprintf(stdout,
                 "\t-th TARGET_HOST \ttarget host to connect, default is localhost\n");
         fprintf(stdout,
@@ -107,50 +107,58 @@
     signal(SIGPIPE, sig_handler);
 #endif
 
-    target_host = axutil_strdup(env, "localhost");
+    target_host = axutil_strdup(env, "localhost"); 
 
     while (ii < argc)
     {
         if (!strcmp("-lp", argv[ii]))
         {
             ii++;
-            listen_port = atoi(argv[ii++]);
-            if (listen_port == 0)
+            if (argv[ii])
             {
-                printf("INVALID value for listen port\n");
-                printf("Use -h for help\n");
-                AXIS2_FREE(env->allocator, target_host);
-                if (env)
+                listen_port = atoi(argv[ii++]);
+                if (listen_port == 0)
                 {
-                    axutil_env_free((axutil_env_t *) env);
-                    env = NULL;
+                    printf("INVALID value for listen port\n");
+                    printf("Use -h for help\n");
+                    AXIS2_FREE(env->allocator, target_host);
+                    if (env)
+                    {
+                        axutil_env_free((axutil_env_t *) env);
+                        env = NULL;
+                    }
+                    return 0;
                 }
-                return 0;
             }
-
         }
         else if (!strcmp("-tp", argv[ii]))
         {
             ii++;
-            target_port = atoi(argv[ii++]);
-            if (target_port == 0)
+            if (argv[ii])
             {
-                printf("INVALID value for target port\n");
-                printf("Use -h for help\n");
-                AXIS2_FREE(env->allocator, target_host);
-                if (env)
+                target_port = atoi(argv[ii++]);
+                if (target_port == 0)
                 {
-                    axutil_env_free((axutil_env_t *) env);
-                    env = NULL;
+                    printf("INVALID value for target port\n");
+                    printf("Use -h for help\n");
+                    AXIS2_FREE(env->allocator, target_host);
+                    if (env)
+                    {
+                        axutil_env_free((axutil_env_t *) env);
+                        env = NULL;
+                    }
+                    return 0;
                 }
-                return 0;
             }
         }
         else if (!strcmp("-th", argv[ii]))
         {
             ii++;
-            AXIS2_FREE(env->allocator, target_host);
-            target_host = (char *) axutil_strdup(env, argv[ii++]);
+            if (argv[ii])
+            {
+                AXIS2_FREE(env->allocator, target_host);
+                target_host = (char *) axutil_strdup(env, argv[ii++]);
+            }
         }
         else if (!strcmp("--test", argv[ii]))
         {
@@ -165,7 +173,10 @@
         else if (!strcmp("-f", argv[ii]))
         {
             ii++;
-            tcpmon_traffic_log = argv[ii++];
+            if (argv[ii])
+            {
+                tcpmon_traffic_log = argv[ii++];
+            }
         }
         else
         {

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/util/include/axutil_property.h
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/util/include/axutil_property.h?rev=666526&r1=666525&r2=666526&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/util/include/axutil_property.h (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/util/include/axutil_property.h Tue Jun 10 22:08:36 2008
@@ -53,6 +53,9 @@
      *              AXIS2_SCOPE_SESSION
      *              AXIS2_SCOPE_APPLICATION
      *              pass 0 to use default scope of AXIS2_SCOPE_REQUEST
+     * @param own_value whether value is owned by the property or not.
+     *              if the value is owned by the property it should be freed
+     *              by the proeprty.
      * @param free_func free function for the value freeing. Pass 0 if
      *              param value is a string
      * @param value value of the property

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/util/src/hash.c
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/util/src/hash.c?rev=666526&r1=666525&r2=666526&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/util/src/hash.c (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/util/src/hash.c Tue Jun 10 22:08:36 2008
@@ -566,7 +566,7 @@
     return AXIS2_FALSE;
 }
 
-static void
+void
 axutil_hash_entry_free(
     const axutil_env_t *env,
     axutil_hash_entry_t *hash_entry)

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/util/src/platforms/windows/axutil_windows.c
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/util/src/platforms/windows/axutil_windows.c?rev=666526&r1=666525&r2=666526&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/util/src/platforms/windows/axutil_windows.c (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/util/src/platforms/windows/axutil_windows.c Tue Jun 10 22:08:36 2008
@@ -1,25 +1,27 @@
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
 
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+ 
+
 #include <windows/axutil_windows.h>
 #include <stdio.h>
     
-
+
 /*
 
 std::string* getPlatformErrorMessage(long errorNumber)
@@ -42,25 +44,30 @@
     return returningString;
 }
 */ 
-    AXIS2_EXTERN HMODULE AXIS2_CALL 
 callLoadLib(char *lib) 
-{
-    SetErrorMode(SEM_FAILCRITICALERRORS); //Disable display of the critical-error-handler message box
-    return LoadLibrary(lib);
-}
-

AXIS2_EXTERN struct tm *AXIS2_CALL 
-axis2_win_gmtime(
-    const time_t * timep,
+AXIS2_EXTERN HMODULE AXIS2_CALL 
+callLoadLib(char *lib) 
+{
+	/* Disable display of the critical-error-handler message box */
+    SetErrorMode(SEM_FAILCRITICALERRORS); 
+    return LoadLibraryEx(lib, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
+}
+
+
+AXIS2_EXTERN struct tm *AXIS2_CALL 
+axis2_win_gmtime(
+    const time_t * timep,
     struct tm *result) 
-{
-    return gmtime(timep);
-}
-
-AXIS2_EXTERN axis2_char_t * AXIS2_CALL axutil_win32_get_last_error()
-{
-    return "Something went wrong loading the DLL. \
-If you happen to see this message, \
-please note that getting the exact error form Windows is a TODO. \
-And if possible please help fix it. :)";
-}
-
-
+{
+    return gmtime(timep);
+}
+
+AXIS2_EXTERN axis2_char_t * AXIS2_CALL axutil_win32_get_last_error()
+{
+    return "Something went wrong loading the DLL. \
+If you happen to see this message, \
+please note that getting the exact error form Windows is a TODO. \
+And if possible please help fix it. :)";
+}
+
+
+

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/util/src/url.c
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/util/src/url.c?rev=666526&r1=666525&r2=666526&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/util/src/url.c (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/util/src/url.c Tue Jun 10 22:08:36 2008
@@ -630,7 +630,8 @@
     axis2_char_t *buff, int len)
 {
     axis2_char_t string[4];
-    axis2_char_t *expand_buffer;
+    axis2_char_t *expand_buffer = NULL;
+	axis2_char_t *temp = NULL;
     int i;
     for (i = 0; i < len && buff[i]; i++)
     {
@@ -650,7 +651,13 @@
                 (axis2_char_t *) AXIS2_MALLOC (env->allocator, len * 2);
             memset (expand_buffer, 0, len * 2);
             len *= 2;
-            dest = memmove (expand_buffer, dest, strlen (dest));
+            temp = memmove (expand_buffer, dest, strlen (dest));
+			if(dest)
+			{
+				AXIS2_FREE(env->allocator, dest);
+				dest = NULL;
+			}
+			dest = temp;
         }
         strcat (dest, string);
     }