[wsf-c-dev] svn commit r418 - wsf/c/wsclient/src

svn at wso2.com svn at wso2.com
Sat Jan 13 01:24:56 PST 2007


Author: dinesh
Date: Sat Jan 13 01:23:40 2007
New Revision: 418

Modified:
   wsf/c/wsclient/src/wsclient.c
   wsf/c/wsclient/src/wsclient_constants.h
   wsf/c/wsclient/src/wsclient_stub.c
Log:
logging enabled while debugging

Modified: wsf/c/wsclient/src/wsclient.c
==============================================================================
--- wsf/c/wsclient/src/wsclient.c	(original)
+++ wsf/c/wsclient/src/wsclient.c	Sat Jan 13 01:23:40 2007
@@ -28,7 +28,8 @@
 	axis2_array_list_t *array_list;
 	axis2_status_t status;
 	env = axis2_env_create_all ("wsclient.log", AXIS2_LOG_LEVEL_INFO);
-	AXIS2_LOG_INFO(env->log, "[wsclient]wsclient initiated ");
+	AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+					"[wsclient]wsclient initiated ");
 
 	if (argc > 1)
 	{
@@ -36,17 +37,44 @@
 			print_help ();
 		else if (!strcmp (argv[1], "-v") || !strcmp (argv[1], "--version"))
 			print_version ();
-		AXIS2_LOG_INFO(env->log, "[wsclient]waiting for input  ");
+
+		AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+						"[wsclient]waiting for input  ");
 	    parse_input (env, input);
+
 	    dest_uri = wsclient_destination (argc, argv);
-		AXIS2_LOG_INFO(env->log, "[wsclient]sending request to  %s", dest_uri);
+		AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+						"[wsclient]sending request to  %s", dest_uri);
+
 	    array_list = wsclient_process_options (argc, argv, env);
 	    status = wsclient_stub_invoke (env, array_list, dest_uri, *input);
-		AXIS2_LOG_INFO(env->log, "[wsclient]wsclient invoked ");
-	    if (status == WSCLIENT_ERROR_NO_DESTURI)
-	    {
-			printf ("please enter valid destURI \n");
-	    }
+		AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "[wsclient]wsclient invoked ");
+		
+		switch (status)
+		{
+			case WSCLIENT_FAILURE:
+			{
+				AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+								"[wsclient] wsclient invoke failed!");
+				printf ("\nwsclient invoke failed ! \n");
+			}
+			break;
+			case WSCLIENT_ERROR_NO_DESTURI:
+			{
+				AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+								"[wsclient] wsclient invoke failed !");
+				printf ("\nwsclient invoke failed ! \n");
+			}
+			break;
+			case WSCLIENT_SUCCESS:
+			{
+				AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+								"[wsclient] wsclient invoke Success !");
+				printf ("\nwsclient invoke Success ! \n");
+			}
+			break;
+		};
+
 	}
 	else
 	    print_usage ();
