summaryrefslogtreecommitdiffstats
path: root/axiom/include/axiom_soap_fault.h
blob: d75ea3cf1db631ff31c644dc96bb5da0e2095b3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
/*
 * 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.
 */

#ifndef AXIOM_SOAP_FAULT_H
#define AXIOM_SOAP_FAULT_H

/**
 * @file axiom_soap_fault.h
 * @brief axiom_soap_fault struct
 */
#include <axiom_soap_const.h>
#include <axutil_env.h>
#include <axiom_node.h>
#include <axiom_element.h>

#ifdef __cplusplus
extern "C"
{
#endif

    typedef struct axiom_soap_fault axiom_soap_fault_t;

    struct axiom_soap_fault_reason;
    struct axiom_soap_fault_detail;
    struct axiom_soap_fault_sub_code;
    struct axiom_soap_fault_code;
    struct axiom_soap_fault_node;
    struct axiom_soap_fault_role;
    struct axiom_soap_fault_text;
    struct axiom_soap_fault_value;
    struct axiom_soap_body;
    struct axiom_soap_builder;

    /**
     * @defgroup axiom_soap_fault soap fault
     * @ingroup axiom_soap
     * @{
     */

    /**
     * creates a soap fault struct
     * @param env environment must not be NULL
     * @param parent soap body struct to which this soap
     * fault is the child
     * @param env Environment. MUST NOT be NULL
     * @returns pointer to axiom_soap_fault_t struct on success
     *  otherwise return NULL with error code set in environments error
     */
    AXIS2_EXTERN axiom_soap_fault_t *AXIS2_CALL
    axiom_soap_fault_create_with_parent(
        const axutil_env_t * env,
        struct axiom_soap_body *parent);

    /** create an returns a axiom_soap_fault_t struct with a soap fault detail
     * element and have this exceptio string as a text of a child of soap fault
     * detail
     * @param env environment must not be NULL
     * @param parent soap body struct must not be NULL
     * @param exceptio an error string must not be NULL
     * @returns pointer to axiom_soap_fault_t on success ,
     * otherwise return NULL
     */
    AXIS2_EXTERN axiom_soap_fault_t *AXIS2_CALL
    axiom_soap_fault_create_with_exception(
        const axutil_env_t * env,
        struct axiom_soap_body *parent,
        axis2_char_t * exception);

    /**
     *
     * @param env environment must not be NULL
     * @param parent soap body struct must not be NULL
     * @param code_value 
     * @param reason_text
     * @param soap_version
     *
     * @return the created default OM SOAP fault
     */
    AXIS2_EXTERN axiom_soap_fault_t *AXIS2_CALL
    axiom_soap_fault_create_default_fault(
        const axutil_env_t * env,
        struct axiom_soap_body *parent,
        const axis2_char_t * code_value,
        const axis2_char_t * reason_text,
        const int soap_version);

    /**
      * Free an axiom_soap_fault
      * @param  fault pointer to soap_fault struct
      * @param  env Environment. MUST NOT be NULL
      * @return status of the op. AXIS2_SUCCESS on success 
      *         else AXIS2_FAILURE
      */

    AXIS2_EXTERN void AXIS2_CALL
    axiom_soap_fault_free(
        axiom_soap_fault_t * fault,
        const axutil_env_t * env);

    /**
      * this function returns a axiom_soap_fault_code struct
      * if a fault code is associated with this soap fault
      * only valid when called after building the soap fault
      * @param fault soap fault struct
      * @param env environment must not be NULL
      * @returns pointer to  soap_fault_code struct if one is associated 
      *  with this soap_fault struct , NULL is returned otherwise
      */
    AXIS2_EXTERN struct axiom_soap_fault_code *AXIS2_CALL
    axiom_soap_fault_get_code(
         axiom_soap_fault_t * fault,
         const axutil_env_t * env);

    /**
     * @param fault soap fault struct
     * @param env environment must not be NULL
     * @returns pointer to soap_fault_reason struct if one is associated 
     * with this soap_fault struct , NULL is returned otherwise
     */

    AXIS2_EXTERN struct axiom_soap_fault_reason *AXIS2_CALL
    axiom_soap_fault_get_reason(
         axiom_soap_fault_t * fault,
         const axutil_env_t * env);

    /**
     * @param fault soap fault struct
     * @param env environment must not be NULL
     * @returns pointer to soap_fault_node struct if one is associated 
     *  with this soap_fault struct , NULL is returned otherwise
     */
    AXIS2_EXTERN struct axiom_soap_fault_node *AXIS2_CALL
    axiom_soap_fault_get_node(
        axiom_soap_fault_t * fault,
        const axutil_env_t * env);

    /**
     * @param fault soap fault struct
     * @param env environment must not be NULL
     * @returns pointer to soap_fault_code struct if one is associated 
     * with this soap_fault struct , NULL is returned otherwise
     */
    AXIS2_EXTERN struct axiom_soap_fault_role *AXIS2_CALL
    axiom_soap_fault_get_role(
         axiom_soap_fault_t * fault,
         const axutil_env_t * env);

    /**
      * @param fault soap fault struct
      * @param env environment must not be NULL
      * @returns a pointer to  soap_fault_code struct if one is 
      * associated with this soap_fault struct , NULL is returned otherwise
      */
    AXIS2_EXTERN struct axiom_soap_fault_detail *AXIS2_CALL
    axiom_soap_fault_get_detail(
         axiom_soap_fault_t * fault,
         const axutil_env_t * env);

    /**
      * @param fault soap fault struct 
      * @param env enviroment must not be NULL
      * @returns a pointer to  soap_fault_code struct if one is 
      * associated with this soap_fault struct , NULL is returned otherwise
      */
    AXIS2_EXTERN axis2_char_t *AXIS2_CALL
    axiom_soap_fault_get_exception(
        axiom_soap_fault_t * fault,
        const axutil_env_t * env);

    /**
      * set an error string 
      * @param fualt soap fault struct
      * @param env enviroment must not be NULL
      * @param exception error message to be stored on soap fault
      */
    AXIS2_EXTERN axis2_status_t AXIS2_CALL
    axiom_soap_fault_set_exception(
        axiom_soap_fault_t * fault,
        const axutil_env_t * env,
        axis2_char_t * exception);

    /**
      * returns the axiom_node_t struct which is wrapped by
      * this soap fault struct
      * @param fault soap fault struct
      * @param env environment must not be NULL
      * @returns a pointer to  axiom_node_t struct if an om node is associated 
      * with this soap fault struct, otherwise return NULL
      */
    AXIS2_EXTERN axiom_node_t *AXIS2_CALL
    axiom_soap_fault_get_base_node(
        axiom_soap_fault_t * fault,
        const axutil_env_t * env);

    /** @} */
#ifdef __cplusplus
}
#endif

#endif                          /* AXIOM_SOAP_FAULT_H */