6 * This file was auto-generated from WSDL
7 * by the Apache Axis2/C version: SNAPSHOT Built on : Mar 10, 2008 (08:35:52 GMT+00:00)
10 #include "GetFileResponse.h"
11 #include <Environment.h>
15 using namespace wso2wsf;
18 using namespace org_splat_ws_server_service_salome;
21 * Implementation of the getFileResponse|http://salome.service.ws_server.splat.org Element
23 org_splat_ws_server_service_salome::GetFileResponse::GetFileResponse()
29 property__return = NULL;
31 isValid_return = false;
33 qname = axutil_qname_create (Environment::getEnv(),
35 "http://salome.service.ws_server.splat.org",
40 org_splat_ws_server_service_salome::GetFileResponse::GetFileResponse(axutil_base64_binary_t* arg__return)
45 property__return = NULL;
47 isValid_return = true;
49 qname = axutil_qname_create (Environment::getEnv(),
51 "http://salome.service.ws_server.splat.org",
54 property__return = arg__return;
57 org_splat_ws_server_service_salome::GetFileResponse::~GetFileResponse()
65 org_splat_ws_server_service_salome::GetFileResponse::deserialize(axiom_node_t** dp_parent,bool *dp_is_early_node_valid, bool dont_care_minoccurs)
67 axiom_node_t *parent = *dp_parent;
69 bool status = AXIS2_SUCCESS;
71 const axis2_char_t* text_value = NULL;
72 axutil_qname_t *mqname = NULL;
74 axutil_qname_t *element_qname = NULL;
76 axiom_node_t *first_node = NULL;
77 bool is_early_node_valid = true;
78 axiom_node_t *current_node = NULL;
79 axiom_element_t *current_element = NULL;
82 while(parent && axiom_node_get_node_type(parent, Environment::getEnv()) != AXIOM_ELEMENT)
84 parent = axiom_node_get_next_sibling(parent, Environment::getEnv());
92 current_element = (axiom_element_t *)axiom_node_get_data_element(parent, Environment::getEnv());
93 mqname = axiom_element_get_qname(current_element, Environment::getEnv(), parent);
94 if (axutil_qname_equals(mqname, Environment::getEnv(), this->qname))
97 first_node = axiom_node_get_first_child(parent, Environment::getEnv());
102 WSF_LOG_ERROR_MSG(Environment::getEnv()->log, WSF_LOG_SI,
103 "Failed in building adb object for getFileResponse : "
104 "Expected %s but returned %s",
105 axutil_qname_to_string(qname, Environment::getEnv()),
106 axutil_qname_to_string(mqname, Environment::getEnv()));
108 return AXIS2_FAILURE;
114 * building return element
119 current_node = first_node;
120 is_early_node_valid = false;
123 while(current_node && axiom_node_get_node_type(current_node, Environment::getEnv()) != AXIOM_ELEMENT)
125 current_node = axiom_node_get_next_sibling(current_node, Environment::getEnv());
127 if(current_node != NULL)
129 current_element = (axiom_element_t *)axiom_node_get_data_element(current_node, Environment::getEnv());
130 mqname = axiom_element_get_qname(current_element, Environment::getEnv(), current_node);
133 element_qname = axutil_qname_create(Environment::getEnv(), "return", "http://salome.service.ws_server.splat.org", NULL);
137 (current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname))))
139 if( current_node && current_element && (axutil_qname_equals(element_qname, Environment::getEnv(), mqname)))
141 is_early_node_valid = true;
145 text_value = axiom_element_get_text(current_element, Environment::getEnv(), current_node);
146 if(text_value != NULL)
148 axutil_base64_binary_t* element = axutil_base64_binary_create(Environment::getEnv());
149 status = axutil_base64_binary_set_encoded_binary((axutil_base64_binary_t*)element, Environment::getEnv(),
151 if(AXIS2_FAILURE == status)
155 axutil_base64_binary_free(element, Environment::getEnv());
157 WSF_LOG_ERROR_MSG(Environment::getEnv()->log,WSF_LOG_SI, "failed in building element return ");
161 status = set_return(element);
165 if(AXIS2_FAILURE == status)
167 WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for return ");
170 axutil_qname_free(element_qname, Environment::getEnv());
172 return AXIS2_FAILURE;
178 axutil_qname_free(element_qname, Environment::getEnv());
179 element_qname = NULL;
186 org_splat_ws_server_service_salome::GetFileResponse::isParticle()
195 org_splat_ws_server_service_salome::GetFileResponse::declareParentNamespaces(
196 axiom_element_t *parent_element,
197 axutil_hash_t *namespaces, int *next_ns_index)
200 /* Here this is an empty function, Nothing to declare */
206 axiom_node_t* WSF_CALL
207 org_splat_ws_server_service_salome::GetFileResponse::serialize(axiom_node_t *parent,
208 axiom_element_t *parent_element,
209 int parent_tag_closed,
210 axutil_hash_t *namespaces,
216 axiom_node_t *current_node = NULL;
221 axiom_namespace_t *ns1 = NULL;
223 axis2_char_t *qname_uri = NULL;
224 axis2_char_t *qname_prefix = NULL;
225 axis2_char_t *p_prefix = NULL;
227 axis2_char_t *text_value_1;
228 axis2_char_t *text_value_1_temp;
230 axis2_char_t *start_input_str = NULL;
231 axis2_char_t *end_input_str = NULL;
232 unsigned int start_input_str_len = 0;
233 unsigned int end_input_str_len = 0;
236 axiom_data_source_t *data_source = NULL;
237 axutil_stream_t *stream = NULL;
240 int next_ns_index_value = 0;
242 namespaces = axutil_hash_make(Environment::getEnv());
243 next_ns_index = &next_ns_index_value;
245 ns1 = axiom_namespace_create (Environment::getEnv(),
246 "http://salome.service.ws_server.splat.org",
248 axutil_hash_set(namespaces, "http://salome.service.ws_server.splat.org", AXIS2_HASH_KEY_STRING, axutil_strdup(Environment::getEnv(), "n"));
251 parent_element = axiom_element_create (Environment::getEnv(), NULL, "getFileResponse", ns1 , &parent);
254 axiom_element_set_namespace(parent_element, Environment::getEnv(), ns1, parent);
258 data_source = axiom_data_source_create(Environment::getEnv(), parent, ¤t_node);
259 stream = axiom_data_source_get_stream(data_source, Environment::getEnv());
261 if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://salome.service.ws_server.splat.org", AXIS2_HASH_KEY_STRING)))
263 p_prefix = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT);
264 sprintf(p_prefix, "n%d", (*next_ns_index)++);
265 axutil_hash_set(namespaces, "http://salome.service.ws_server.splat.org", AXIS2_HASH_KEY_STRING, p_prefix);
267 axiom_element_declare_namespace_assume_param_ownership(parent_element, Environment::getEnv(), axiom_namespace_create (Environment::getEnv(),
268 "http://salome.service.ws_server.splat.org", p_prefix));
275 /* no need to complain for minoccurs=0 element */
281 start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) *
282 (4 + axutil_strlen(p_prefix) +
283 axutil_strlen("return")));
285 /* axutil_strlen("<:>") + 1 = 4 */
286 end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) *
287 (5 + axutil_strlen(p_prefix) + axutil_strlen("return")));
288 /* axutil_strlen("</:>") + 1 = 5 */
296 * parsing return element
301 sprintf(start_input_str, "<%s%sreturn>",
302 p_prefix?p_prefix:"",
303 (p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
305 start_input_str_len = axutil_strlen(start_input_str);
306 sprintf(end_input_str, "</%s%sreturn>",
307 p_prefix?p_prefix:"",
308 (p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
309 end_input_str_len = axutil_strlen(end_input_str);
311 text_value_1 =axutil_base64_binary_get_encoded_binary(property__return, Environment::getEnv());
313 axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len);
315 axutil_stream_write(stream, Environment::getEnv(), text_value_1, axutil_strlen(text_value_1));
317 axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len);
320 AXIS2_FREE(Environment::getEnv()->allocator,start_input_str);
321 AXIS2_FREE(Environment::getEnv()->allocator,end_input_str);
327 axutil_hash_index_t *hi;
329 for (hi = axutil_hash_first(namespaces, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi))
331 axutil_hash_this(hi, NULL, NULL, &val);
332 AXIS2_FREE(Environment::getEnv()->allocator, val);
334 axutil_hash_free(namespaces, Environment::getEnv());
345 * Getter for return by Property Number 1
347 axutil_base64_binary_t* WSF_CALL
348 org_splat_ws_server_service_salome::GetFileResponse::getProperty1()
356 axutil_base64_binary_t* WSF_CALL
357 org_splat_ws_server_service_salome::GetFileResponse::get_return()
359 return property__return;
366 org_splat_ws_server_service_salome::GetFileResponse::set_return(
367 axutil_base64_binary_t* arg__return)
372 arg__return == property__return)
384 if(NULL == arg__return)
387 /* We are already done */
391 property__return = arg__return;
392 isValid_return = true;
400 * resetter for return
403 org_splat_ws_server_service_salome::GetFileResponse::reset_return()
413 if(property__return != NULL)
417 axutil_base64_binary_free (property__return, Environment::getEnv());
418 property__return = NULL;
426 isValid_return = false;
431 * Check whether return is nill
434 org_splat_ws_server_service_salome::GetFileResponse::is_returnNil()
436 return !isValid_return;
440 * Set return to nill (currently the same as reset)
443 org_splat_ws_server_service_salome::GetFileResponse::set_returnNil()
445 return reset_return();