@@ -66,36 +94,36 @@
 	static const char *version [] = 
 	    {
 			("\
-  wsclient 0.9 \n"),
-("\
+  wsclient 1.0 \n"),
+			("\
 \n"),
-("\
+			("\
  Copyright 2006,2007 WSO2, Inc. http://wso2.com\n"),
-("\
+			("\
 \n"),
-("\
+			("\
  Licensed under the Apache License, Version 2.0 (the \"License\");\n"),
-("\
+			("\
  you may not use this file except in compliance with the License.\n"),
-("\
+			("\
  You may obtain a copy of the License at\n"),
-("\
+			("\
  \n"),
-("\
+			("\
  http://www.apache.org/licenses/LICENSE-2.0\n"),
-("\
+			("\
  \n"),
-("\
+			("\
  Unless required by applicable law or agreed to in writing, software\n"),
-("\
+			("\
  distributed under the License is distributed on an \"AS IS\" BASIS,\n"),
-("\
+			("\
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n"),
-("\
+			("\
  See the License for the specific language governing permissions and\n"),
-("\
+			("\
  limitations under the License.\n"),
-("\
+			("\
  \n"),
 		};
 	int i = 0;

Modified: wsf/c/wsclient/src/wsclient_constants.h
==============================================================================
--- wsf/c/wsclient/src/wsclient_constants.h	(original)
+++ wsf/c/wsclient/src/wsclient_constants.h	Sat Jan 13 01:23:40 2007
@@ -32,11 +32,10 @@
 #ifdef __cplusplus
 }
 #endif
- 
-#define WSCLIENT_SUCCESS 1;
-#define WSCLIENT_FAILURE 0;
-#define WSCLIENT_ERROR -1;
-/* for more details we need to have detailed error codes */
+
+#define WSCLIENT_SUCCESS 1
+#define WSCLIENT_FAILURE 0
+#define WSCLIENT_ERROR -1
 
 #endif /*WSCLIENT_CONSTANTS_H*/
 

Modified: wsf/c/wsclient/src/wsclient_stub.c
==============================================================================
--- wsf/c/wsclient/src/wsclient_stub.c	(original)
+++ wsf/c/wsclient/src/wsclient_stub.c	Sat Jan 13 01:23:40 2007
@@ -70,6 +70,7 @@
 static int is_output_http_headers = 0;
 static axis2_char_t *output_filename;
 static axis2_char_t *server_cert;
+static int is_server_cert = 0;
 
 extern wsclient_cmd_options_t cmd_options_data[];
 extern int array_size;
@@ -137,7 +138,8 @@
 						is_soap_enabled = 0;
 						is_wsa_enabled = 0;
 						is_mtom_enabled = 0;
-						AXIS2_LOG_INFO(env->log, "[wsclient] processed get option ");
+						AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+										"[wsclient] processed get option ");
 					}
 					break;
 					case CONTENT_TYPE:
@@ -147,7 +149,8 @@
 						{			      
 							content_type = (char *)wsclient_options->value;
 						}
-						AXIS2_LOG_INFO(env->log, "[wsclient] processed content type ");
+						AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+										"[wsclient] processed content type ");
 					}
 					break;
 					case SOAP:
@@ -155,14 +158,16 @@
 						is_soap_enabled = 1;
 						/* Set the default soap version of 1.2 */
 						AXIS2_OPTIONS_SET_SOAP_VERSION(options, env, AXIOM_SOAP12);
-						AXIS2_LOG_INFO(env->log, "[wsclient] soap 1.2 selected");
+						AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+										"[wsclient] soap 1.2 selected");
 					}
 					break;
 					case SOAP_OLD:
 					{
 						is_soap_enabled = 1;
 						AXIS2_OPTIONS_SET_SOAP_VERSION(options, env, AXIOM_SOAP11);
-						AXIS2_LOG_INFO(env->log, "[wsclient] soap 1.1 selected");
+						AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+										"[wsclient] soap 1.1 selected");
 					}
 					break;
 					case SOAP_DUMP:
@@ -172,7 +177,8 @@
 						{
 							is_soap_enabled = 1;
 						}
-						AXIS2_LOG_INFO(env->log, "[wsclient] soap dumping  ");
+						AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+										"[wsclient] soap dumping  ");
 					}
 					break;
 					case SOAP_OUT:
@@ -184,7 +190,8 @@
 							AXIS2_OPTIONS_SET_SOAP_VERSION(
 								options, env, AXIOM_SOAP12);
 						} 
-						AXIS2_LOG_INFO(env->log, "[wsclient] soap out block");
+						AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+										"[wsclient] soap out block");
 					}
 					break;
 					case ACTION:
@@ -198,19 +205,23 @@
 								env, 
 								(char *)wsclient_options->value);
 						}
