Author: damitha
Date: Fri Nov  7 16:06:39 2008
New Revision: 712316

URL: http://svn.apache.org/viewvc?rev=712316&view=rev
Log:
Working on Savan errors

Added:
    webservices/savan/trunk/c/src/util/error.c
Modified:
    webservices/savan/trunk/c/include/savan_error.h
    webservices/savan/trunk/c/src/core/savan_sub_processor.c
    webservices/savan/trunk/c/src/util/savan_util.c

Modified: webservices/savan/trunk/c/include/savan_error.h
URL: 
http://svn.apache.org/viewvc/webservices/savan/trunk/c/include/savan_error.h?rev=712316&r1=712315&r2=712316&view=diff
==============================================================================
--- webservices/savan/trunk/c/include/savan_error.h (original)
+++ webservices/savan/trunk/c/include/savan_error.h Fri Nov  7 16:06:39 2008
@@ -59,26 +59,21 @@
         SAVAN_ERROR_STORE_NOT_FOUND,
         /* Failed to build a default soap envelope */
         SAVAN_ERROR_FAILED_TO_BUILD_SOAP_ENV,
+           /*Requested delivery mode is not supported */
+        SAVAN_ERROR_REQUESTED_DELIVERY_MODE_NOT_SUPPORTED,
+
+
         
         SAVAN_ERROR_LAST
     
     } savan_error_codes_t;
 
-       typedef enum savan_fault_types
-       {
-       SAVAN_FAULT_DMRU = 0,
-       SAVAN_FAULT_IET,
-       SAVAN_FAULT_UET,
-       SAVAN_FAULT_FNS,
-       SAVAN_FAULT_FRU,
-       SAVAN_FAULT_ESUP,
-       SAVAN_FAULT_UTR,
-       SAVAN_FAULT_IM
-       }savan_fault_types_t;
+    axis2_status_t AXIS2_CALL
+    savan_error_init();
+
 
        #define SAVAN_FAULT_DMRU_CODE "s12:Sender"
        #define SAVAN_FAULT_DMRU_SUB_CODE 
"wse:DeliveryModeRequestedUnavailable."
-       #define SAVAN_FAULT_DMRU_REASON "The requested delivery mode is not 
supported."
        #define SAVAN_FAULT_DMRU_DETAIL ""
 
        #define SAVAN_FAULT_IET_CODE "s12:Sender"
@@ -116,6 +111,18 @@
        #define SAVAN_FAULT_UTR_REASON ""
        #define SAVAN_FAULT_UTR_DETAIL ""
         
+       /*typedef enum savan_fault_types
+       {
+       SAVAN_FAULT_DMRU = 0,
+       SAVAN_FAULT_IET,
+       SAVAN_FAULT_UET,
+       SAVAN_FAULT_FNS,
+       SAVAN_FAULT_FRU,
+       SAVAN_FAULT_ESUP,
+       SAVAN_FAULT_UTR,
+       SAVAN_FAULT_IM
+       }savan_fault_types_t;*/
+
 /** @} */
 #ifdef __cplusplus
 }

Modified: webservices/savan/trunk/c/src/core/savan_sub_processor.c
URL: 
http://svn.apache.org/viewvc/webservices/savan/trunk/c/src/core/savan_sub_processor.c?rev=712316&r1=712315&r2=712316&view=diff
==============================================================================
--- webservices/savan/trunk/c/src/core/savan_sub_processor.c (original)
+++ webservices/savan/trunk/c/src/core/savan_sub_processor.c Fri Nov  7 
16:06:39 2008
@@ -407,7 +407,7 @@
         savan_util_create_fault_envelope(msg_ctx, env,
                                          SAVAN_FAULT_DMRU_CODE, 
                                          SAVAN_FAULT_DMRU_SUB_CODE,
-                                         SAVAN_FAULT_DMRU_REASON, 
+                                         
SAVAN_ERROR_REQUESTED_DELIVERY_MODE_NOT_SUPPORTED, 
                                          SAVAN_FAULT_DMRU_DETAIL);
 
                return AXIS2_FAILURE;

Added: webservices/savan/trunk/c/src/util/error.c
URL: 
http://svn.apache.org/viewvc/webservices/savan/trunk/c/src/util/error.c?rev=712316&view=auto
==============================================================================
--- webservices/savan/trunk/c/src/util/error.c (added)
+++ webservices/savan/trunk/c/src/util/error.c Fri Nov  7 16:06:39 2008
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed 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 <stdlib.h>
+#include <savan_error.h>
+#include <axutil_error_default.h>
+
+AXIS2_IMPORT extern const axis2_char_t* axutil_error_messages[];
+
+axis2_status_t AXIS2_CALL
+savan_error_init()
+{
+    axutil_error_messages[SAVAN_ERROR_REQUESTED_DELIVERY_MODE_NOT_SUPPORTED] = 
+        "Requested delivery mode is not supported";
+
+    return AXIS2_SUCCESS;
+}
+

Modified: webservices/savan/trunk/c/src/util/savan_util.c
URL: 
http://svn.apache.org/viewvc/webservices/savan/trunk/c/src/util/savan_util.c?rev=712316&r1=712315&r2=712316&view=diff
==============================================================================
--- webservices/savan/trunk/c/src/util/savan_util.c (original)
+++ webservices/savan/trunk/c/src/util/savan_util.c Fri Nov  7 16:06:39 2008
@@ -298,22 +298,20 @@
 
     fault_ele = axiom_element_create(env, NULL, "Fault", NULL, &fault_node);
 
-       code_ele = axiom_element_create(env, fault_node, "Code",
-        NULL, &code_node);
-       code_value_ele = axiom_element_create(env, 
-               code_node, "Value", NULL, &code_value_node);
+       code_ele = axiom_element_create(env, fault_node, "Code", NULL, 
&code_node);
+       code_value_ele = axiom_element_create(env, code_node, "Value", NULL, 
&code_value_node);
        axiom_element_set_text(code_value_ele, env, code, code_value_node);
-       sub_code_ele = axiom_element_create(env, 
-               code_node, "Subcode", NULL, &sub_code_node);
-       sub_code_value_ele = axiom_element_create(env, 
-               sub_code_node, "Value", NULL, &sub_code_value_node);
+       sub_code_ele = axiom_element_create(env, code_node, "Subcode", NULL, 
&sub_code_node);
+    sub_code_value_ele = axiom_element_create(env, sub_code_node, "Value", 
NULL, 
+            &sub_code_value_node);
+
        axiom_element_set_text(sub_code_value_ele, env, subcode, 
sub_code_value_node);
        reason_ele = axiom_element_create(env, fault_node, "Reason", NULL, 
&reason_node);
-       reason_text_ele = axiom_element_create(env, 
-               reason_node, "Text", NULL, &reason_text_node);
+       reason_text_ele = axiom_element_create(env, reason_node, "Text", NULL, 
&reason_text_node);
        axiom_element_set_text(reason_text_ele, env, reason, reason_text_node);
        detail_ele = axiom_element_create(env, fault_node, "Detail", NULL, 
&detail_node);       
        axiom_element_set_text(detail_ele, env, detail, detail_node);
+
     return fault_node;
 }
 


Reply via email to