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 "PutFileResponse.h"
11 #include <Environment.h>
15 using namespace wso2wsf;
18 using namespace org_splat_ws_server_service_salome;
21 * Implementation of the putFileResponse|http://salome.service.ws_server.splat.org Element
23 org_splat_ws_server_service_salome::PutFileResponse::PutFileResponse()
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::PutFileResponse::PutFileResponse(std::string arg__return)
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::PutFileResponse::~PutFileResponse()
65 org_splat_ws_server_service_salome::PutFileResponse::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 putFileResponse : "
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 status = set_return(text_value);
151 if(AXIS2_FAILURE == status)
153 WSF_LOG_ERROR_MSG( Environment::getEnv()->log,WSF_LOG_SI,"failed in setting the value for return ");
156 axutil_qname_free(element_qname, Environment::getEnv());
158 return AXIS2_FAILURE;
164 axutil_qname_free(element_qname, Environment::getEnv());
165 element_qname = NULL;
172 org_splat_ws_server_service_salome::PutFileResponse::isParticle()
181 org_splat_ws_server_service_salome::PutFileResponse::declareParentNamespaces(
182 axiom_element_t *parent_element,
183 axutil_hash_t *namespaces, int *next_ns_index)
186 /* Here this is an empty function, Nothing to declare */
192 axiom_node_t* WSF_CALL
193 org_splat_ws_server_service_salome::PutFileResponse::serialize(axiom_node_t *parent,
194 axiom_element_t *parent_element,
195 int parent_tag_closed,
196 axutil_hash_t *namespaces,
202 axiom_node_t *current_node = NULL;
207 axiom_namespace_t *ns1 = NULL;
209 axis2_char_t *qname_uri = NULL;
210 axis2_char_t *qname_prefix = NULL;
211 axis2_char_t *p_prefix = NULL;
213 axis2_char_t *text_value_1;
214 axis2_char_t *text_value_1_temp;
216 axis2_char_t *start_input_str = NULL;
217 axis2_char_t *end_input_str = NULL;
218 unsigned int start_input_str_len = 0;
219 unsigned int end_input_str_len = 0;
222 axiom_data_source_t *data_source = NULL;
223 axutil_stream_t *stream = NULL;
226 int next_ns_index_value = 0;
228 namespaces = axutil_hash_make(Environment::getEnv());
229 next_ns_index = &next_ns_index_value;
231 ns1 = axiom_namespace_create (Environment::getEnv(),
232 "http://salome.service.ws_server.splat.org",
234 axutil_hash_set(namespaces, "http://salome.service.ws_server.splat.org", AXIS2_HASH_KEY_STRING, axutil_strdup(Environment::getEnv(), "n"));
237 parent_element = axiom_element_create (Environment::getEnv(), NULL, "putFileResponse", ns1 , &parent);
240 axiom_element_set_namespace(parent_element, Environment::getEnv(), ns1, parent);
244 data_source = axiom_data_source_create(Environment::getEnv(), parent, ¤t_node);
245 stream = axiom_data_source_get_stream(data_source, Environment::getEnv());
247 if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://salome.service.ws_server.splat.org", AXIS2_HASH_KEY_STRING)))
249 p_prefix = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT);
250 sprintf(p_prefix, "n%d", (*next_ns_index)++);
251 axutil_hash_set(namespaces, "http://salome.service.ws_server.splat.org", AXIS2_HASH_KEY_STRING, p_prefix);
253 axiom_element_declare_namespace_assume_param_ownership(parent_element, Environment::getEnv(), axiom_namespace_create (Environment::getEnv(),
254 "http://salome.service.ws_server.splat.org", p_prefix));
261 /* no need to complain for minoccurs=0 element */
267 start_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) *
268 (4 + axutil_strlen(p_prefix) +
269 axutil_strlen("return")));
271 /* axutil_strlen("<:>") + 1 = 4 */
272 end_input_str = (axis2_char_t*)AXIS2_MALLOC(Environment::getEnv()->allocator, sizeof(axis2_char_t) *
273 (5 + axutil_strlen(p_prefix) + axutil_strlen("return")));
274 /* axutil_strlen("</:>") + 1 = 5 */
282 * parsing return element
287 sprintf(start_input_str, "<%s%sreturn>",
288 p_prefix?p_prefix:"",
289 (p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
291 start_input_str_len = axutil_strlen(start_input_str);
292 sprintf(end_input_str, "</%s%sreturn>",
293 p_prefix?p_prefix:"",
294 (p_prefix && axutil_strcmp(p_prefix, ""))?":":"");
295 end_input_str_len = axutil_strlen(end_input_str);
297 text_value_1 = (axis2_char_t*)property__return.c_str();
299 axutil_stream_write(stream, Environment::getEnv(), start_input_str, start_input_str_len);
302 text_value_1_temp = axutil_xml_quote_string(Environment::getEnv(), text_value_1, true);
303 if (text_value_1_temp)
305 axutil_stream_write(stream, Environment::getEnv(), text_value_1_temp, axutil_strlen(text_value_1_temp));
306 AXIS2_FREE(Environment::getEnv()->allocator, text_value_1_temp);
310 axutil_stream_write(stream, Environment::getEnv(), text_value_1, axutil_strlen(text_value_1));
313 axutil_stream_write(stream, Environment::getEnv(), end_input_str, end_input_str_len);
316 AXIS2_FREE(Environment::getEnv()->allocator,start_input_str);
317 AXIS2_FREE(Environment::getEnv()->allocator,end_input_str);
323 axutil_hash_index_t *hi;
325 for (hi = axutil_hash_first(namespaces, Environment::getEnv()); hi; hi = axutil_hash_next(Environment::getEnv(), hi))
327 axutil_hash_this(hi, NULL, NULL, &val);
328 AXIS2_FREE(Environment::getEnv()->allocator, val);
330 axutil_hash_free(namespaces, Environment::getEnv());
341 * Getter for return by Property Number 1
344 org_splat_ws_server_service_salome::PutFileResponse::getProperty1()
353 org_splat_ws_server_service_salome::PutFileResponse::get_return()
355 return property__return;
362 org_splat_ws_server_service_salome::PutFileResponse::set_return(
363 const std::string arg__return)
368 arg__return == property__return)
380 property__return = std::string(arg__return.c_str());
381 isValid_return = true;
389 * resetter for return
392 org_splat_ws_server_service_salome::PutFileResponse::reset_return()
399 isValid_return = false;
404 * Check whether return is nill
407 org_splat_ws_server_service_salome::PutFileResponse::is_returnNil()
409 return !isValid_return;
413 * Set return to nill (currently the same as reset)
416 org_splat_ws_server_service_salome::PutFileResponse::set_returnNil()
418 return reset_return();