-						AXIS2_LOG_INFO(env->log, "[wsclient] wsa action block %a", (char *)wsclient_options->value);
+						AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+										"[wsclient] wsa action block %a", 
+										(char *)wsclient_options->value);
 					}
 					break;
 					case SEND_ONLY:
 					{
 						is_send_only = 1;
-						AXIS2_LOG_INFO(env->log, "[wsclient] send only block ");
+						AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+										"[wsclient] send only block ");
 					}
 					break;
 					case NO_WSA:
 					{
 						is_wsa_enabled = 0;
-						AXIS2_LOG_INFO(env->log, "[wsclient] addressing disabled ");
+						AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+										"[wsclient] addressing disabled ");
 					}
 					break;
 					case TO:
@@ -218,10 +229,12 @@
 						is_to = 1;
 						if (wsclient_options->value)
 						{
-							to = axis2_endpoint_ref_create(env, 
-														   (char *)wsclient_options->value);
+							to = axis2_endpoint_ref_create (env, 
+															(char *)wsclient_options->value);
 						}
-						AXIS2_LOG_INFO(env->log, "[wsclient] wsa to  %s ", (char *)wsclient_options->value);
+						AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+										"[wsclient] wsa to  %s ", 
+										(char *)wsclient_options->value);
 					}
 					break;
 					case FROM:
@@ -232,7 +245,9 @@
 							from = axis2_endpoint_ref_create(env, 
 															 (char *)wsclient_options->value);
 						}
-						AXIS2_LOG_INFO(env->log, "[wsclient] wsa from  %s ", (char *)wsclient_options->value);
+						AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+										"[wsclient] wsa from  %s ", 
+										(char *)wsclient_options->value);
 					}
 					break;
 					case REPLY_TO:
@@ -243,7 +258,9 @@
 							reply_to = axis2_endpoint_ref_create(env, 
 																 (char *)wsclient_options->value);
 						}
-						AXIS2_LOG_INFO(env->log, "[wsclient] wsa reply to  %s ", (char *)wsclient_options->value);
+						AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+										"[wsclient] wsa reply to  %s ", 
+										(char *)wsclient_options->value);
 					}
 					break;
 					case IN_REPLY_TO:
@@ -251,10 +268,13 @@
 						is_in_reply_to = 1;
 						if (wsclient_options->value)
 						{
-							relates_to = axis2_relates_to_create (env, (char *)wsclient_options->value,
+							relates_to = axis2_relates_to_create (env, 
+																  (char *)wsclient_options->value,
 																  "http://www.w3.org/2005/08/addressing/reply");
 						}
-						AXIS2_LOG_INFO(env->log, "[wsclient] wsa in-reply-to  %s ", (char *)wsclient_options->value);
+						AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+										"[wsclient] wsa in-reply-to  %s ", 
+										(char *)wsclient_options->value);
 					}
 					break;
 					case FAULT_TO:
@@ -265,13 +285,16 @@
 							fault_to = axis2_endpoint_ref_create (env, 
 																  (char *)wsclient_options->value);
 						}
-						AXIS2_LOG_INFO(env->log, "[wsclient] wsa fault-to  %s ", (char *)wsclient_options->value);
+						AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+										"[wsclient] wsa fault-to  %s ", 
+										(char *)wsclient_options->value);
 					}
 					break;
 					case NO_MTOM:
 					{
 						is_mtom_enabled = 0;
-						AXIS2_LOG_INFO(env->log, "[wsclient] mtom disabled  ");
+						AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+										"[wsclient] mtom disabled  ");
 					}
 					break;
 					case USER:
@@ -282,7 +305,8 @@
 						username_value = (char *)wsclient_options->value;
 						AXIS2_PROPERTY_SET_VALUE (username, env, AXIS2_STRDUP ((char *)wsclient_options->value, env));
 						AXIS2_OPTIONS_SET_PROPERTY (options, env, RAMPART_ACTION_USER, username);
-						AXIS2_LOG_INFO(env->log, "[wsclient] security user block ");
+						AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+										"[wsclient] security user block ");
 					}
 					break;
 					case PASSWORD:
@@ -292,13 +316,15 @@
 						password = axis2_property_create (env);
 						AXIS2_PROPERTY_SET_VALUE (password, env, AXIS2_STRDUP ((char *)wsclient_options->value, env));
 						AXIS2_OPTIONS_SET_PROPERTY (options, env, RAMPART_ACTION_PASSWORD, password);
-						AXIS2_LOG_INFO(env->log, "[wsclient] security password block ");
+						AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+										"[wsclient] security password block ");
 					}
 					break;
 					case TIMESTAMP:
 					{
 						is_user_tok_timestamp = 1;
-						AXIS2_LOG_INFO(env->log, "[wsclient] security timestamp block ");
+						AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+										"[wsclient] security timestamp block ");
 					}
 					break;
 					case PASSWORD_FILE:
@@ -307,13 +333,15 @@
 						is_password = 1;
 						is_soap_enabled = 1;
 						password_file = (char *) wsclient_options->value;
-						AXIS2_LOG_INFO(env->log, "[wsclient] security password file ");
+						AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+										"[wsclient] security password file ");
 					}
 					break;
 					case DIGEST:
 					{
 						is_digest = 1;
-						AXIS2_LOG_INFO(env->log, "[wsclient] security digest block ");
+						AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+										"[wsclient] security digest block ");
 					}
 					break;
 					case XOP_IN:
@@ -322,14 +350,16 @@
 						is_xop_in = 1;
 						dir = (axis2_char_t *)wsclient_options->value;
 						wsclient_set_attachment (env, payload, dir, is_mtom_enabled);
-						AXIS2_LOG_INFO(env->log, "[wsclient] xop in block");
+						AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+										"[wsclient] xop in block");
 					}
 					break;
 					case XOP_OUT:
 					{
 						is_xop_out = 1;
 						xop_out_dir = (axis2_char_t *)wsclient_options->value;
-						AXIS2_LOG_INFO(env->log, "[wsclient] xop out block");
+						AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+										"[wsclient] xop out block");
 					}
 					break;
 					case HTTP_HEADER:
@@ -349,14 +379,17 @@
 							AXIS2_OPTIONS_SET_PROPERTY(options, env, AXIS2_TRANSPORT_HEADER_PROPERTY,
 													   header_property);
 						}
-						AXIS2_LOG_INFO(env->log, "[wsclient] add http header");
+						AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+										"[wsclient] add http header");
 					}
 					break;
 					case OUTPUT_HTTP_HEADERS:
 					{
 						is_output_http_headers = 1;
 						output_filename = (char *) wsclient_options->value;
-						AXIS2_LOG_INFO(env->log, "[wsclient] output http header %s", (char *) wsclient_options->value);
+						AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+										"[wsclient] output http header %s", 
+										(char *) wsclient_options->value);
 					}
 					break;
 					case SERVER_CERT:
@@ -371,7 +404,10 @@
 							AXIS2_OPTIONS_SET_PROPERTY(options, env, AXIS2_SSL_SERVER_CERT,
 													   server_cert_property);
 						}
-						AXIS2_LOG_INFO(env->log, "[wsclient] server certificate path  %s", (char *) wsclient_options->value);
+						is_server_cert = 1;
+						AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+										"[wsclient] server certificate path  %s",
+										(char *) wsclient_options->value);
 					}
 					break;
 				};
@@ -381,7 +417,8 @@
 
 	if (!is_soap_enabled)
 	{
-		AXIS2_LOG_INFO(env->log, "[wsclient] soap not enabled");
+		AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+						"[wsclient] soap not enabled");
 		is_wsa_enabled = 0;
  		is_mtom_enabled = 0;
 
@@ -397,7 +434,8 @@
 									 axis2_strdup(AXIS2_HTTP_HEADER_GET, env));
 			AXIS2_OPTIONS_SET_PROPERTY(options, env, AXIS2_HTTP_METHOD,
 									   get_property);
-		AXIS2_LOG_INFO(env->log, "[wsclient] set get property ");
+			AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+							"[wsclient] set get property ");
 		}
 
 		if (is_contenty_type)
@@ -418,16 +456,19 @@
 /* 			AXIS2_PROPERTY_SET_FREE_FUNC (property, env, axis2_hash_free); */
 			AXIS2_OPTIONS_SET_PROPERTY(options, env, AXIS2_USER_DEFINED_HTTP_HEADER_CONTENT_TYPE,
 									   content_type_property);
-			AXIS2_LOG_INFO(env->log, "[wsclient] set contenty type");
+			AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+							"[wsclient] set contenty type");
 		}
 	}
 
 	if (is_wsa_enabled)
 	{
-		AXIS2_LOG_INFO(env->log, "[wsclient] addressing  enabled");
+		AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+						"[wsclient] addressing  enabled");
 	    if (is_send_only)
 	    {
-			AXIS2_LOG_INFO(env->log, "[wsclient] addressing  enabled sendonly ");
+			AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+							"[wsclient] addressing  enabled sendonly ");
 			if(!is_reply_to)
 			{
 				reply_to = axis2_endpoint_ref_create(env,
@@ -438,7 +479,8 @@
 
 	    if (is_to)
 	    {
-			AXIS2_LOG_INFO(env->log, "[wsclient] adding \"to\" to options");
+			AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+							"[wsclient] adding \"to\" to options");
 			if (to)
 			{
 				AXIS2_OPTIONS_SET_TO(options, env, to);
@@ -447,7 +489,8 @@
 	    
 	    if (is_from)
 	    {
-			AXIS2_LOG_INFO(env->log, "[wsclient] adding from to options");
+			AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
+							"[wsclient] adding from to options");
 			if (from)
 			{
 				AXIS2_OPTIONS_SET_FROM (options, env, from);
@@ -456,7 +499,8 @@
 
 	    if (is_reply_to)
 	    {
-			AXIS2_LOG_INFO(env->log, "[wsclient] adding reply-to to options");
+			AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
+							"[wsclient] adding reply-to to options");
 			if (reply_to)
 			{
 				AXIS2_OPTIONS_SET_REPLY_TO (options, env, reply_to);
@@ -465,7 +509,8 @@
 
 	    if (is_in_reply_to)
 	    {
-			AXIS2_LOG_INFO(env->log, "[wsclient] adding in-reply-to to options");
+			AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
+							"[wsclient] adding in-reply-to to options");
 			if (in_reply_to)
 			{
 			
@@ -475,7 +520,8 @@
 
 	    if (is_fault_to)
 	    {
-			AXIS2_LOG_INFO(env->log, "[wsclient] adding fault-to to options");
+			AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+							"[wsclient] adding fault-to to options");
 			if (fault_to)
 			{
 				AXIS2_OPTIONS_SET_FAULT_TO (options, env, fault_to);
@@ -485,7 +531,8 @@
 
 	if (is_soap_dump)
 	{
-		AXIS2_LOG_INFO(env->log, "[wsclient] setting soap-dump property to options");
+		AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+						"[wsclient] setting soap-dump property to options");
 	    dump_property = axis2_property_create (env);
 	    AXIS2_PROPERTY_SET_VALUE (dump_property,
 								  env,
@@ -497,7 +544,8 @@
 	{
 		if (is_password_file)
 		{
-			AXIS2_LOG_INFO(env->log, "[wsclient] processing password file");
+			AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+							"[wsclient] processing password file");
 			if (username_value)
 			{
 				password_buffer = wsclient_get_password (env, username_value, password_file);
@@ -514,7 +562,8 @@
 
 		if (is_digest)
 		{
-			AXIS2_LOG_INFO(env->log, "[wsclient] adding digest password property");
+			AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+							"[wsclient] adding digest password property");
 			pw_type = axis2_property_create(env);
 			AXIS2_PROPERTY_SET_VALUE(pw_type, env, AXIS2_STRDUP (RAMPART_PASSWORD_DIGEST, env));
 			AXIS2_OPTIONS_SET_PROPERTY(options, env, RAMPART_ACTION_PASSWORD_TYPE, pw_type);
@@ -522,7 +571,8 @@
 	    }
 	    else 
 	    {
-			AXIS2_LOG_INFO(env->log, "[wsclient] adding plain text password property");
+			AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
+							"[wsclient] adding plain text password property");
 			pw_type = axis2_property_create(env);
 			AXIS2_PROPERTY_SET_VALUE(pw_type, env, AXIS2_STRDUP (RAMPART_PASSWORD_TEXT, env));
 			AXIS2_OPTIONS_SET_PROPERTY(options, env, RAMPART_ACTION_PASSWORD_TYPE, pw_type);
@@ -531,14 +581,16 @@
 
 	    if (is_user_tok_timestamp)
 	    {
-			AXIS2_LOG_INFO(env->log, "[wsclient] username token timestamp ");
+			AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+							"[wsclient] username token timestamp ");
 			items = axis2_property_create(env);
 			AXIS2_PROPERTY_SET_VALUE(items, env, AXIS2_STRDUP ("UsernameToken Timestamp", env));
 			AXIS2_OPTIONS_SET_PROPERTY(options, env, RAMPART_ACTION_ITEMS, items);
 	    }
 	    else
 	    {
-			AXIS2_LOG_INFO(env->log, "[wsclient] username token");
+			AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+							"[wsclient] username token");
 			items = axis2_property_create(env);
 			AXIS2_PROPERTY_SET_VALUE(items, env, AXIS2_STRDUP ("UsernameToken", env));
 			AXIS2_OPTIONS_SET_PROPERTY(options, env, RAMPART_ACTION_ITEMS, items);
@@ -556,7 +608,8 @@
 	axis2_char_t *dest_uri,
 	axis2_char_t *input)
 {
-	AXIS2_LOG_INFO(env->log, "[wsclient] wsclient invoking ");
+	AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+					"[wsclient] wsclient invoking ");
 	const axis2_char_t *address = NULL;
 	axis2_endpoint_ref_t* endpoint_ref = NULL;
 	axis2_options_t *options = NULL;
@@ -565,18 +618,21 @@
 	axiom_node_t *payload = NULL;
 	axiom_node_t *ret_node = NULL;
 
-	AXIS2_LOG_INFO(env->log, "[wsclient] payload %s \n", input);
+	AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+					"[wsclient] payload %s \n", input);
 	payload = wsclient_payload (env, input);
 
 	client_home = AXIS2_GETENV("AXIS2C_HOME");
 	if (!client_home)
 	{
 		printf ("AXIS2C_HOME environment variable doesn't set properly.Please recheck\n");
-		AXIS2_LOG_INFO(env->log, "[wsclient] AXIS2C_HOME is empty");
+		AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+						"[wsclient] AXIS2C_HOME is empty");
 		return WSCLIENT_FAILURE;
 	}
 	else
-		AXIS2_LOG_INFO(env->log, "[wsclient] AXIS2C_HOME %s", client_home);
+		AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+						"[wsclient] AXIS2C_HOME %s", client_home);
 
 	if (dest_uri)
 	{
@@ -584,7 +640,8 @@
 	}
 	else
 	{
-		AXIS2_LOG_INFO(env->log, "[wsclient] destination uri not available");
+		AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+						"[wsclient] destination uri not available");
 	    return WSCLIENT_ERROR_NO_DESTURI;
 	}
 
@@ -594,7 +651,8 @@
 	    return WSCLIENT_FAILURE;
 
 	svc_client = axis2_svc_client_create (env, client_home);
-	AXIS2_LOG_INFO(env->log, "[wsclient] svc client created");
+	AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+					"[wsclient] svc client created");
 
 	if (!svc_client)
 	{
@@ -605,7 +663,8 @@
 	}
 
 	options = wsclient_svc_option (env, array_list, payload);
-	AXIS2_LOG_INFO(env->log, "[wsclient] svc client created");
+	AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+					"[wsclient] svc client created");
 
 	if (endpoint_ref)
 	    AXIS2_OPTIONS_SET_TO(options, env, endpoint_ref);
@@ -619,19 +678,22 @@
 			if (!is_action)
 				AXIS2_OPTIONS_SET_ACTION (options, env, "http://ws.apache.org/axis2/c");
 			AXIS2_SVC_CLIENT_ENGAGE_MODULE(svc_client, env, AXIS2_MODULE_ADDRESSING);
-			AXIS2_LOG_INFO(env->log, "[wsclient] addressing module engaged");
+			AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+							"[wsclient] addressing module engaged");
 		}
 
 		if (is_username && is_password)
 		{
 			AXIS2_SVC_CLIENT_ENGAGE_MODULE (svc_client, env, "rampart");
-			AXIS2_LOG_INFO(env->log, "[wsclient] rampart module engaged");
+			AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+							"[wsclient] rampart module engaged");
 		}
 
 		if (is_mtom_enabled)
 		{
 			AXIS2_OPTIONS_SET_ENABLE_MTOM (options, env, AXIS2_TRUE);
-			AXIS2_LOG_INFO(env->log, "[wsclient] mtom option enabled");
+			AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+							"[wsclient] mtom option enabled");
 		}
 	}
 
@@ -648,22 +710,40 @@
 			printf ("Sending request to: %s \n", dest_uri);
 
 #ifdef AXIS2_SSL_ENABLED
-		AXIS2_LOG_INFO(env->log, "[wsclient] compiled with ssl enabled");
+		AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+						"[wsclient] compiled with ssl enabled");
 		if (strstr (dest_uri, "https"))
-			wsclient_set_https_transport_parameretes (env, svc_client);
+		{
+			if (is_server_cert)
+				wsclient_set_https_transport_parameretes (env, svc_client);
+			else
+			{
+				printf ("server certificate not found \n");
+				AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
+								"[wsclient] server certificate not found");
+				return WSCLIENT_FAILURE;
+			}
+		}
 #endif
-		AXIS2_LOG_INFO(env->log, "[wsclient] prepareing for svc client send receive ");
+		AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+						"[wsclient] prepareing for svc client send receive ");
 	    ret_node = AXIS2_SVC_CLIENT_SEND_RECEIVE(svc_client, env, payload);
 
 		if (is_soap_dump)
+		{
 			wsclient_soap_out (env, svc_client, 0);
+			AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+							"[wsclient] soap dump successful");
+			return WSCLIENT_SUCCESS;
+		}
 	}
 	else
 	    return WSCLIENT_FAILURE;
 
 	if (ret_node)
 	{
-		AXIS2_LOG_INFO(env->log, "[wsclient] response return node found");
+		AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+						"[wsclient] response return node found");
 	    axis2_char_t *om_str = NULL;
 	    if(is_send_only)
 	    {
@@ -688,27 +768,30 @@
 		{
 			wsclient_get_attachment (env, ret_node, xop_out_dir, is_mtom_enabled);
 			wsclient_soap_out (env, svc_client, 1);
-			AXIS2_LOG_INFO(env->log, "[wsclient] invoke SUCCESSFUL");
-			printf("\nwsclient invoke SUCCESSFUL!\n");
+			AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+							"[wsclient] xop out successful");
 		}
 		else if (is_soap_out)
 	    {
 			wsclient_soap_out (env, svc_client, 1);
+			AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+							"[wsclient] soap out SUCCESSFUL");
 	    }
 	    else
 	    {
 			om_str = AXIOM_NODE_TO_STRING(ret_node, env);
 			if (om_str)
 				printf("\nReceived OM : %s\n", om_str);
-			AXIS2_LOG_INFO(env->log, "[wsclient] invoke SUCCESSFUL");
-			printf("\nwsclient invoke SUCCESSFUL!\n");
+			AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+							"[wsclient] response retrieval successful");
 			ret_node = NULL;
 	    }
 	}
 	else 
 	{
-			AXIS2_LOG_INFO(env->log, "[wsclient] invoke Failed");
-			printf("\nwsclient invoke Failed!\n");
+		AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+						"[wsclient] invoke response retrival failed");
+		return WSCLIENT_FAILURE;
 	}
 	if (password_buffer)
 	    AXIS2_FREE (env->allocator, password_buffer);




More information about the Wsf-c-dev mailing list