axiom_node_t* AXIS2_CALL adb_priority_type0_serialize_obj( adb_priority_type0_t* _priority_type0, const axutil_env_t *env, axiom_node_t *parent, axiom_element_t *parent_element, int parent_tag_closed, axutil_hash_t *namespaces, int *next_ns_index) { axiom_node_t* current_node = NULL; int tag_closed = 0; axis2_char_t* xsi_prefix = NULL; axiom_namespace_t* xsi_ns = NULL; axiom_attribute_t* xsi_type_attri = NULL; axiom_data_source_t *data_source = NULL; axutil_stream_t *stream = NULL; axis2_char_t *text_value; current_node = parent; data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, env); if (!data_source) return NULL; stream = axiom_data_source_get_stream(data_source, env); /* assume parent is of type data source */ if (!stream) return NULL; if(!parent_tag_closed && !tag_closed) { text_value = ">"; axutil_stream_write(stream, env, text_value, axutil_strlen(text_value)); } text_value = adb_priority_type0_serialize_to_string(_priority_type0, env, namespaces); if(text_value) { axutil_stream_write(stream, env, text_value, axutil_strlen(text_value)); AXIS2_FREE(env->allocator, text_value); } return parent; }
axiom_node_t* AXIS2_CALL adb_item_serialize_obj( adb_item_t* _item, const axutil_env_t *env, axiom_node_t *parent, axiom_element_t *parent_element, int parent_tag_closed, axutil_hash_t *namespaces, int *next_ns_index) { axiom_node_t* current_node = NULL; int tag_closed = 0; axis2_char_t* xsi_prefix = NULL; axiom_namespace_t* xsi_ns = NULL; axiom_attribute_t* xsi_type_attri = NULL; axiom_namespace_t *ns1 = NULL; axis2_char_t *qname_uri = NULL; axis2_char_t *qname_prefix = NULL; axis2_char_t *p_prefix = NULL; axis2_bool_t ns_already_defined; axis2_char_t *text_value_1; axis2_char_t *text_value_1_temp; axis2_char_t *start_input_str = NULL; axis2_char_t *end_input_str = NULL; unsigned int start_input_str_len = 0; unsigned int end_input_str_len = 0; axiom_data_source_t *data_source = NULL; axutil_stream_t *stream = NULL; int next_ns_index_value = 0; AXIS2_ENV_CHECK(env, NULL); AXIS2_PARAM_CHECK(env->error, _item, NULL); namespaces = axutil_hash_make(env); next_ns_index = &next_ns_index_value; ns1 = axiom_namespace_create (env, "http://www.daisy.org/ns/daisy-online/", "n"); axutil_hash_set(namespaces, "http://www.daisy.org/ns/daisy-online/", AXIS2_HASH_KEY_STRING, axutil_strdup(env, "n")); parent_element = axiom_element_create (env, NULL, "item", ns1 , &parent); axiom_element_set_namespace(parent_element, env, ns1, parent); data_source = axiom_data_source_create(env, parent, ¤t_node); stream = axiom_data_source_get_stream(data_source, env); if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://www.daisy.org/ns/daisy-online/", AXIS2_HASH_KEY_STRING))) { p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT); sprintf(p_prefix, "n%d", (*next_ns_index)++); axutil_hash_set(namespaces, "http://www.daisy.org/ns/daisy-online/", AXIS2_HASH_KEY_STRING, p_prefix); axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env, "http://www.daisy.org/ns/daisy-online/", p_prefix)); } if (!_item->is_valid_item) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Nil value found in non-nillable property item"); return NULL; } else { start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (4 + axutil_strlen(p_prefix) + axutil_strlen("item"))); /* axutil_strlen("<:>") + 1 = 4 */ end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (5 + axutil_strlen(p_prefix) + axutil_strlen("item"))); /* axutil_strlen("</:>") + 1 = 5 */ /* * parsing item element */ sprintf(start_input_str, "<%s%sitem>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); start_input_str_len = axutil_strlen(start_input_str); sprintf(end_input_str, "</%s%sitem>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); end_input_str_len = axutil_strlen(end_input_str); text_value_1 = _item->property_item; text_value_1_temp = axutil_xml_quote_string(env, text_value_1, AXIS2_TRUE); if (text_value_1_temp) { axutil_stream_write(stream, env, text_value_1_temp, axutil_strlen(text_value_1_temp)); AXIS2_FREE(env->allocator, text_value_1_temp); } else { axutil_stream_write(stream, env, text_value_1, axutil_strlen(text_value_1)); } AXIS2_FREE(env->allocator,start_input_str); AXIS2_FREE(env->allocator,end_input_str); } if(namespaces) { axutil_hash_index_t *hi; void *val; for (hi = axutil_hash_first(namespaces, env); hi; hi = axutil_hash_next(env, hi)) { axutil_hash_this(hi, NULL, NULL, &val); AXIS2_FREE(env->allocator, val); } axutil_hash_free(namespaces, env); } return parent; }
axiom_node_t* AXIS2_CALL adb_subscriberRequest_serialize_obj( adb_subscriberRequest_t* _subscriberRequest, const axutil_env_t *env, axiom_node_t *parent, axiom_element_t *parent_element, int parent_tag_closed, axutil_hash_t *namespaces, int *next_ns_index) { axiom_node_t* current_node = NULL; int tag_closed = 0; axiom_namespace_t *ns1 = NULL; axis2_char_t *qname_uri = NULL; axis2_char_t *qname_prefix = NULL; axis2_char_t *p_prefix = NULL; axis2_bool_t ns_already_defined; axis2_char_t text_value_1[ADB_DEFAULT_DIGIT_LIMIT]; axis2_char_t *start_input_str = NULL; axis2_char_t *end_input_str = NULL; unsigned int start_input_str_len = 0; unsigned int end_input_str_len = 0; axiom_data_source_t *data_source = NULL; axutil_stream_t *stream = NULL; int next_ns_index_value = 0; AXIS2_ENV_CHECK(env, NULL); AXIS2_PARAM_CHECK(env->error, _subscriberRequest, NULL); namespaces = axutil_hash_make(env); next_ns_index = &next_ns_index_value; ns1 = axiom_namespace_create (env, "http://mopevm.ru/axis2/services/types", "n"); axutil_hash_set(namespaces, "http://mopevm.ru/axis2/services/types", AXIS2_HASH_KEY_STRING, axutil_strdup(env, "n")); parent_element = axiom_element_create (env, NULL, "subscriberRequest", ns1 , &parent); axiom_element_set_namespace(parent_element, env, ns1, parent); data_source = axiom_data_source_create(env, parent, ¤t_node); stream = axiom_data_source_get_stream(data_source, env); p_prefix = NULL; if (!_subscriberRequest->is_valid_number) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Nil value found in non-nillable property number"); return NULL; } else { start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (4 + axutil_strlen(p_prefix) + axutil_strlen("number"))); /* axutil_strlen("<:>") + 1 = 4 */ end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (5 + axutil_strlen(p_prefix) + axutil_strlen("number"))); /* axutil_strlen("</:>") + 1 = 5 */ /* * parsing number element */ sprintf(start_input_str, "<%s%snumber>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); start_input_str_len = axutil_strlen(start_input_str); sprintf(end_input_str, "</%s%snumber>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); end_input_str_len = axutil_strlen(end_input_str); sprintf (text_value_1, AXIS2_PRINTF_INT32_FORMAT_SPECIFIER, _subscriberRequest->property_number); axutil_stream_write(stream, env, start_input_str, start_input_str_len); axutil_stream_write(stream, env, text_value_1, axutil_strlen(text_value_1)); axutil_stream_write(stream, env, end_input_str, end_input_str_len); AXIS2_FREE(env->allocator,start_input_str); AXIS2_FREE(env->allocator,end_input_str); } if(namespaces) { axutil_hash_index_t *hi; void *val; for (hi = axutil_hash_first(namespaces, env); hi; hi = axutil_hash_next(env, hi)) { axutil_hash_this(hi, NULL, NULL, &val); AXIS2_FREE(env->allocator, val); } axutil_hash_free(namespaces, env); } return parent; }
axiom_node_t* AXIS2_CALL adb_getPermissionsResponse_serialize_obj( adb_getPermissionsResponse_t* _getPermissionsResponse, const axutil_env_t *env, axiom_node_t *parent, axiom_element_t *parent_element, int parent_tag_closed, axutil_hash_t *namespaces, int *next_ns_index) { axiom_node_t* current_node = NULL; int tag_closed = 0; axiom_namespace_t *ns1 = NULL; axis2_char_t *qname_uri = NULL; axis2_char_t *qname_prefix = NULL; axis2_char_t *p_prefix = NULL; axis2_bool_t ns_already_defined; axis2_char_t text_value_1[ADB_DEFAULT_DIGIT_LIMIT]; axis2_char_t *start_input_str = NULL; axis2_char_t *end_input_str = NULL; unsigned int start_input_str_len = 0; unsigned int end_input_str_len = 0; axiom_data_source_t *data_source = NULL; axutil_stream_t *stream = NULL; int next_ns_index_value = 0; AXIS2_ENV_CHECK(env, NULL); AXIS2_PARAM_CHECK(env->error, _getPermissionsResponse, NULL); namespaces = axutil_hash_make(env); next_ns_index = &next_ns_index_value; ns1 = axiom_namespace_create (env, "http://services.resource.ui.mgt.registry.carbon.wso2.org", "n"); axutil_hash_set(namespaces, "http://services.resource.ui.mgt.registry.carbon.wso2.org", AXIS2_HASH_KEY_STRING, axutil_strdup(env, "n")); parent_element = axiom_element_create (env, NULL, "getPermissionsResponse", ns1 , &parent); axiom_element_set_namespace(parent_element, env, ns1, parent); data_source = axiom_data_source_create(env, parent, ¤t_node); stream = axiom_data_source_get_stream(data_source, env); if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://services.resource.ui.mgt.registry.carbon.wso2.org", AXIS2_HASH_KEY_STRING))) { p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT); sprintf(p_prefix, "n%d", (*next_ns_index)++); axutil_hash_set(namespaces, "http://services.resource.ui.mgt.registry.carbon.wso2.org", AXIS2_HASH_KEY_STRING, p_prefix); axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env, "http://services.resource.ui.mgt.registry.carbon.wso2.org", p_prefix)); } if (!_getPermissionsResponse->is_valid_return) { /* no need to complain for minoccurs=0 element */ } else { start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (4 + axutil_strlen(p_prefix) + axutil_strlen("return"))); /* axutil_strlen("<:>") + 1 = 4 */ end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (5 + axutil_strlen(p_prefix) + axutil_strlen("return"))); /* axutil_strlen("</:>") + 1 = 5 */ /* * parsing return element */ sprintf(start_input_str, "<%s%sreturn", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); start_input_str_len = axutil_strlen(start_input_str); sprintf(end_input_str, "</%s%sreturn>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); end_input_str_len = axutil_strlen(end_input_str); if(!adb_PermissionBean_is_particle()) { axutil_stream_write(stream, env, start_input_str, start_input_str_len); } adb_PermissionBean_serialize(_getPermissionsResponse->property_return, env, current_node, parent_element, adb_PermissionBean_is_particle() || AXIS2_FALSE, namespaces, next_ns_index); if(!adb_PermissionBean_is_particle()) { axutil_stream_write(stream, env, end_input_str, end_input_str_len); } AXIS2_FREE(env->allocator,start_input_str); AXIS2_FREE(env->allocator,end_input_str); } if(namespaces) { axutil_hash_index_t *hi; void *val; for (hi = axutil_hash_first(namespaces, env); hi; hi = axutil_hash_next(env, hi)) { axutil_hash_this(hi, NULL, NULL, &val); AXIS2_FREE(env->allocator, val); } axutil_hash_free(namespaces, env); } return parent; }
axiom_node_t* AXIS2_CALL adb_TransformTypeChoice_serialize_obj( adb_TransformTypeChoice_t* _TransformTypeChoice, const axutil_env_t *env, axiom_node_t *parent, axiom_element_t *parent_element, int parent_tag_closed, axutil_hash_t *namespaces, int *next_ns_index) { axis2_char_t *string_to_stream; axiom_node_t* current_node = NULL; int tag_closed = 0; axis2_char_t* xsi_prefix = NULL; axiom_namespace_t* xsi_ns = NULL; axiom_attribute_t* xsi_type_attri = NULL; axis2_char_t* type_attrib = NULL; axiom_namespace_t *ns1 = NULL; axis2_char_t *qname_uri = NULL; axis2_char_t *qname_prefix = NULL; axis2_char_t *p_prefix = NULL; axis2_bool_t ns_already_defined; axis2_char_t *text_value_1; axis2_char_t *text_value_1_temp; axis2_char_t *text_value_2; axis2_char_t *text_value_2_temp; axis2_char_t *start_input_str = NULL; axis2_char_t *end_input_str = NULL; unsigned int start_input_str_len = 0; unsigned int end_input_str_len = 0; axiom_data_source_t *data_source = NULL; axutil_stream_t *stream = NULL; AXIS2_ENV_CHECK(env, NULL); AXIS2_PARAM_CHECK(env->error, _TransformTypeChoice, NULL); current_node = parent; data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, env); if (!data_source) return NULL; stream = axiom_data_source_get_stream(data_source, env); /* assume parent is of type data source */ if (!stream) return NULL; if(!parent_tag_closed) { if(!(xsi_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://www.w3.org/2001/XMLSchema-instance", AXIS2_HASH_KEY_STRING))) { /* it is better to stick with the standard prefix */ xsi_prefix = (axis2_char_t*)axutil_strdup(env, "xsi"); axutil_hash_set(namespaces, "http://www.w3.org/2001/XMLSchema-instance", AXIS2_HASH_KEY_STRING, xsi_prefix); if(parent_element) { axiom_namespace_t *element_ns = NULL; element_ns = axiom_namespace_create(env, "http://www.w3.org/2001/XMLSchema-instance", xsi_prefix); axiom_element_declare_namespace_assume_param_ownership(parent_element, env, element_ns); if(element_ns) { axiom_namespace_free(element_ns, env); } } } type_attrib = axutil_strcat(env, " ", xsi_prefix, ":type=\"TransformTypeChoice\"", NULL); axutil_stream_write(stream, env, type_attrib, axutil_strlen(type_attrib)); AXIS2_FREE(env->allocator, type_attrib); string_to_stream = ">"; axutil_stream_write(stream, env, string_to_stream, axutil_strlen(string_to_stream)); tag_closed = 1; } else { /* if the parent tag closed we would be able to declare the type directly on the parent element */ if(!(xsi_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://www.w3.org/2001/XMLSchema-instance", AXIS2_HASH_KEY_STRING))) { /* it is better to stick with the standard prefix */ xsi_prefix = (axis2_char_t*)axutil_strdup(env, "xsi"); axutil_hash_set(namespaces, "http://www.w3.org/2001/XMLSchema-instance", AXIS2_HASH_KEY_STRING, xsi_prefix); if(parent_element) { axiom_namespace_t *element_ns = NULL; element_ns = axiom_namespace_create(env, "http://www.w3.org/2001/XMLSchema-instance", xsi_prefix); axiom_element_declare_namespace_assume_param_ownership(parent_element, env, element_ns); if(element_ns) { axiom_namespace_free(element_ns, env); } } } } xsi_ns = axiom_namespace_create (env, "http://www.w3.org/2000/09/xmldsig#", xsi_prefix); xsi_type_attri = axiom_attribute_create (env, "type", "TransformTypeChoice", xsi_ns); axiom_element_add_attribute (parent_element, env, xsi_type_attri, parent); if(0 == axutil_strcmp(_TransformTypeChoice->current_choice, ":extraElement")) { p_prefix = NULL; if (!_TransformTypeChoice->is_valid_extraElement) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Nil value found in non-nillable property extraElement"); return NULL; } else { start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (4 + axutil_strlen(p_prefix) + axutil_strlen("extraElement"))); /* axutil_strlen("<:>") + 1 = 4 */ end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (5 + axutil_strlen(p_prefix) + axutil_strlen("extraElement"))); /* axutil_strlen("</:>") + 1 = 5 */ /* * parsing extraElement element */ sprintf(start_input_str, "<%s%sextraElement>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); start_input_str_len = axutil_strlen(start_input_str); sprintf(end_input_str, "</%s%sextraElement>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); end_input_str_len = axutil_strlen(end_input_str); text_value_1 = axiom_node_to_string(_TransformTypeChoice->property_extraElement, env); axutil_stream_write(stream, env, text_value_1, axutil_strlen(text_value_1)); AXIS2_FREE(env->allocator,start_input_str); AXIS2_FREE(env->allocator,end_input_str); } } if(0 == axutil_strcmp(_TransformTypeChoice->current_choice, "http://www.w3.org/2000/09/xmldsig#:XPath")) { if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://www.w3.org/2000/09/xmldsig#", AXIS2_HASH_KEY_STRING))) { p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT); sprintf(p_prefix, "n%d", (*next_ns_index)++); axutil_hash_set(namespaces, "http://www.w3.org/2000/09/xmldsig#", AXIS2_HASH_KEY_STRING, p_prefix); axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env, "http://www.w3.org/2000/09/xmldsig#", p_prefix)); } if (!_TransformTypeChoice->is_valid_XPath) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Nil value found in non-nillable property XPath"); return NULL; } else { start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (4 + axutil_strlen(p_prefix) + axutil_strlen("XPath"))); /* axutil_strlen("<:>") + 1 = 4 */ end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (5 + axutil_strlen(p_prefix) + axutil_strlen("XPath"))); /* axutil_strlen("</:>") + 1 = 5 */ /* * parsing XPath element */ sprintf(start_input_str, "<%s%sXPath>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); start_input_str_len = axutil_strlen(start_input_str); sprintf(end_input_str, "</%s%sXPath>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); end_input_str_len = axutil_strlen(end_input_str); text_value_2 = _TransformTypeChoice->property_XPath; axutil_stream_write(stream, env, start_input_str, start_input_str_len); text_value_2_temp = axutil_xml_quote_string(env, text_value_2, AXIS2_TRUE); if (text_value_2_temp) { axutil_stream_write(stream, env, text_value_2_temp, axutil_strlen(text_value_2_temp)); AXIS2_FREE(env->allocator, text_value_2_temp); } else { axutil_stream_write(stream, env, text_value_2, axutil_strlen(text_value_2)); } axutil_stream_write(stream, env, end_input_str, end_input_str_len); AXIS2_FREE(env->allocator,start_input_str); AXIS2_FREE(env->allocator,end_input_str); } } return parent; }
axiom_node_t* AXIS2_CALL axis2_sellRequest_ex_serialize( axis2_sellRequest_ex_t* sellRequest_ex, const axutil_env_t *env, axiom_node_t* parent, int has_parent) { axiom_namespace_t *ns1 = NULL; axis2_char_t *text_value_1; axis2_char_t *text_value_2; axis2_char_t text_value_3[64]; axiom_node_t *current_node = NULL; axiom_element_t *current_element = NULL; axiom_data_source_t *data_source = NULL; axutil_stream_t *stream = NULL; axis2_char_t *start_input_str = NULL; axis2_char_t *end_input_str = NULL; unsigned int start_input_str_len = 0; unsigned int end_input_str_len = 0; AXIS2_ENV_CHECK(env, NULL); ns1 = axiom_namespace_create (env, "http://www.wso2.org/types", "ns1"); if( parent == NULL) { current_element = axiom_element_create (env, parent, "sell", ns1 , ¤t_node); axiom_element_set_namespace( current_element, env, ns1, current_node); parent = current_node; } if(has_parent) { data_source = axiom_node_get_data_element(parent, env); if (!data_source) return NULL; stream = axiom_data_source_get_stream(data_source, env); /* assume parent is of type data source */ if (!stream) return NULL; current_node = parent; } else { data_source = axiom_data_source_create(env, parent, ¤t_node); stream = axiom_data_source_get_stream(data_source, env); } /** * parsing userid element */ start_input_str = "<ns1:userid>"; start_input_str_len = axutil_strlen(start_input_str); end_input_str = "</ns1:userid>"; end_input_str_len = axutil_strlen(end_input_str); text_value_1 = sellRequest_ex->attrib_userid; axutil_stream_write(stream, env, start_input_str, start_input_str_len); axutil_stream_write(stream, env, text_value_1, axutil_strlen(text_value_1)); axutil_stream_write(stream, env, end_input_str, end_input_str_len); /** * parsing symbol element */ start_input_str = "<ns1:symbol>"; start_input_str_len = axutil_strlen(start_input_str); end_input_str = "</ns1:symbol>"; end_input_str_len = axutil_strlen(end_input_str); text_value_2 = sellRequest_ex->attrib_symbol; axutil_stream_write(stream, env, start_input_str, start_input_str_len); axutil_stream_write(stream, env, text_value_2, axutil_strlen(text_value_2)); axutil_stream_write(stream, env, end_input_str, end_input_str_len); /** * parsing qty element */ start_input_str = "<ns1:qty>"; start_input_str_len = axutil_strlen(start_input_str); end_input_str = "</ns1:qty>"; end_input_str_len = axutil_strlen(end_input_str); sprintf ( text_value_3, "%d", sellRequest_ex->attrib_qty ); axutil_stream_write(stream, env, start_input_str, start_input_str_len); axutil_stream_write(stream, env, text_value_3, axutil_strlen(text_value_3)); axutil_stream_write(stream, env, end_input_str, end_input_str_len); return parent; }
axiom_node_t* AXIS2_CALL adb_createReservationResponse_serialize( adb_createReservationResponse_t* _createReservationResponse, const axutil_env_t *env, axiom_node_t *parent, axiom_element_t *parent_element, int parent_tag_closed, axutil_hash_t *namespaces, int *next_ns_index) { axis2_char_t *string_to_stream; axiom_node_t *current_node = NULL; int tag_closed = 0; axiom_namespace_t *ns1 = NULL; axis2_char_t *qname_uri = NULL; axis2_char_t *qname_prefix = NULL; axis2_char_t *p_prefix = NULL; axis2_bool_t ns_already_defined; axis2_char_t text_value_1[64]; axis2_char_t *start_input_str = NULL; axis2_char_t *end_input_str = NULL; unsigned int start_input_str_len = 0; unsigned int end_input_str_len = 0; axiom_data_source_t *data_source = NULL; axutil_stream_t *stream = NULL; AXIS2_ENV_CHECK(env, NULL); AXIS2_PARAM_CHECK(env->error, _createReservationResponse, NULL); current_node = parent; data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, env); if (!data_source) return NULL; stream = axiom_data_source_get_stream(data_source, env); /* assume parent is of type data source */ if (!stream) return NULL; if(!parent_tag_closed) { string_to_stream = ">"; axutil_stream_write(stream, env, string_to_stream, axutil_strlen(string_to_stream)); tag_closed = 1; } p_prefix = NULL; if (!_createReservationResponse->is_valid_ReservationStatus) { /* no need to complain for minoccurs=0 element */ } else { start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (4 + axutil_strlen(p_prefix) + axutil_strlen("ReservationStatus"))); /* axutil_strlen("<:>") + 1 = 4 */ end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (5 + axutil_strlen(p_prefix) + axutil_strlen("ReservationStatus"))); /* axutil_strlen("</:>") + 1 = 5 */ /* * parsing ReservationStatus element */ sprintf(start_input_str, "<%s%sReservationStatus", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); start_input_str_len = axutil_strlen(start_input_str); sprintf(end_input_str, "</%s%sReservationStatus>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); end_input_str_len = axutil_strlen(end_input_str); if(!adb_ReservationStatus_is_particle()) { axutil_stream_write(stream, env, start_input_str, start_input_str_len); } adb_ReservationStatus_serialize(_createReservationResponse->property_ReservationStatus, env, current_node, parent_element, adb_ReservationStatus_is_particle() || AXIS2_FALSE, namespaces, next_ns_index); if(!adb_ReservationStatus_is_particle()) { axutil_stream_write(stream, env, end_input_str, end_input_str_len); } AXIS2_FREE(env->allocator,start_input_str); AXIS2_FREE(env->allocator,end_input_str); } return parent; }
axiom_node_t* AXIS2_CALL adb_ProductCompleteType_serialize( adb_ProductCompleteType_t* _ProductCompleteType, const axutil_env_t *env, axiom_node_t *parent, axiom_element_t *parent_element, int parent_tag_closed, axutil_hash_t *namespaces, int *next_ns_index) { axis2_char_t *string_to_stream; axiom_node_t *current_node = NULL; int tag_closed = 0; axiom_namespace_t *ns1 = NULL; axis2_char_t *qname_uri = NULL; axis2_char_t *qname_prefix = NULL; axis2_char_t *p_prefix = NULL; axis2_bool_t ns_already_defined; axis2_char_t *text_value_1; axis2_char_t *text_value_1_temp; axis2_char_t *text_value_2; axis2_char_t *text_value_2_temp; axis2_char_t *start_input_str = NULL; axis2_char_t *end_input_str = NULL; unsigned int start_input_str_len = 0; unsigned int end_input_str_len = 0; axiom_data_source_t *data_source = NULL; axutil_stream_t *stream = NULL; AXIS2_ENV_CHECK(env, NULL); AXIS2_PARAM_CHECK(env->error, _ProductCompleteType, NULL); current_node = parent; data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, env); if (!data_source) return NULL; stream = axiom_data_source_get_stream(data_source, env); /* assume parent is of type data source */ if (!stream) return NULL; if(!parent_tag_closed) { string_to_stream = ">"; axutil_stream_write(stream, env, string_to_stream, axutil_strlen(string_to_stream)); tag_closed = 1; } if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://server.ips.com", AXIS2_HASH_KEY_STRING))) { p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT); sprintf(p_prefix, "n%d", (*next_ns_index)++); axutil_hash_set(namespaces, "http://server.ips.com", AXIS2_HASH_KEY_STRING, p_prefix); axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env, "http://server.ips.com", p_prefix)); } if (!_ProductCompleteType->is_valid_productCategory) { /* no need to complain for minoccurs=0 element */ } else { start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (4 + axutil_strlen(p_prefix) + axutil_strlen("productCategory"))); /* axutil_strlen("<:>") + 1 = 4 */ end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (5 + axutil_strlen(p_prefix) + axutil_strlen("productCategory"))); /* axutil_strlen("</:>") + 1 = 5 */ /* * parsing productCategory element */ sprintf(start_input_str, "<%s%sproductCategory>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); start_input_str_len = axutil_strlen(start_input_str); sprintf(end_input_str, "</%s%sproductCategory>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); end_input_str_len = axutil_strlen(end_input_str); text_value_1 = _ProductCompleteType->property_productCategory; axutil_stream_write(stream, env, start_input_str, start_input_str_len); text_value_1_temp = axutil_xml_quote_string(env, text_value_1, AXIS2_TRUE); if (text_value_1_temp) { axutil_stream_write(stream, env, text_value_1_temp, axutil_strlen(text_value_1_temp)); AXIS2_FREE(env->allocator, text_value_1_temp); } else { axutil_stream_write(stream, env, text_value_1, axutil_strlen(text_value_1)); } axutil_stream_write(stream, env, end_input_str, end_input_str_len); AXIS2_FREE(env->allocator,start_input_str); AXIS2_FREE(env->allocator,end_input_str); } if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://server.ips.com", AXIS2_HASH_KEY_STRING))) { p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT); sprintf(p_prefix, "n%d", (*next_ns_index)++); axutil_hash_set(namespaces, "http://server.ips.com", AXIS2_HASH_KEY_STRING, p_prefix); axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env, "http://server.ips.com", p_prefix)); } if (!_ProductCompleteType->is_valid_productName) { /* no need to complain for minoccurs=0 element */ } else { start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (4 + axutil_strlen(p_prefix) + axutil_strlen("productName"))); /* axutil_strlen("<:>") + 1 = 4 */ end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (5 + axutil_strlen(p_prefix) + axutil_strlen("productName"))); /* axutil_strlen("</:>") + 1 = 5 */ /* * parsing productName element */ sprintf(start_input_str, "<%s%sproductName>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); start_input_str_len = axutil_strlen(start_input_str); sprintf(end_input_str, "</%s%sproductName>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); end_input_str_len = axutil_strlen(end_input_str); text_value_2 = _ProductCompleteType->property_productName; axutil_stream_write(stream, env, start_input_str, start_input_str_len); text_value_2_temp = axutil_xml_quote_string(env, text_value_2, AXIS2_TRUE); if (text_value_2_temp) { axutil_stream_write(stream, env, text_value_2_temp, axutil_strlen(text_value_2_temp)); AXIS2_FREE(env->allocator, text_value_2_temp); } else { axutil_stream_write(stream, env, text_value_2, axutil_strlen(text_value_2)); } axutil_stream_write(stream, env, end_input_str, end_input_str_len); AXIS2_FREE(env->allocator,start_input_str); AXIS2_FREE(env->allocator,end_input_str); } return parent; }
axiom_node_t* AXIS2_CALL axis2_PortFolio_serialize( axis2_PortFolio_t* PortFolio, const axutil_env_t *env, axiom_node_t* parent, int has_parent) { axiom_namespace_t *ns1 = NULL; long i = 0; long count = 0; void *element = NULL; /*axis2_char_t text_value_1[64];*/ axiom_node_t *current_node = NULL; /*axiom_element_t *current_element = NULL;*/ axiom_data_source_t *data_source = NULL; axutil_stream_t *stream = NULL; axis2_char_t *start_input_str = NULL; axis2_char_t *end_input_str = NULL; unsigned int start_input_str_len = 0; unsigned int end_input_str_len = 0; AXIS2_ENV_CHECK(env, NULL); ns1 = axiom_namespace_create (env, "http://www.wso2.org/types", "ns1"); if(has_parent) { data_source = axiom_node_get_data_element(parent, env); if (!data_source) return NULL; stream = axiom_data_source_get_stream(data_source, env); /* assume parent is of type data source */ if (!stream) return NULL; current_node = parent; } else { data_source = axiom_data_source_create(env, parent, ¤t_node); stream = axiom_data_source_get_stream(data_source, env); } /** * parsing portFolioItem array */ if ( PortFolio->attrib_portFolioItem != NULL) { start_input_str = "<ns1:portFolioItem xmlns:ns1=\"http://www.wso2.org/types\">"; start_input_str_len = axutil_strlen(start_input_str); end_input_str = "</ns1:portFolioItem>"; end_input_str_len = axutil_strlen(end_input_str); count = axutil_array_list_size( PortFolio->attrib_portFolioItem, env); for( i = 0; i < count; i ++) { element = axutil_array_list_get( PortFolio->attrib_portFolioItem, env, i); /** * parsing portFolioItem element */ axutil_stream_write(stream, env, start_input_str, start_input_str_len); axis2_PortFolioItem_serialize( (axis2_PortFolioItem_t*)element, env, current_node, AXIS2_TRUE); axutil_stream_write(stream, env, end_input_str, end_input_str_len); } } return parent; }
axiom_node_t* AXIS2_CALL adb_supportedContentFormats_type0_serialize_obj( adb_supportedContentFormats_type0_t* _supportedContentFormats_type0, const axutil_env_t *env, axiom_node_t *parent, axiom_element_t *parent_element, int parent_tag_closed, axutil_hash_t *namespaces, int *next_ns_index) { axis2_char_t *string_to_stream; axiom_node_t* current_node = NULL; int tag_closed = 0; axis2_char_t* xsi_prefix = NULL; axiom_namespace_t* xsi_ns = NULL; axiom_attribute_t* xsi_type_attri = NULL; axis2_char_t* type_attrib = NULL; axiom_namespace_t *ns1 = NULL; axis2_char_t *qname_uri = NULL; axis2_char_t *qname_prefix = NULL; axis2_char_t *p_prefix = NULL; axis2_bool_t ns_already_defined; int i = 0; int count = 0; void *element = NULL; axis2_char_t *text_value_1; axis2_char_t *text_value_1_temp; axis2_char_t *start_input_str = NULL; axis2_char_t *end_input_str = NULL; unsigned int start_input_str_len = 0; unsigned int end_input_str_len = 0; axiom_data_source_t *data_source = NULL; axutil_stream_t *stream = NULL; AXIS2_ENV_CHECK(env, NULL); AXIS2_PARAM_CHECK(env->error, _supportedContentFormats_type0, NULL); current_node = parent; data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, env); if (!data_source) return NULL; stream = axiom_data_source_get_stream(data_source, env); /* assume parent is of type data source */ if (!stream) return NULL; if(!parent_tag_closed) { if(!(xsi_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://www.w3.org/2001/XMLSchema-instance", AXIS2_HASH_KEY_STRING))) { /* it is better to stick with the standard prefix */ xsi_prefix = (axis2_char_t*)axutil_strdup(env, "xsi"); axutil_hash_set(namespaces, "http://www.w3.org/2001/XMLSchema-instance", AXIS2_HASH_KEY_STRING, xsi_prefix); if(parent_element) { axiom_namespace_t *element_ns = NULL; element_ns = axiom_namespace_create(env, "http://www.w3.org/2001/XMLSchema-instance", xsi_prefix); axiom_element_declare_namespace_assume_param_ownership(parent_element, env, element_ns); if(element_ns) { axiom_namespace_free(element_ns, env); } } } type_attrib = axutil_strcat(env, " ", xsi_prefix, ":type=\"supportedContentFormats_type0\"", NULL); axutil_stream_write(stream, env, type_attrib, axutil_strlen(type_attrib)); AXIS2_FREE(env->allocator, type_attrib); string_to_stream = ">"; axutil_stream_write(stream, env, string_to_stream, axutil_strlen(string_to_stream)); tag_closed = 1; } else { /* if the parent tag closed we would be able to declare the type directly on the parent element */ if(!(xsi_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://www.w3.org/2001/XMLSchema-instance", AXIS2_HASH_KEY_STRING))) { /* it is better to stick with the standard prefix */ xsi_prefix = (axis2_char_t*)axutil_strdup(env, "xsi"); axutil_hash_set(namespaces, "http://www.w3.org/2001/XMLSchema-instance", AXIS2_HASH_KEY_STRING, xsi_prefix); if(parent_element) { axiom_namespace_t *element_ns = NULL; element_ns = axiom_namespace_create(env, "http://www.w3.org/2001/XMLSchema-instance", xsi_prefix); axiom_element_declare_namespace_assume_param_ownership(parent_element, env, element_ns); if(element_ns) { axiom_namespace_free(element_ns, env); } } } } xsi_ns = axiom_namespace_create (env, "http://www.daisy.org/ns/daisy-online/", xsi_prefix); xsi_type_attri = axiom_attribute_create (env, "type", "supportedContentFormats_type0", xsi_ns); axiom_element_add_attribute (parent_element, env, xsi_type_attri, parent); if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://www.daisy.org/ns/daisy-online/", AXIS2_HASH_KEY_STRING))) { p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT); sprintf(p_prefix, "n%d", (*next_ns_index)++); axutil_hash_set(namespaces, "http://www.daisy.org/ns/daisy-online/", AXIS2_HASH_KEY_STRING, p_prefix); axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env, "http://www.daisy.org/ns/daisy-online/", p_prefix)); } if (!_supportedContentFormats_type0->is_valid_contentFormat) { /* no need to complain for minoccurs=0 element */ } else { start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (4 + axutil_strlen(p_prefix) + axutil_strlen("contentFormat"))); /* axutil_strlen("<:>") + 1 = 4 */ end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (5 + axutil_strlen(p_prefix) + axutil_strlen("contentFormat"))); /* axutil_strlen("</:>") + 1 = 5 */ /* * Parsing contentFormat array */ if (_supportedContentFormats_type0->property_contentFormat != NULL) { sprintf(start_input_str, "<%s%scontentFormat>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); start_input_str_len = axutil_strlen(start_input_str); sprintf(end_input_str, "</%s%scontentFormat>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); end_input_str_len = axutil_strlen(end_input_str); count = axutil_array_list_size(_supportedContentFormats_type0->property_contentFormat, env); for(i = 0; i < count; i ++) { element = axutil_array_list_get(_supportedContentFormats_type0->property_contentFormat, env, i); if(NULL == element) { continue; } /* * parsing contentFormat element */ text_value_1 = (axis2_char_t*)element; axutil_stream_write(stream, env, start_input_str, start_input_str_len); text_value_1_temp = axutil_xml_quote_string(env, text_value_1, AXIS2_TRUE); if (text_value_1_temp) { axutil_stream_write(stream, env, text_value_1_temp, axutil_strlen(text_value_1_temp)); AXIS2_FREE(env->allocator, text_value_1_temp); } else { axutil_stream_write(stream, env, text_value_1, axutil_strlen(text_value_1)); } axutil_stream_write(stream, env, end_input_str, end_input_str_len); } } AXIS2_FREE(env->allocator,start_input_str); AXIS2_FREE(env->allocator,end_input_str); } return parent; }
axiom_node_t* AXIS2_CALL adb_KeyPairType_serialize_obj( adb_KeyPairType_t* _KeyPairType, const axutil_env_t *env, axiom_node_t *parent, axiom_element_t *parent_element, int parent_tag_closed, axutil_hash_t *namespaces, int *next_ns_index) { axis2_char_t *string_to_stream; axiom_node_t* current_node = NULL; int tag_closed = 0; axis2_char_t* xsi_prefix = NULL; axiom_namespace_t* xsi_ns = NULL; axiom_attribute_t* xsi_type_attri = NULL; axis2_char_t* type_attrib = NULL; axiom_namespace_t *ns1 = NULL; axis2_char_t *qname_uri = NULL; axis2_char_t *qname_prefix = NULL; axis2_char_t *p_prefix = NULL; axis2_bool_t ns_already_defined; axis2_char_t text_value_1[ADB_DEFAULT_DIGIT_LIMIT]; axis2_char_t text_value_2[ADB_DEFAULT_DIGIT_LIMIT]; axis2_char_t *start_input_str = NULL; axis2_char_t *end_input_str = NULL; unsigned int start_input_str_len = 0; unsigned int end_input_str_len = 0; axiom_data_source_t *data_source = NULL; axutil_stream_t *stream = NULL; AXIS2_ENV_CHECK(env, NULL); AXIS2_PARAM_CHECK(env->error, _KeyPairType, NULL); current_node = parent; data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, env); if (!data_source) return NULL; stream = axiom_data_source_get_stream(data_source, env); /* assume parent is of type data source */ if (!stream) return NULL; if(!parent_tag_closed) { if(!(xsi_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://www.w3.org/2001/XMLSchema-instance", AXIS2_HASH_KEY_STRING))) { /* it is better to stick with the standard prefix */ xsi_prefix = (axis2_char_t*)axutil_strdup(env, "xsi"); axutil_hash_set(namespaces, "http://www.w3.org/2001/XMLSchema-instance", AXIS2_HASH_KEY_STRING, xsi_prefix); if(parent_element) { axiom_namespace_t *element_ns = NULL; element_ns = axiom_namespace_create(env, "http://www.w3.org/2001/XMLSchema-instance", xsi_prefix); axiom_element_declare_namespace_assume_param_ownership(parent_element, env, element_ns); if(element_ns) { axiom_namespace_free(element_ns, env); } } } type_attrib = axutil_strcat(env, " ", xsi_prefix, ":type=\"KeyPairType\"", NULL); axutil_stream_write(stream, env, type_attrib, axutil_strlen(type_attrib)); AXIS2_FREE(env->allocator, type_attrib); string_to_stream = ">"; axutil_stream_write(stream, env, string_to_stream, axutil_strlen(string_to_stream)); tag_closed = 1; } else { /* if the parent tag closed we would be able to declare the type directly on the parent element */ if(!(xsi_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://www.w3.org/2001/XMLSchema-instance", AXIS2_HASH_KEY_STRING))) { /* it is better to stick with the standard prefix */ xsi_prefix = (axis2_char_t*)axutil_strdup(env, "xsi"); axutil_hash_set(namespaces, "http://www.w3.org/2001/XMLSchema-instance", AXIS2_HASH_KEY_STRING, xsi_prefix); if(parent_element) { axiom_namespace_t *element_ns = NULL; element_ns = axiom_namespace_create(env, "http://www.w3.org/2001/XMLSchema-instance", xsi_prefix); axiom_element_declare_namespace_assume_param_ownership(parent_element, env, element_ns); if(element_ns) { axiom_namespace_free(element_ns, env); } } } } xsi_ns = axiom_namespace_create (env, "http://www.daisy.org/DRM/2005/KeyExchange", xsi_prefix); xsi_type_attri = axiom_attribute_create (env, "type", "KeyPairType", xsi_ns); axiom_element_add_attribute (parent_element, env, xsi_type_attri, parent); if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://www.w3.org/2000/09/xmldsig#", AXIS2_HASH_KEY_STRING))) { p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT); sprintf(p_prefix, "n%d", (*next_ns_index)++); axutil_hash_set(namespaces, "http://www.w3.org/2000/09/xmldsig#", AXIS2_HASH_KEY_STRING, p_prefix); axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env, "http://www.w3.org/2000/09/xmldsig#", p_prefix)); } if (!_KeyPairType->is_valid_KeyInfo) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Nil value found in non-nillable property KeyInfo"); return NULL; } else { start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (4 + axutil_strlen(p_prefix) + axutil_strlen("KeyInfo"))); /* axutil_strlen("<:>") + 1 = 4 */ end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (5 + axutil_strlen(p_prefix) + axutil_strlen("KeyInfo"))); /* axutil_strlen("</:>") + 1 = 5 */ /* * parsing KeyInfo element */ sprintf(start_input_str, "<%s%sKeyInfo", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); start_input_str_len = axutil_strlen(start_input_str); sprintf(end_input_str, "</%s%sKeyInfo>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); end_input_str_len = axutil_strlen(end_input_str); if(!adb_KeyInfoType_is_particle()) { axutil_stream_write(stream, env, start_input_str, start_input_str_len); } adb_KeyInfoType_serialize(_KeyPairType->property_KeyInfo, env, current_node, parent_element, adb_KeyInfoType_is_particle() || AXIS2_FALSE, namespaces, next_ns_index); if(!adb_KeyInfoType_is_particle()) { axutil_stream_write(stream, env, end_input_str, end_input_str_len); } AXIS2_FREE(env->allocator,start_input_str); AXIS2_FREE(env->allocator,end_input_str); } if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://www.w3.org/2001/04/xmlenc#", AXIS2_HASH_KEY_STRING))) { p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT); sprintf(p_prefix, "n%d", (*next_ns_index)++); axutil_hash_set(namespaces, "http://www.w3.org/2001/04/xmlenc#", AXIS2_HASH_KEY_STRING, p_prefix); axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env, "http://www.w3.org/2001/04/xmlenc#", p_prefix)); } if (!_KeyPairType->is_valid_EncryptedKey) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Nil value found in non-nillable property EncryptedKey"); return NULL; } else { start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (4 + axutil_strlen(p_prefix) + axutil_strlen("EncryptedKey"))); /* axutil_strlen("<:>") + 1 = 4 */ end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (5 + axutil_strlen(p_prefix) + axutil_strlen("EncryptedKey"))); /* axutil_strlen("</:>") + 1 = 5 */ /* * parsing EncryptedKey element */ sprintf(start_input_str, "<%s%sEncryptedKey", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); start_input_str_len = axutil_strlen(start_input_str); sprintf(end_input_str, "</%s%sEncryptedKey>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); end_input_str_len = axutil_strlen(end_input_str); if(!adb_EncryptedKeyType_is_particle()) { axutil_stream_write(stream, env, start_input_str, start_input_str_len); } adb_EncryptedKeyType_serialize(_KeyPairType->property_EncryptedKey, env, current_node, parent_element, adb_EncryptedKeyType_is_particle() || AXIS2_FALSE, namespaces, next_ns_index); if(!adb_EncryptedKeyType_is_particle()) { axutil_stream_write(stream, env, end_input_str, end_input_str_len); } AXIS2_FREE(env->allocator,start_input_str); AXIS2_FREE(env->allocator,end_input_str); } return parent; }
axiom_node_t* AXIS2_CALL adb_lang_type0_serialize_obj( adb_lang_type0_t* _lang_type0, const axutil_env_t *env, axiom_node_t *parent, axiom_element_t *parent_element, int parent_tag_closed, axutil_hash_t *namespaces, int *next_ns_index) { axiom_node_t* current_node = NULL; int tag_closed = 0; axis2_char_t* xsi_prefix = NULL; axiom_namespace_t* xsi_ns = NULL; axiom_attribute_t* xsi_type_attri = NULL; axiom_data_source_t *data_source = NULL; axutil_stream_t *stream = NULL; axis2_char_t *text_value; current_node = parent; data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, env); if (!data_source) return NULL; stream = axiom_data_source_get_stream(data_source, env); /* assume parent is of type data source */ if (!stream) return NULL; /* here we need to declare the union type in the xsi:type field */ if(axutil_strcmp(_lang_type0->current_value, "")) { if(!(xsi_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://www.w3.org/2001/XMLSchema-instance", AXIS2_HASH_KEY_STRING))) { /* it is better to stick with the standard prefix */ xsi_prefix = (axis2_char_t*)axutil_strdup(env, "xsi"); axutil_hash_set(namespaces, "http://www.w3.org/2001/XMLSchema-instance", AXIS2_HASH_KEY_STRING, xsi_prefix); if(parent_element) { axiom_namespace_t *element_ns = NULL; element_ns = axiom_namespace_create(env, "http://www.w3.org/2001/XMLSchema-instance", xsi_prefix); axiom_element_declare_namespace_assume_param_ownership(parent_element, env, element_ns); } } if(!axutil_strcmp(_lang_type0->current_value, "language")) { axis2_char_t *ns_prefix = NULL; if(!(ns_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://www.w3.org/2001/XMLSchema", AXIS2_HASH_KEY_STRING))) { ns_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT); sprintf(ns_prefix, "q%d", (*next_ns_index)++); axutil_hash_set(namespaces, "http://www.w3.org/2001/XMLSchema", AXIS2_HASH_KEY_STRING, ns_prefix); if(parent_element) { axiom_namespace_t *element_ns = NULL; element_ns = axiom_namespace_create(env, "http://www.w3.org/2001/XMLSchema", ns_prefix); axiom_element_declare_namespace_assume_param_ownership(parent_element, env, element_ns); } } /* now we will set the xsi:type="ns:type" value */ if(!parent_tag_closed && !tag_closed) { text_value = axutil_strcat(env, xsi_prefix, ":type=", ns_prefix, ":", _lang_type0->current_value, NULL); axutil_stream_write(stream, env, text_value, axutil_strlen(text_value)); AXIS2_FREE(env->allocator, text_value); } else { /* otherwise set it to the prarent itself */ axiom_namespace_t *ns1 = NULL; axiom_attribute_t *attrib = NULL; ns1 = axiom_namespace_create (env, "http://www.w3.org/2001/XMLSchema-instance", xsi_prefix); text_value = axutil_strcat(env, ns_prefix, ":", _lang_type0->current_value, NULL); attrib = axiom_attribute_create (env, "type", text_value, ns1); axiom_element_add_attribute (parent_element, env, attrib, parent); AXIS2_FREE(env->allocator, text_value); } } } if(!parent_tag_closed && !tag_closed) { text_value = ">"; axutil_stream_write(stream, env, text_value, axutil_strlen(text_value)); } text_value = adb_lang_type0_serialize_to_string(_lang_type0, env, namespaces); if(text_value) { axutil_stream_write(stream, env, text_value, axutil_strlen(text_value)); AXIS2_FREE(env->allocator, text_value); } return parent; }
axiom_node_t* AXIS2_CALL adb_getServicesResponse_serialize( adb_getServicesResponse_t* _getServicesResponse, const axutil_env_t *env, axiom_node_t *parent, axiom_element_t *parent_element, int parent_tag_closed, axutil_hash_t *namespaces, int *next_ns_index) { axis2_char_t *string_to_stream; axiom_node_t *current_node = NULL; int tag_closed = 0; axiom_namespace_t *ns1 = NULL; axis2_char_t *qname_uri = NULL; axis2_char_t *qname_prefix = NULL; axis2_char_t *p_prefix = NULL; axis2_bool_t ns_already_defined; int i = 0; int count = 0; void *element = NULL; axis2_char_t text_value_1[64]; axis2_char_t *start_input_str = NULL; axis2_char_t *end_input_str = NULL; unsigned int start_input_str_len = 0; unsigned int end_input_str_len = 0; axiom_data_source_t *data_source = NULL; axutil_stream_t *stream = NULL; AXIS2_ENV_CHECK(env, NULL); AXIS2_PARAM_CHECK(env->error, _getServicesResponse, NULL); current_node = parent; data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, env); if (!data_source) return NULL; stream = axiom_data_source_get_stream(data_source, env); /* assume parent is of type data source */ if (!stream) return NULL; if(!parent_tag_closed) { string_to_stream = ">"; axutil_stream_write(stream, env, string_to_stream, axutil_strlen(string_to_stream)); tag_closed = 1; } p_prefix = NULL; if (!_getServicesResponse->is_valid_service) { /* no need to complain for minoccurs=0 element */ } else { start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (4 + axutil_strlen(p_prefix) + axutil_strlen("service"))); /* axutil_strlen("<:>") + 1 = 4 */ end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (5 + axutil_strlen(p_prefix) + axutil_strlen("service"))); /* axutil_strlen("</:>") + 1 = 5 */ /* * Parsing service array */ if (_getServicesResponse->property_service != NULL) { sprintf(start_input_str, "<%s%sservice", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); start_input_str_len = axutil_strlen(start_input_str); sprintf(end_input_str, "</%s%sservice>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); end_input_str_len = axutil_strlen(end_input_str); count = axutil_array_list_size(_getServicesResponse->property_service, env); for(i = 0; i < count; i ++) { element = axutil_array_list_get(_getServicesResponse->property_service, env, i); if(NULL == element) { continue; } /* * parsing service element */ if(!adb_service_is_particle()) { axutil_stream_write(stream, env, start_input_str, start_input_str_len); } adb_service_serialize((adb_service_t*)element, env, current_node, parent_element, adb_service_is_particle() || AXIS2_FALSE, namespaces, next_ns_index); if(!adb_service_is_particle()) { axutil_stream_write(stream, env, end_input_str, end_input_str_len); } } } AXIS2_FREE(env->allocator,start_input_str); AXIS2_FREE(env->allocator,end_input_str); } return parent; }
axiom_node_t* AXIS2_CALL axis2_MarketInfo_serialize( axis2_MarketInfo_t* MarketInfo, const axutil_env_t *env, axiom_node_t* parent, int has_parent) { axiom_namespace_t *ns1 = NULL; axis2_char_t text_value_1[64]; axis2_char_t text_value_2[64]; axis2_char_t text_value_3[64]; axis2_char_t text_value_4[64]; axiom_node_t *current_node = NULL; /*axiom_element_t *current_element = NULL;*/ axiom_data_source_t *data_source = NULL; axutil_stream_t *stream = NULL; axis2_char_t *start_input_str = NULL; axis2_char_t *end_input_str = NULL; unsigned int start_input_str_len = 0; unsigned int end_input_str_len = 0; AXIS2_ENV_CHECK(env, NULL); ns1 = axiom_namespace_create (env, "http://www.wso2.org/types", "ns1"); if(has_parent) { data_source = axiom_node_get_data_element(parent, env); if (!data_source) return NULL; stream = axiom_data_source_get_stream(data_source, env); /* assume parent is of type data source */ if (!stream) return NULL; current_node = parent; } else { data_source = axiom_data_source_create(env, parent, ¤t_node); stream = axiom_data_source_get_stream(data_source, env); } /** * parsing totalTraded element */ start_input_str = "<ns1:totalTraded>"; start_input_str_len = axutil_strlen(start_input_str); end_input_str = "</ns1:totalTraded>"; end_input_str_len = axutil_strlen(end_input_str); sprintf ( text_value_1, "%f", MarketInfo->attrib_totalTraded ); axutil_stream_write(stream, env, start_input_str, start_input_str_len); axutil_stream_write(stream, env, text_value_1, axutil_strlen(text_value_1)); axutil_stream_write(stream, env, end_input_str, end_input_str_len); /** * parsing avgPrice element */ start_input_str = "<ns1:avgPrice>"; start_input_str_len = axutil_strlen(start_input_str); end_input_str = "</ns1:avgPrice>"; end_input_str_len = axutil_strlen(end_input_str); sprintf ( text_value_2, "%f", MarketInfo->attrib_avgPrice ); axutil_stream_write(stream, env, start_input_str, start_input_str_len); axutil_stream_write(stream, env, text_value_2, axutil_strlen(text_value_2)); axutil_stream_write(stream, env, end_input_str, end_input_str_len); /** * parsing avgPriceOfTrade element */ start_input_str = "<ns1:avgPriceOfTrade>"; start_input_str_len = axutil_strlen(start_input_str); end_input_str = "</ns1:avgPriceOfTrade>"; end_input_str_len = axutil_strlen(end_input_str); sprintf ( text_value_3, "%f", MarketInfo->attrib_avgPriceOfTrade ); axutil_stream_write(stream, env, start_input_str, start_input_str_len); axutil_stream_write(stream, env, text_value_3, axutil_strlen(text_value_3)); axutil_stream_write(stream, env, end_input_str, end_input_str_len); /** * parsing marketCap element */ start_input_str = "<ns1:marketCap>"; start_input_str_len = axutil_strlen(start_input_str); end_input_str = "</ns1:marketCap>"; end_input_str_len = axutil_strlen(end_input_str); sprintf ( text_value_4, "%f", MarketInfo->attrib_marketCap ); axutil_stream_write(stream, env, start_input_str, start_input_str_len); axutil_stream_write(stream, env, text_value_4, axutil_strlen(text_value_4)); axutil_stream_write(stream, env, end_input_str, end_input_str_len); return parent; }
axiom_node_t* AXIS2_CALL adb_OperationMetaDataWrapper_serialize_obj( adb_OperationMetaDataWrapper_t* _OperationMetaDataWrapper, const axutil_env_t *env, axiom_node_t *parent, axiom_element_t *parent_element, int parent_tag_closed, axutil_hash_t *namespaces, int *next_ns_index) { axis2_char_t *string_to_stream; axiom_node_t* current_node = NULL; int tag_closed = 0; axis2_char_t* xsi_prefix = NULL; axis2_char_t* type_attrib = NULL; axiom_namespace_t* xsi_ns = NULL; axiom_attribute_t* xsi_type_attri = NULL; axiom_namespace_t *ns1 = NULL; axis2_char_t *qname_uri = NULL; axis2_char_t *qname_prefix = NULL; axis2_char_t *p_prefix = NULL; axis2_bool_t ns_already_defined; int i = 0; int count = 0; void *element = NULL; axis2_char_t text_value_1[ADB_DEFAULT_DIGIT_LIMIT]; axis2_char_t text_value_2[ADB_DEFAULT_DIGIT_LIMIT]; axis2_char_t *start_input_str = NULL; axis2_char_t *end_input_str = NULL; unsigned int start_input_str_len = 0; unsigned int end_input_str_len = 0; axiom_data_source_t *data_source = NULL; axutil_stream_t *stream = NULL; AXIS2_ENV_CHECK(env, NULL); AXIS2_PARAM_CHECK(env->error, _OperationMetaDataWrapper, NULL); current_node = parent; data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, env); if (!data_source) return NULL; stream = axiom_data_source_get_stream(data_source, env); /* assume parent is of type data source */ if (!stream) return NULL; if(!parent_tag_closed) { if(!(xsi_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://www.w3.org/2001/XMLSchema-instance", AXIS2_HASH_KEY_STRING))) { /* it is better to stick with the standard prefix */ xsi_prefix = (axis2_char_t*)axutil_strdup(env, "xsi"); axutil_hash_set(namespaces, "http://www.w3.org/2001/XMLSchema-instance", AXIS2_HASH_KEY_STRING, xsi_prefix); if(parent_element) { axiom_namespace_t *element_ns = NULL; element_ns = axiom_namespace_create(env, "http://www.w3.org/2001/XMLSchema-instance", xsi_prefix); axiom_element_declare_namespace_assume_param_ownership(parent_element, env, element_ns); } } type_attrib = axutil_strcat(env, " ", xsi_prefix, ":type=\"OperationMetaDataWrapper\"", NULL); axutil_stream_write(stream, env, type_attrib, axutil_strlen(type_attrib)); AXIS2_FREE(env->allocator, type_attrib); string_to_stream = ">"; axutil_stream_write(stream, env, string_to_stream, axutil_strlen(string_to_stream)); tag_closed = 1; } else { /* if the parent tag closed we would be able to declare the type directly on the parent element */ if(!(xsi_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://www.w3.org/2001/XMLSchema-instance", AXIS2_HASH_KEY_STRING))) { /* it is better to stick with the standard prefix */ xsi_prefix = (axis2_char_t*)axutil_strdup(env, "xsi"); axutil_hash_set(namespaces, "http://www.w3.org/2001/XMLSchema-instance", AXIS2_HASH_KEY_STRING, xsi_prefix); if(parent_element) { axiom_namespace_t *element_ns = NULL; element_ns = axiom_namespace_create(env, "http://www.w3.org/2001/XMLSchema-instance", xsi_prefix); axiom_element_declare_namespace_assume_param_ownership(parent_element, env, element_ns); } } } xsi_ns = axiom_namespace_create (env, "http://mgt.operation.carbon.wso2.org/xsd", xsi_prefix); xsi_type_attri = axiom_attribute_create (env, "type", "OperationMetaDataWrapper", xsi_ns); axiom_element_add_attribute (parent_element, env, xsi_type_attri, parent); if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://mgt.operation.carbon.wso2.org/xsd", AXIS2_HASH_KEY_STRING))) { p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT); sprintf(p_prefix, "n%d", (*next_ns_index)++); axutil_hash_set(namespaces, "http://mgt.operation.carbon.wso2.org/xsd", AXIS2_HASH_KEY_STRING, p_prefix); axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env, "http://mgt.operation.carbon.wso2.org/xsd", p_prefix)); } if (!_OperationMetaDataWrapper->is_valid_controlOperations) { /* no need to complain for minoccurs=0 element */ } else { start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (4 + axutil_strlen(p_prefix) + axutil_strlen("controlOperations"))); /* axutil_strlen("<:>") + 1 = 4 */ end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (5 + axutil_strlen(p_prefix) + axutil_strlen("controlOperations"))); /* axutil_strlen("</:>") + 1 = 5 */ /* * Parsing controlOperations array */ if (_OperationMetaDataWrapper->property_controlOperations != NULL) { sprintf(start_input_str, "<%s%scontrolOperations", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); start_input_str_len = axutil_strlen(start_input_str); sprintf(end_input_str, "</%s%scontrolOperations>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); end_input_str_len = axutil_strlen(end_input_str); count = axutil_array_list_size(_OperationMetaDataWrapper->property_controlOperations, env); for(i = 0; i < count; i ++) { element = axutil_array_list_get(_OperationMetaDataWrapper->property_controlOperations, env, i); if(NULL == element) { continue; } /* * parsing controlOperations element */ if(!adb_OperationMetaData_is_particle()) { axutil_stream_write(stream, env, start_input_str, start_input_str_len); } adb_OperationMetaData_serialize((adb_OperationMetaData_t*)element, env, current_node, parent_element, adb_OperationMetaData_is_particle() || AXIS2_FALSE, namespaces, next_ns_index); if(!adb_OperationMetaData_is_particle()) { axutil_stream_write(stream, env, end_input_str, end_input_str_len); } } } AXIS2_FREE(env->allocator,start_input_str); AXIS2_FREE(env->allocator,end_input_str); } if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://mgt.operation.carbon.wso2.org/xsd", AXIS2_HASH_KEY_STRING))) { p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT); sprintf(p_prefix, "n%d", (*next_ns_index)++); axutil_hash_set(namespaces, "http://mgt.operation.carbon.wso2.org/xsd", AXIS2_HASH_KEY_STRING, p_prefix); axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env, "http://mgt.operation.carbon.wso2.org/xsd", p_prefix)); } if (!_OperationMetaDataWrapper->is_valid_publishedOperations) { /* no need to complain for minoccurs=0 element */ } else { start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (4 + axutil_strlen(p_prefix) + axutil_strlen("publishedOperations"))); /* axutil_strlen("<:>") + 1 = 4 */ end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (5 + axutil_strlen(p_prefix) + axutil_strlen("publishedOperations"))); /* axutil_strlen("</:>") + 1 = 5 */ /* * Parsing publishedOperations array */ if (_OperationMetaDataWrapper->property_publishedOperations != NULL) { sprintf(start_input_str, "<%s%spublishedOperations", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); start_input_str_len = axutil_strlen(start_input_str); sprintf(end_input_str, "</%s%spublishedOperations>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); end_input_str_len = axutil_strlen(end_input_str); count = axutil_array_list_size(_OperationMetaDataWrapper->property_publishedOperations, env); for(i = 0; i < count; i ++) { element = axutil_array_list_get(_OperationMetaDataWrapper->property_publishedOperations, env, i); if(NULL == element) { continue; } /* * parsing publishedOperations element */ if(!adb_OperationMetaData_is_particle()) { axutil_stream_write(stream, env, start_input_str, start_input_str_len); } adb_OperationMetaData_serialize((adb_OperationMetaData_t*)element, env, current_node, parent_element, adb_OperationMetaData_is_particle() || AXIS2_FALSE, namespaces, next_ns_index); if(!adb_OperationMetaData_is_particle()) { axutil_stream_write(stream, env, end_input_str, end_input_str_len); } } } AXIS2_FREE(env->allocator,start_input_str); AXIS2_FREE(env->allocator,end_input_str); } return parent; }
axiom_node_t* AXIS2_CALL adb_sample_type0_serialize_obj( adb_sample_type0_t* _sample_type0, const axutil_env_t *env, axiom_node_t *parent, axiom_element_t *parent_element, int parent_tag_closed, axutil_hash_t *namespaces, int *next_ns_index) { axiom_attribute_t *text_attri = NULL; axis2_char_t *string_to_stream; axiom_node_t* current_node = NULL; int tag_closed = 0; axis2_char_t* xsi_prefix = NULL; axiom_namespace_t* xsi_ns = NULL; axiom_attribute_t* xsi_type_attri = NULL; axis2_char_t* type_attrib = NULL; axiom_namespace_t *ns1 = NULL; axis2_char_t *qname_uri = NULL; axis2_char_t *qname_prefix = NULL; axis2_char_t *p_prefix = NULL; axis2_bool_t ns_already_defined; axis2_char_t *text_value_1; axis2_char_t *text_value_1_temp; axis2_char_t *text_value = NULL; axiom_data_source_t *data_source = NULL; axutil_stream_t *stream = NULL; AXIS2_ENV_CHECK(env, NULL); AXIS2_PARAM_CHECK(env->error, _sample_type0, NULL); current_node = parent; data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, env); if (!data_source) return NULL; stream = axiom_data_source_get_stream(data_source, env); /* assume parent is of type data source */ if (!stream) return NULL; if(!parent_tag_closed) { if(_sample_type0->is_valid_id) { p_prefix = NULL; text_value = (axis2_char_t*) AXIS2_MALLOC (env-> allocator, sizeof (axis2_char_t) * (5 + ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT + axutil_strlen(_sample_type0->property_id) + axutil_strlen("id"))); sprintf(text_value, " %s%s%s=\"%s\"", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":"", "id", _sample_type0->property_id); axutil_stream_write(stream, env, text_value, axutil_strlen(text_value)); AXIS2_FREE(env-> allocator, text_value); } else { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Nil value found in non-optional attribute id"); return NULL; } string_to_stream = ">"; axutil_stream_write(stream, env, string_to_stream, axutil_strlen(string_to_stream)); tag_closed = 1; } if(parent_tag_closed) { if(_sample_type0->is_valid_id) { p_prefix = NULL; ns1 = NULL; text_value = _sample_type0->property_id; text_attri = axiom_attribute_create (env, "id", text_value, ns1); axiom_element_add_attribute (parent_element, env, text_attri, parent); } else { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Nil value found in non-optional attribute id"); return NULL; } } return parent; }
axiom_node_t* AXIS2_CALL adb_Exception_serialize_obj( adb_Exception_t* _Exception, const axutil_env_t *env, axiom_node_t *parent, axiom_element_t *parent_element, int parent_tag_closed, axutil_hash_t *namespaces, int *next_ns_index) { axis2_char_t *string_to_stream; axiom_node_t* current_node = NULL; int tag_closed = 0; axis2_char_t* xsi_prefix = NULL; axis2_char_t* type_attrib = NULL; axiom_namespace_t* xsi_ns = NULL; axiom_attribute_t* xsi_type_attri = NULL; axiom_namespace_t *ns1 = NULL; axis2_char_t *qname_uri = NULL; axis2_char_t *qname_prefix = NULL; axis2_char_t *p_prefix = NULL; axis2_bool_t ns_already_defined; axis2_char_t *text_value_1; axis2_char_t *text_value_1_temp; axis2_char_t *start_input_str = NULL; axis2_char_t *end_input_str = NULL; unsigned int start_input_str_len = 0; unsigned int end_input_str_len = 0; axiom_data_source_t *data_source = NULL; axutil_stream_t *stream = NULL; AXIS2_ENV_CHECK(env, NULL); AXIS2_PARAM_CHECK(env->error, _Exception, NULL); current_node = parent; data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, env); if (!data_source) return NULL; stream = axiom_data_source_get_stream(data_source, env); /* assume parent is of type data source */ if (!stream) return NULL; if(!parent_tag_closed) { if(!(xsi_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://www.w3.org/2001/XMLSchema-instance", AXIS2_HASH_KEY_STRING))) { /* it is better to stick with the standard prefix */ xsi_prefix = (axis2_char_t*)axutil_strdup(env, "xsi"); axutil_hash_set(namespaces, "http://www.w3.org/2001/XMLSchema-instance", AXIS2_HASH_KEY_STRING, xsi_prefix); if(parent_element) { axiom_namespace_t *element_ns = NULL; element_ns = axiom_namespace_create(env, "http://www.w3.org/2001/XMLSchema-instance", xsi_prefix); axiom_element_declare_namespace_assume_param_ownership(parent_element, env, element_ns); } } type_attrib = axutil_strcat(env, " ", xsi_prefix, ":type=\"Exception\"", NULL); axutil_stream_write(stream, env, type_attrib, axutil_strlen(type_attrib)); AXIS2_FREE(env->allocator, type_attrib); string_to_stream = ">"; axutil_stream_write(stream, env, string_to_stream, axutil_strlen(string_to_stream)); tag_closed = 1; } else { /* if the parent tag closed we would be able to declare the type directly on the parent element */ if(!(xsi_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://www.w3.org/2001/XMLSchema-instance", AXIS2_HASH_KEY_STRING))) { /* it is better to stick with the standard prefix */ xsi_prefix = (axis2_char_t*)axutil_strdup(env, "xsi"); axutil_hash_set(namespaces, "http://www.w3.org/2001/XMLSchema-instance", AXIS2_HASH_KEY_STRING, xsi_prefix); if(parent_element) { axiom_namespace_t *element_ns = NULL; element_ns = axiom_namespace_create(env, "http://www.w3.org/2001/XMLSchema-instance", xsi_prefix); axiom_element_declare_namespace_assume_param_ownership(parent_element, env, element_ns); } } } xsi_ns = axiom_namespace_create (env, "http://services.resource.ui.mgt.registry.carbon.wso2.org", xsi_prefix); xsi_type_attri = axiom_attribute_create (env, "type", "Exception", xsi_ns); axiom_element_add_attribute (parent_element, env, xsi_type_attri, parent); if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://services.resource.ui.mgt.registry.carbon.wso2.org", AXIS2_HASH_KEY_STRING))) { p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT); sprintf(p_prefix, "n%d", (*next_ns_index)++); axutil_hash_set(namespaces, "http://services.resource.ui.mgt.registry.carbon.wso2.org", AXIS2_HASH_KEY_STRING, p_prefix); axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env, "http://services.resource.ui.mgt.registry.carbon.wso2.org", p_prefix)); } if (!_Exception->is_valid_Exception) { /* no need to complain for minoccurs=0 element */ } else { start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (4 + axutil_strlen(p_prefix) + axutil_strlen("Exception"))); /* axutil_strlen("<:>") + 1 = 4 */ end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (5 + axutil_strlen(p_prefix) + axutil_strlen("Exception"))); /* axutil_strlen("</:>") + 1 = 5 */ /* * parsing Exception element */ sprintf(start_input_str, "<%s%sException>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); start_input_str_len = axutil_strlen(start_input_str); sprintf(end_input_str, "</%s%sException>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); end_input_str_len = axutil_strlen(end_input_str); text_value_1 = axiom_node_to_string(_Exception->property_Exception, env); axutil_stream_write(stream, env, start_input_str, start_input_str_len); axutil_stream_write(stream, env, text_value_1, axutil_strlen(text_value_1)); axutil_stream_write(stream, env, end_input_str, end_input_str_len); AXIS2_FREE(env->allocator,start_input_str); AXIS2_FREE(env->allocator,end_input_str); } return parent; }
axiom_node_t* AXIS2_CALL adb_audio_type0_serialize_obj( adb_audio_type0_t* _audio_type0, const axutil_env_t *env, axiom_node_t *parent, axiom_element_t *parent_element, int parent_tag_closed, axutil_hash_t *namespaces, int *next_ns_index) { axiom_attribute_t *text_attri = NULL; axis2_char_t *string_to_stream; axiom_node_t* current_node = NULL; int tag_closed = 0; axis2_char_t* xsi_prefix = NULL; axiom_namespace_t* xsi_ns = NULL; axiom_attribute_t* xsi_type_attri = NULL; axis2_char_t* type_attrib = NULL; axiom_namespace_t *ns1 = NULL; axis2_char_t *qname_uri = NULL; axis2_char_t *qname_prefix = NULL; axis2_char_t *p_prefix = NULL; axis2_bool_t ns_already_defined; axis2_char_t *text_value_1; axis2_char_t *text_value_1_temp; axis2_char_t text_value_2[ADB_DEFAULT_DIGIT_LIMIT]; axis2_char_t text_value_3[ADB_DEFAULT_DIGIT_LIMIT]; axis2_char_t text_value_4[ADB_DEFAULT_DIGIT_LIMIT]; axis2_char_t *text_value = NULL; axiom_data_source_t *data_source = NULL; axutil_stream_t *stream = NULL; AXIS2_ENV_CHECK(env, NULL); AXIS2_PARAM_CHECK(env->error, _audio_type0, NULL); current_node = parent; data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, env); if (!data_source) return NULL; stream = axiom_data_source_get_stream(data_source, env); /* assume parent is of type data source */ if (!stream) return NULL; if(!parent_tag_closed) { if(_audio_type0->is_valid_uri) { p_prefix = NULL; text_value = axutil_uri_to_string(_audio_type0->property_uri, env, AXIS2_URI_UNP_OMITUSERINFO); string_to_stream = (axis2_char_t*) AXIS2_MALLOC (env-> allocator, sizeof (axis2_char_t) * (5 + ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT + axutil_strlen(text_value) + axutil_strlen("uri"))); sprintf(string_to_stream, " %s%s%s=\"%s\"", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":"", "uri", text_value); axutil_stream_write(stream, env, string_to_stream, axutil_strlen(string_to_stream)); AXIS2_FREE(env-> allocator, string_to_stream); } else { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Nil value found in non-optional attribute uri"); return NULL; } if(_audio_type0->is_valid_rangeBegin) { p_prefix = NULL; text_value = (axis2_char_t*) AXIS2_MALLOC (env-> allocator, sizeof (axis2_char_t) * (ADB_DEFAULT_DIGIT_LIMIT + 5 + ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT + axutil_strlen("rangeBegin"))); sprintf(text_value, " %s%s%s=\"" AXIS2_PRINTF_INT64_FORMAT_SPECIFIER "\"", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":"", "rangeBegin", _audio_type0->property_rangeBegin); axutil_stream_write(stream, env, text_value, axutil_strlen(text_value)); AXIS2_FREE(env-> allocator, text_value); } if(_audio_type0->is_valid_rangeEnd) { p_prefix = NULL; text_value = (axis2_char_t*) AXIS2_MALLOC (env-> allocator, sizeof (axis2_char_t) * (ADB_DEFAULT_DIGIT_LIMIT + 5 + ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT + axutil_strlen("rangeEnd"))); sprintf(text_value, " %s%s%s=\"" AXIS2_PRINTF_INT64_FORMAT_SPECIFIER "\"", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":"", "rangeEnd", _audio_type0->property_rangeEnd); axutil_stream_write(stream, env, text_value, axutil_strlen(text_value)); AXIS2_FREE(env-> allocator, text_value); } if(_audio_type0->is_valid_size) { p_prefix = NULL; text_value = (axis2_char_t*) AXIS2_MALLOC (env-> allocator, sizeof (axis2_char_t) * (ADB_DEFAULT_DIGIT_LIMIT + 5 + ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT + axutil_strlen("size"))); sprintf(text_value, " %s%s%s=\"" AXIS2_PRINTF_INT64_FORMAT_SPECIFIER "\"", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":"", "size", _audio_type0->property_size); axutil_stream_write(stream, env, text_value, axutil_strlen(text_value)); AXIS2_FREE(env-> allocator, text_value); } string_to_stream = ">"; axutil_stream_write(stream, env, string_to_stream, axutil_strlen(string_to_stream)); tag_closed = 1; } if(parent_tag_closed) { if(_audio_type0->is_valid_uri) { p_prefix = NULL; ns1 = NULL; text_value = axutil_uri_to_string(_audio_type0->property_uri, env, AXIS2_URI_UNP_OMITUSERINFO); text_attri = axiom_attribute_create (env, "uri", text_value, ns1); axiom_element_add_attribute (parent_element, env, text_attri, parent); } else { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Nil value found in non-optional attribute uri"); return NULL; } } if(parent_tag_closed) { if(_audio_type0->is_valid_rangeBegin) { p_prefix = NULL; ns1 = NULL; text_value = (axis2_char_t*) AXIS2_MALLOC (env-> allocator, sizeof (axis2_char_t) * ADB_DEFAULT_DIGIT_LIMIT); sprintf (text_value, AXIS2_PRINTF_INT64_FORMAT_SPECIFIER, (int64_t)_audio_type0->property_rangeBegin); text_attri = axiom_attribute_create (env, "rangeBegin", text_value, ns1); axiom_element_add_attribute (parent_element, env, text_attri, parent); AXIS2_FREE(env-> allocator, text_value); } } if(parent_tag_closed) { if(_audio_type0->is_valid_rangeEnd) { p_prefix = NULL; ns1 = NULL; text_value = (axis2_char_t*) AXIS2_MALLOC (env-> allocator, sizeof (axis2_char_t) * ADB_DEFAULT_DIGIT_LIMIT); sprintf (text_value, AXIS2_PRINTF_INT64_FORMAT_SPECIFIER, (int64_t)_audio_type0->property_rangeEnd); text_attri = axiom_attribute_create (env, "rangeEnd", text_value, ns1); axiom_element_add_attribute (parent_element, env, text_attri, parent); AXIS2_FREE(env-> allocator, text_value); } } if(parent_tag_closed) { if(_audio_type0->is_valid_size) { p_prefix = NULL; ns1 = NULL; text_value = (axis2_char_t*) AXIS2_MALLOC (env-> allocator, sizeof (axis2_char_t) * ADB_DEFAULT_DIGIT_LIMIT); sprintf (text_value, AXIS2_PRINTF_INT64_FORMAT_SPECIFIER, (int64_t)_audio_type0->property_size); text_attri = axiom_attribute_create (env, "size", text_value, ns1); axiom_element_add_attribute (parent_element, env, text_attri, parent); AXIS2_FREE(env-> allocator, text_value); } } return parent; }
axiom_node_t* AXIS2_CALL adb_CanonicalizationMethodType_serialize_obj( adb_CanonicalizationMethodType_t* _CanonicalizationMethodType, const axutil_env_t *env, axiom_node_t *parent, axiom_element_t *parent_element, int parent_tag_closed, axutil_hash_t *namespaces, int *next_ns_index) { axiom_attribute_t *text_attri = NULL; axis2_char_t *string_to_stream; axiom_node_t* current_node = NULL; int tag_closed = 0; axis2_char_t* xsi_prefix = NULL; axiom_namespace_t* xsi_ns = NULL; axiom_attribute_t* xsi_type_attri = NULL; axis2_char_t* type_attrib = NULL; axiom_namespace_t *ns1 = NULL; axis2_char_t *qname_uri = NULL; axis2_char_t *qname_prefix = NULL; axis2_char_t *p_prefix = NULL; axis2_bool_t ns_already_defined; int i = 0; int count = 0; void *element = NULL; axis2_char_t *text_value_1; axis2_char_t *text_value_1_temp; axis2_char_t *text_value_2; axis2_char_t *text_value_2_temp; axis2_char_t *text_value = NULL; axis2_char_t *start_input_str = NULL; axis2_char_t *end_input_str = NULL; unsigned int start_input_str_len = 0; unsigned int end_input_str_len = 0; axiom_data_source_t *data_source = NULL; axutil_stream_t *stream = NULL; AXIS2_ENV_CHECK(env, NULL); AXIS2_PARAM_CHECK(env->error, _CanonicalizationMethodType, NULL); current_node = parent; data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, env); if (!data_source) return NULL; stream = axiom_data_source_get_stream(data_source, env); /* assume parent is of type data source */ if (!stream) return NULL; if(!parent_tag_closed) { if(_CanonicalizationMethodType->is_valid_Algorithm) { p_prefix = NULL; text_value = axutil_uri_to_string(_CanonicalizationMethodType->property_Algorithm, env, AXIS2_URI_UNP_OMITUSERINFO); string_to_stream = (axis2_char_t*) AXIS2_MALLOC (env-> allocator, sizeof (axis2_char_t) * (5 + ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT + axutil_strlen(text_value) + axutil_strlen("Algorithm"))); sprintf(string_to_stream, " %s%s%s=\"%s\"", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":"", "Algorithm", text_value); axutil_stream_write(stream, env, string_to_stream, axutil_strlen(string_to_stream)); AXIS2_FREE(env-> allocator, string_to_stream); } else { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Nil value found in non-optional attribute Algorithm"); return NULL; } string_to_stream = ">"; axutil_stream_write(stream, env, string_to_stream, axutil_strlen(string_to_stream)); tag_closed = 1; } p_prefix = NULL; if (!_CanonicalizationMethodType->is_valid_extraElement) { /* no need to complain for minoccurs=0 element */ } else { start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (4 + axutil_strlen(p_prefix) + axutil_strlen("extraElement"))); /* axutil_strlen("<:>") + 1 = 4 */ end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (5 + axutil_strlen(p_prefix) + axutil_strlen("extraElement"))); /* axutil_strlen("</:>") + 1 = 5 */ /* * Parsing extraElement array */ if (_CanonicalizationMethodType->property_extraElement != NULL) { sprintf(start_input_str, "<%s%sextraElement>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); start_input_str_len = axutil_strlen(start_input_str); sprintf(end_input_str, "</%s%sextraElement>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); end_input_str_len = axutil_strlen(end_input_str); count = axutil_array_list_size(_CanonicalizationMethodType->property_extraElement, env); for(i = 0; i < count; i ++) { element = axutil_array_list_get(_CanonicalizationMethodType->property_extraElement, env, i); if(NULL == element) { continue; } /* * parsing extraElement element */ text_value_1 = axiom_node_to_string((axiom_node_t*)element, env); axutil_stream_write(stream, env, text_value_1, axutil_strlen(text_value_1)); } } AXIS2_FREE(env->allocator,start_input_str); AXIS2_FREE(env->allocator,end_input_str); } if(parent_tag_closed) { if(_CanonicalizationMethodType->is_valid_Algorithm) { p_prefix = NULL; ns1 = NULL; text_value = axutil_uri_to_string(_CanonicalizationMethodType->property_Algorithm, env, AXIS2_URI_UNP_OMITUSERINFO); text_attri = axiom_attribute_create (env, "Algorithm", text_value, ns1); axiom_element_add_attribute (parent_element, env, text_attri, parent); } else { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Nil value found in non-optional attribute Algorithm"); return NULL; } } return parent; }
axiom_node_t* AXIS2_CALL axis2_buyResponse_serialize( axis2_buyResponse_t* buyResponse, const axutil_env_t *env, axiom_node_t* parent, int has_parent) { axiom_namespace_t *ns1 = NULL; /*axis2_char_t text_value_1[64];*/ axiom_node_t *current_node = NULL; axiom_element_t *current_element = NULL; axiom_data_source_t *data_source = NULL; axutil_stream_t *stream = NULL; axis2_char_t *start_input_str = NULL; axis2_char_t *end_input_str = NULL; unsigned int start_input_str_len = 0; unsigned int end_input_str_len = 0; AXIS2_ENV_CHECK(env, NULL); ns1 = axiom_namespace_create (env, "http://www.wso2.org/types", "ns1"); if( parent == NULL) { current_element = axiom_element_create (env, parent, "buyResponse", ns1 , ¤t_node); axiom_element_set_namespace( current_element, env, ns1, current_node); parent = current_node; } if(has_parent) { data_source = axiom_node_get_data_element(parent, env); if (!data_source) return NULL; stream = axiom_data_source_get_stream(data_source, env); /* assume parent is of type data source */ if (!stream) return NULL; current_node = parent; } else { data_source = axiom_data_source_create(env, parent, ¤t_node); stream = axiom_data_source_get_stream(data_source, env); } /** * parsing trade_status element */ start_input_str = "<ns1:trade_status xmlns:ns1=\"http://www.wso2.org/types\">"; start_input_str_len = axutil_strlen(start_input_str); end_input_str = "</ns1:trade_status>"; end_input_str_len = axutil_strlen(end_input_str); axutil_stream_write(stream, env, start_input_str, start_input_str_len); axis2_TradeStatus_serialize( buyResponse->attrib_trade_status, env, current_node, AXIS2_TRUE); axutil_stream_write(stream, env, end_input_str, end_input_str_len); return parent; }
axiom_node_t* AXIS2_CALL adb_listExternalUsersResponse_serialize_obj( adb_listExternalUsersResponse_t* _listExternalUsersResponse, const axutil_env_t *env, axiom_node_t *parent, axiom_element_t *parent_element, int parent_tag_closed, axutil_hash_t *namespaces, int *next_ns_index) { axiom_node_t* current_node = NULL; int tag_closed = 0; axiom_namespace_t *ns1 = NULL; axis2_char_t *qname_uri = NULL; axis2_char_t *qname_prefix = NULL; axis2_char_t *p_prefix = NULL; axis2_bool_t ns_already_defined; int i = 0; int count = 0; void *element = NULL; axis2_char_t *text_value_1; axis2_char_t *text_value_1_temp; axis2_char_t *start_input_str = NULL; axis2_char_t *end_input_str = NULL; unsigned int start_input_str_len = 0; unsigned int end_input_str_len = 0; axiom_data_source_t *data_source = NULL; axutil_stream_t *stream = NULL; int next_ns_index_value = 0; AXIS2_ENV_CHECK(env, NULL); AXIS2_PARAM_CHECK(env->error, _listExternalUsersResponse, NULL); namespaces = axutil_hash_make(env); next_ns_index = &next_ns_index_value; ns1 = axiom_namespace_create (env, "http://service.mgt.user.carbon.wso2.org", "n"); axutil_hash_set(namespaces, "http://service.mgt.user.carbon.wso2.org", AXIS2_HASH_KEY_STRING, axutil_strdup(env, "n")); parent_element = axiom_element_create (env, NULL, "listExternalUsersResponse", ns1 , &parent); axiom_element_set_namespace(parent_element, env, ns1, parent); data_source = axiom_data_source_create(env, parent, ¤t_node); stream = axiom_data_source_get_stream(data_source, env); if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://service.mgt.user.carbon.wso2.org", AXIS2_HASH_KEY_STRING))) { p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT); sprintf(p_prefix, "n%d", (*next_ns_index)++); axutil_hash_set(namespaces, "http://service.mgt.user.carbon.wso2.org", AXIS2_HASH_KEY_STRING, p_prefix); axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env, "http://service.mgt.user.carbon.wso2.org", p_prefix)); } if (!_listExternalUsersResponse->is_valid_return) { /* no need to complain for minoccurs=0 element */ } else { start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (4 + axutil_strlen(p_prefix) + axutil_strlen("return"))); /* axutil_strlen("<:>") + 1 = 4 */ end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (5 + axutil_strlen(p_prefix) + axutil_strlen("return"))); /* axutil_strlen("</:>") + 1 = 5 */ /* * Parsing return array */ if (_listExternalUsersResponse->property_return != NULL) { sprintf(start_input_str, "<%s%sreturn>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); start_input_str_len = axutil_strlen(start_input_str); sprintf(end_input_str, "</%s%sreturn>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); end_input_str_len = axutil_strlen(end_input_str); count = axutil_array_list_size(_listExternalUsersResponse->property_return, env); for(i = 0; i < count; i ++) { element = axutil_array_list_get(_listExternalUsersResponse->property_return, env, i); if(NULL == element) { continue; } /* * parsing return element */ text_value_1 = (axis2_char_t*)element; axutil_stream_write(stream, env, start_input_str, start_input_str_len); text_value_1_temp = axutil_xml_quote_string(env, text_value_1, AXIS2_TRUE); if (text_value_1_temp) { axutil_stream_write(stream, env, text_value_1_temp, axutil_strlen(text_value_1_temp)); AXIS2_FREE(env->allocator, text_value_1_temp); } else { axutil_stream_write(stream, env, text_value_1, axutil_strlen(text_value_1)); } axutil_stream_write(stream, env, end_input_str, end_input_str_len); } } AXIS2_FREE(env->allocator,start_input_str); AXIS2_FREE(env->allocator,end_input_str); } if(namespaces) { axutil_hash_index_t *hi; void *val; for (hi = axutil_hash_first(namespaces, env); hi; hi = axutil_hash_next(env, hi)) { axutil_hash_this(hi, NULL, NULL, &val); AXIS2_FREE(env->allocator, val); } axutil_hash_free(namespaces, env); } return parent; }
axiom_node_t* AXIS2_CALL adb_service_type0_serialize_obj( adb_service_type0_t* _service_type0, const axutil_env_t *env, axiom_node_t *parent, axiom_element_t *parent_element, int parent_tag_closed, axutil_hash_t *namespaces, int *next_ns_index) { axiom_attribute_t *text_attri = NULL; axis2_char_t *string_to_stream; axiom_node_t* current_node = NULL; int tag_closed = 0; axis2_char_t* xsi_prefix = NULL; axiom_namespace_t* xsi_ns = NULL; axiom_attribute_t* xsi_type_attri = NULL; axis2_char_t* type_attrib = NULL; axiom_namespace_t *ns1 = NULL; axis2_char_t *qname_uri = NULL; axis2_char_t *qname_prefix = NULL; axis2_char_t *p_prefix = NULL; axis2_bool_t ns_already_defined; axis2_char_t text_value_1[ADB_DEFAULT_DIGIT_LIMIT]; axis2_char_t *text_value_2; axis2_char_t *text_value_2_temp; axis2_char_t *text_value = NULL; axis2_char_t *start_input_str = NULL; axis2_char_t *end_input_str = NULL; unsigned int start_input_str_len = 0; unsigned int end_input_str_len = 0; axiom_data_source_t *data_source = NULL; axutil_stream_t *stream = NULL; AXIS2_ENV_CHECK(env, NULL); AXIS2_PARAM_CHECK(env->error, _service_type0, NULL); current_node = parent; data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, env); if (!data_source) return NULL; stream = axiom_data_source_get_stream(data_source, env); /* assume parent is of type data source */ if (!stream) return NULL; if(!parent_tag_closed) { if(_service_type0->is_valid_id) { p_prefix = NULL; text_value = (axis2_char_t*) AXIS2_MALLOC (env-> allocator, sizeof (axis2_char_t) * (5 + ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT + axutil_strlen(_service_type0->property_id) + axutil_strlen("id"))); sprintf(text_value, " %s%s%s=\"%s\"", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":"", "id", _service_type0->property_id); axutil_stream_write(stream, env, text_value, axutil_strlen(text_value)); AXIS2_FREE(env-> allocator, text_value); } else { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Nil value found in non-optional attribute id"); return NULL; } string_to_stream = ">"; axutil_stream_write(stream, env, string_to_stream, axutil_strlen(string_to_stream)); tag_closed = 1; } if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://www.daisy.org/ns/daisy-online/", AXIS2_HASH_KEY_STRING))) { p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT); sprintf(p_prefix, "n%d", (*next_ns_index)++); axutil_hash_set(namespaces, "http://www.daisy.org/ns/daisy-online/", AXIS2_HASH_KEY_STRING, p_prefix); axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env, "http://www.daisy.org/ns/daisy-online/", p_prefix)); } if (!_service_type0->is_valid_label) { /* no need to complain for minoccurs=0 element */ } else { start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (4 + axutil_strlen(p_prefix) + axutil_strlen("label"))); /* axutil_strlen("<:>") + 1 = 4 */ end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (5 + axutil_strlen(p_prefix) + axutil_strlen("label"))); /* axutil_strlen("</:>") + 1 = 5 */ /* * parsing label element */ sprintf(start_input_str, "<%s%slabel", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); start_input_str_len = axutil_strlen(start_input_str); sprintf(end_input_str, "</%s%slabel>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); end_input_str_len = axutil_strlen(end_input_str); if(!adb_label_type0_is_particle()) { axutil_stream_write(stream, env, start_input_str, start_input_str_len); } adb_label_type0_serialize(_service_type0->property_label, env, current_node, parent_element, adb_label_type0_is_particle() || AXIS2_FALSE, namespaces, next_ns_index); if(!adb_label_type0_is_particle()) { axutil_stream_write(stream, env, end_input_str, end_input_str_len); } AXIS2_FREE(env->allocator,start_input_str); AXIS2_FREE(env->allocator,end_input_str); } if(parent_tag_closed) { if(_service_type0->is_valid_id) { p_prefix = NULL; ns1 = NULL; text_value = _service_type0->property_id; text_attri = axiom_attribute_create (env, "id", text_value, ns1); axiom_element_add_attribute (parent_element, env, text_attri, parent); } else { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Nil value found in non-optional attribute id"); return NULL; } } return parent; }
axiom_node_t* AXIS2_CALL adb_CipherReference_serialize_obj( adb_CipherReference_t* _CipherReference, const axutil_env_t *env, axiom_node_t *parent, axiom_element_t *parent_element, int parent_tag_closed, axutil_hash_t *namespaces, int *next_ns_index) { axiom_node_t* current_node = NULL; int tag_closed = 0; axis2_char_t* xsi_prefix = NULL; axiom_namespace_t* xsi_ns = NULL; axiom_attribute_t* xsi_type_attri = NULL; axiom_namespace_t *ns1 = NULL; axis2_char_t *qname_uri = NULL; axis2_char_t *qname_prefix = NULL; axis2_char_t *p_prefix = NULL; axis2_bool_t ns_already_defined; axis2_char_t text_value_1[ADB_DEFAULT_DIGIT_LIMIT]; axis2_char_t *start_input_str = NULL; axis2_char_t *end_input_str = NULL; unsigned int start_input_str_len = 0; unsigned int end_input_str_len = 0; axiom_data_source_t *data_source = NULL; axutil_stream_t *stream = NULL; int next_ns_index_value = 0; AXIS2_ENV_CHECK(env, NULL); AXIS2_PARAM_CHECK(env->error, _CipherReference, NULL); namespaces = axutil_hash_make(env); next_ns_index = &next_ns_index_value; ns1 = axiom_namespace_create (env, "http://www.w3.org/2001/04/xmlenc#", "n"); axutil_hash_set(namespaces, "http://www.w3.org/2001/04/xmlenc#", AXIS2_HASH_KEY_STRING, axutil_strdup(env, "n")); parent_element = axiom_element_create (env, NULL, "CipherReference", ns1 , &parent); axiom_element_set_namespace(parent_element, env, ns1, parent); data_source = axiom_data_source_create(env, parent, ¤t_node); stream = axiom_data_source_get_stream(data_source, env); if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://www.w3.org/2001/04/xmlenc#", AXIS2_HASH_KEY_STRING))) { p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT); sprintf(p_prefix, "n%d", (*next_ns_index)++); axutil_hash_set(namespaces, "http://www.w3.org/2001/04/xmlenc#", AXIS2_HASH_KEY_STRING, p_prefix); axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env, "http://www.w3.org/2001/04/xmlenc#", p_prefix)); } if (!_CipherReference->is_valid_CipherReference) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Nil value found in non-nillable property CipherReference"); return NULL; } else { start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (4 + axutil_strlen(p_prefix) + axutil_strlen("CipherReference"))); /* axutil_strlen("<:>") + 1 = 4 */ end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (5 + axutil_strlen(p_prefix) + axutil_strlen("CipherReference"))); /* axutil_strlen("</:>") + 1 = 5 */ /* * parsing CipherReference element */ sprintf(start_input_str, "<%s%sCipherReference", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); start_input_str_len = axutil_strlen(start_input_str); sprintf(end_input_str, "</%s%sCipherReference>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); end_input_str_len = axutil_strlen(end_input_str); adb_CipherReferenceType_serialize(_CipherReference->property_CipherReference, env, current_node, parent_element, adb_CipherReferenceType_is_particle() || AXIS2_TRUE, namespaces, next_ns_index); AXIS2_FREE(env->allocator,start_input_str); AXIS2_FREE(env->allocator,end_input_str); } if(namespaces) { axutil_hash_index_t *hi; void *val; for (hi = axutil_hash_first(namespaces, env); hi; hi = axutil_hash_next(env, hi)) { axutil_hash_this(hi, NULL, NULL, &val); AXIS2_FREE(env->allocator, val); } axutil_hash_free(namespaces, env); } return parent; }
axiom_node_t* AXIS2_CALL adb_hiliteContentSequence_type0_serialize_obj( adb_hiliteContentSequence_type0_t* _hiliteContentSequence_type0, const axutil_env_t *env, axiom_node_t *parent, axiom_element_t *parent_element, int parent_tag_closed, axutil_hash_t *namespaces, int *next_ns_index) { axis2_char_t *string_to_stream; axiom_node_t* current_node = NULL; int tag_closed = 0; axis2_char_t* xsi_prefix = NULL; axiom_namespace_t* xsi_ns = NULL; axiom_attribute_t* xsi_type_attri = NULL; axis2_char_t* type_attrib = NULL; axiom_namespace_t *ns1 = NULL; axis2_char_t *qname_uri = NULL; axis2_char_t *qname_prefix = NULL; axis2_char_t *p_prefix = NULL; axis2_bool_t ns_already_defined; axis2_char_t *text_value_1; axis2_char_t *text_value_1_temp; axis2_char_t text_value_2[ADB_DEFAULT_DIGIT_LIMIT]; axis2_char_t *start_input_str = NULL; axis2_char_t *end_input_str = NULL; unsigned int start_input_str_len = 0; unsigned int end_input_str_len = 0; axiom_data_source_t *data_source = NULL; axutil_stream_t *stream = NULL; AXIS2_ENV_CHECK(env, NULL); AXIS2_PARAM_CHECK(env->error, _hiliteContentSequence_type0, NULL); current_node = parent; data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, env); if (!data_source) return NULL; stream = axiom_data_source_get_stream(data_source, env); /* assume parent is of type data source */ if (!stream) return NULL; if(!parent_tag_closed) { string_to_stream = ">"; axutil_stream_write(stream, env, string_to_stream, axutil_strlen(string_to_stream)); tag_closed = 1; } if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://www.daisy.org/z3986/2005/bookmark/", AXIS2_HASH_KEY_STRING))) { p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT); sprintf(p_prefix, "n%d", (*next_ns_index)++); axutil_hash_set(namespaces, "http://www.daisy.org/z3986/2005/bookmark/", AXIS2_HASH_KEY_STRING, p_prefix); axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env, "http://www.daisy.org/z3986/2005/bookmark/", p_prefix)); } if (!_hiliteContentSequence_type0->is_valid_timeOffset) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Nil value found in non-nillable property timeOffset"); return NULL; } else { start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (4 + axutil_strlen(p_prefix) + axutil_strlen("timeOffset"))); /* axutil_strlen("<:>") + 1 = 4 */ end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (5 + axutil_strlen(p_prefix) + axutil_strlen("timeOffset"))); /* axutil_strlen("</:>") + 1 = 5 */ /* * parsing timeOffset element */ sprintf(start_input_str, "<%s%stimeOffset>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); start_input_str_len = axutil_strlen(start_input_str); sprintf(end_input_str, "</%s%stimeOffset>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); end_input_str_len = axutil_strlen(end_input_str); text_value_1 = _hiliteContentSequence_type0->property_timeOffset; axutil_stream_write(stream, env, start_input_str, start_input_str_len); text_value_1_temp = axutil_xml_quote_string(env, text_value_1, AXIS2_TRUE); if (text_value_1_temp) { axutil_stream_write(stream, env, text_value_1_temp, axutil_strlen(text_value_1_temp)); AXIS2_FREE(env->allocator, text_value_1_temp); } else { axutil_stream_write(stream, env, text_value_1, axutil_strlen(text_value_1)); } axutil_stream_write(stream, env, end_input_str, end_input_str_len); AXIS2_FREE(env->allocator,start_input_str); AXIS2_FREE(env->allocator,end_input_str); } if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://www.daisy.org/z3986/2005/bookmark/", AXIS2_HASH_KEY_STRING))) { p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT); sprintf(p_prefix, "n%d", (*next_ns_index)++); axutil_hash_set(namespaces, "http://www.daisy.org/z3986/2005/bookmark/", AXIS2_HASH_KEY_STRING, p_prefix); axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env, "http://www.daisy.org/z3986/2005/bookmark/", p_prefix)); } if (!_hiliteContentSequence_type0->is_valid_charOffset) { /* no need to complain for minoccurs=0 element */ } else { start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (4 + axutil_strlen(p_prefix) + axutil_strlen("charOffset"))); /* axutil_strlen("<:>") + 1 = 4 */ end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (5 + axutil_strlen(p_prefix) + axutil_strlen("charOffset"))); /* axutil_strlen("</:>") + 1 = 5 */ /* * parsing charOffset element */ sprintf(start_input_str, "<%s%scharOffset>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); start_input_str_len = axutil_strlen(start_input_str); sprintf(end_input_str, "</%s%scharOffset>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); end_input_str_len = axutil_strlen(end_input_str); sprintf (text_value_2, AXIS2_PRINTF_INT64_FORMAT_SPECIFIER, (int64_t) _hiliteContentSequence_type0->property_charOffset); axutil_stream_write(stream, env, start_input_str, start_input_str_len); axutil_stream_write(stream, env, text_value_2, axutil_strlen(text_value_2)); axutil_stream_write(stream, env, end_input_str, end_input_str_len); AXIS2_FREE(env->allocator,start_input_str); AXIS2_FREE(env->allocator,end_input_str); } return parent; }
axiom_node_t* AXIS2_CALL adb_UAKType_serialize_obj( adb_UAKType_t* _UAKType, const axutil_env_t *env, axiom_node_t *parent, axiom_element_t *parent_element, int parent_tag_closed, axutil_hash_t *namespaces, int *next_ns_index) { axiom_attribute_t *text_attri = NULL; axis2_char_t *string_to_stream; axiom_node_t* current_node = NULL; int tag_closed = 0; axis2_char_t* xsi_prefix = NULL; axiom_namespace_t* xsi_ns = NULL; axiom_attribute_t* xsi_type_attri = NULL; axis2_char_t* type_attrib = NULL; axiom_data_source_t *data_source = NULL; axutil_stream_t *stream = NULL; axis2_char_t *text_value; axiom_namespace_t *ns1 = NULL; axis2_char_t *p_prefix = NULL; current_node = parent; data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, env); if (!data_source) return NULL; stream = axiom_data_source_get_stream(data_source, env); /* assume parent is of type data source */ if (!stream) return NULL; if(!parent_tag_closed) { if(_UAKType->is_valid_issuerID) { p_prefix = NULL; text_value = (axis2_char_t*) AXIS2_MALLOC (env-> allocator, sizeof (axis2_char_t) * (5 + ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT + axutil_strlen(_UAKType->property_issuerID) + axutil_strlen("issuerID"))); sprintf(text_value, " %s%s%s=\"%s\"", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":"", "issuerID", _UAKType->property_issuerID); axutil_stream_write(stream, env, text_value, axutil_strlen(text_value)); AXIS2_FREE(env-> allocator, text_value); } else { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Nil value found in non-optional attribute issuerID"); return NULL; } if(_UAKType->is_valid_collectionID) { p_prefix = NULL; text_value = (axis2_char_t*) AXIS2_MALLOC (env-> allocator, sizeof (axis2_char_t) * (5 + ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT + axutil_strlen(_UAKType->property_collectionID) + axutil_strlen("collectionID"))); sprintf(text_value, " %s%s%s=\"%s\"", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":"", "collectionID", _UAKType->property_collectionID); axutil_stream_write(stream, env, text_value, axutil_strlen(text_value)); AXIS2_FREE(env-> allocator, text_value); } else { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Nil value found in non-optional attribute collectionID"); return NULL; } string_to_stream = ">"; axutil_stream_write(stream, env, string_to_stream, axutil_strlen(string_to_stream)); tag_closed = 1; } if(!parent_tag_closed && !tag_closed) { text_value = ">"; axutil_stream_write(stream, env, text_value, axutil_strlen(text_value)); } text_value = adb_UAKType_serialize_to_string(_UAKType, env, namespaces); if(text_value) { axutil_stream_write(stream, env, text_value, axutil_strlen(text_value)); AXIS2_FREE(env->allocator, text_value); } if(parent_tag_closed) { if(_UAKType->is_valid_issuerID) { p_prefix = NULL; ns1 = NULL; text_value = _UAKType->property_issuerID; text_attri = axiom_attribute_create (env, "issuerID", text_value, ns1); axiom_element_add_attribute (parent_element, env, text_attri, parent); } else { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Nil value found in non-optional attribute issuerID"); return NULL; } } if(parent_tag_closed) { if(_UAKType->is_valid_collectionID) { p_prefix = NULL; ns1 = NULL; text_value = _UAKType->property_collectionID; text_attri = axiom_attribute_create (env, "collectionID", text_value, ns1); axiom_element_add_attribute (parent_element, env, text_attri, parent); } else { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Nil value found in non-optional attribute collectionID"); return NULL; } } return parent; }
axiom_node_t* AXIS2_CALL adb_SnakeException_serialize( adb_SnakeException_t* _SnakeException, const axutil_env_t *env, axiom_node_t *parent, axiom_element_t *parent_element, int parent_tag_closed, axutil_hash_t *namespaces, int *next_ns_index) { axis2_char_t *string_to_stream; axiom_node_t *current_node = NULL; int tag_closed = 0; axiom_namespace_t *ns1 = NULL; axis2_char_t *qname_uri = NULL; axis2_char_t *qname_prefix = NULL; axis2_char_t *p_prefix = NULL; axis2_bool_t ns_already_defined; axis2_char_t *text_value_1; axis2_char_t *text_value_1_temp; axis2_char_t *start_input_str = NULL; axis2_char_t *end_input_str = NULL; unsigned int start_input_str_len = 0; unsigned int end_input_str_len = 0; axiom_data_source_t *data_source = NULL; axutil_stream_t *stream = NULL; AXIS2_ENV_CHECK(env, NULL); AXIS2_PARAM_CHECK(env->error, _SnakeException, NULL); current_node = parent; data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, env); if (!data_source) return NULL; stream = axiom_data_source_get_stream(data_source, env); /* assume parent is of type data source */ if (!stream) return NULL; if(!parent_tag_closed) { string_to_stream = ">"; axutil_stream_write(stream, env, string_to_stream, axutil_strlen(string_to_stream)); tag_closed = 1; } p_prefix = NULL; if (!_SnakeException->is_valid_message) { /* no need to complain for minoccurs=0 element */ } else { start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (4 + axutil_strlen(p_prefix) + axutil_strlen("message"))); /* axutil_strlen("<:>") + 1 = 4 */ end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (5 + axutil_strlen(p_prefix) + axutil_strlen("message"))); /* axutil_strlen("</:>") + 1 = 5 */ /* * parsing message element */ sprintf(start_input_str, "<%s%smessage>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); start_input_str_len = axutil_strlen(start_input_str); sprintf(end_input_str, "</%s%smessage>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); end_input_str_len = axutil_strlen(end_input_str); text_value_1 = _SnakeException->property_message; axutil_stream_write(stream, env, start_input_str, start_input_str_len); text_value_1_temp = axutil_xml_quote_string(env, text_value_1, AXIS2_TRUE); if (text_value_1_temp) { axutil_stream_write(stream, env, text_value_1_temp, axutil_strlen(text_value_1_temp)); AXIS2_FREE(env->allocator, text_value_1_temp); } else { axutil_stream_write(stream, env, text_value_1, axutil_strlen(text_value_1)); } axutil_stream_write(stream, env, end_input_str, end_input_str_len); AXIS2_FREE(env->allocator,start_input_str); AXIS2_FREE(env->allocator,end_input_str); } return parent; }
axiom_node_t* AXIS2_CALL prf_logOnResponseType_serialize_obj( prf_logOnResponseType_t* _logOnResponseType, const axutil_env_t *env, axiom_node_t *parent, axiom_element_t *parent_element, int parent_tag_closed, axutil_hash_t *namespaces, int *next_ns_index) { axis2_char_t *string_to_stream; axiom_node_t* current_node = NULL; int tag_closed = 0; axis2_char_t* xsi_prefix = NULL; axiom_namespace_t* xsi_ns = NULL; axiom_attribute_t* xsi_type_attri = NULL; axis2_char_t* type_attrib = NULL; axiom_namespace_t *ns1 = NULL; axis2_char_t *qname_uri = NULL; axis2_char_t *qname_prefix = NULL; axis2_char_t *p_prefix = NULL; axis2_bool_t ns_already_defined; axis2_char_t text_value_1[PRF_DEFAULT_DIGIT_LIMIT]; axis2_char_t *start_input_str = NULL; axis2_char_t *end_input_str = NULL; unsigned int start_input_str_len = 0; unsigned int end_input_str_len = 0; axiom_data_source_t *data_source = NULL; axutil_stream_t *stream = NULL; AXIS2_ENV_CHECK(env, NULL); AXIS2_PARAM_CHECK(env->error, _logOnResponseType, NULL); current_node = parent; data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, env); if (!data_source) return NULL; stream = axiom_data_source_get_stream(data_source, env); /* assume parent is of type data source */ if (!stream) return NULL; if(!parent_tag_closed) { if(!(xsi_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://www.w3.org/2001/XMLSchema-instance", AXIS2_HASH_KEY_STRING))) { /* it is better to stick with the standard prefix */ xsi_prefix = (axis2_char_t*)axutil_strdup(env, "xsi"); axutil_hash_set(namespaces, "http://www.w3.org/2001/XMLSchema-instance", AXIS2_HASH_KEY_STRING, xsi_prefix); if(parent_element) { axiom_namespace_t *element_ns = NULL; element_ns = axiom_namespace_create(env, "http://www.w3.org/2001/XMLSchema-instance", xsi_prefix); axiom_element_declare_namespace_assume_param_ownership(parent_element, env, element_ns); if(element_ns) { axiom_namespace_free(element_ns, env); } } } type_attrib = axutil_strcat(env, " ", xsi_prefix, ":type=\"logOnResponseType\"", NULL); axutil_stream_write(stream, env, type_attrib, axutil_strlen(type_attrib)); AXIS2_FREE(env->allocator, type_attrib); string_to_stream = ">"; axutil_stream_write(stream, env, string_to_stream, axutil_strlen(string_to_stream)); tag_closed = 1; } else { /* if the parent tag closed we would be able to declare the type directly on the parent element */ if(!(xsi_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://www.w3.org/2001/XMLSchema-instance", AXIS2_HASH_KEY_STRING))) { /* it is better to stick with the standard prefix */ xsi_prefix = (axis2_char_t*)axutil_strdup(env, "xsi"); axutil_hash_set(namespaces, "http://www.w3.org/2001/XMLSchema-instance", AXIS2_HASH_KEY_STRING, xsi_prefix); if(parent_element) { axiom_namespace_t *element_ns = NULL; element_ns = axiom_namespace_create(env, "http://www.w3.org/2001/XMLSchema-instance", xsi_prefix); axiom_element_declare_namespace_assume_param_ownership(parent_element, env, element_ns); if(element_ns) { axiom_namespace_free(element_ns, env); } } } } xsi_ns = axiom_namespace_create (env, "http://www.pratsam.org/ns/profile/", xsi_prefix); xsi_type_attri = axiom_attribute_create (env, "type", "logOnResponseType", xsi_ns); axiom_element_add_attribute (parent_element, env, xsi_type_attri, parent); if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://www.pratsam.org/ns/profile/", AXIS2_HASH_KEY_STRING))) { p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * PRF_DEFAULT_NAMESPACE_PREFIX_LIMIT); sprintf(p_prefix, "n%d", (*next_ns_index)++); axutil_hash_set(namespaces, "http://www.pratsam.org/ns/profile/", AXIS2_HASH_KEY_STRING, p_prefix); axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env, "http://www.pratsam.org/ns/profile/", p_prefix)); } if (!_logOnResponseType->is_valid_logOnResult) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Nil value found in non-nillable property logOnResult"); return NULL; } else { start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (4 + axutil_strlen(p_prefix) + axutil_strlen("logOnResult"))); /* axutil_strlen("<:>") + 1 = 4 */ end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (5 + axutil_strlen(p_prefix) + axutil_strlen("logOnResult"))); /* axutil_strlen("</:>") + 1 = 5 */ /* * parsing logOnResult element */ sprintf(start_input_str, "<%s%slogOnResult>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); start_input_str_len = axutil_strlen(start_input_str); sprintf(end_input_str, "</%s%slogOnResult>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); end_input_str_len = axutil_strlen(end_input_str); strcpy(text_value_1, (_logOnResponseType->property_logOnResult)?"true":"false"); axutil_stream_write(stream, env, start_input_str, start_input_str_len); axutil_stream_write(stream, env, text_value_1, axutil_strlen(text_value_1)); axutil_stream_write(stream, env, end_input_str, end_input_str_len); AXIS2_FREE(env->allocator,start_input_str); AXIS2_FREE(env->allocator,end_input_str); } return parent; }
axiom_node_t* AXIS2_CALL adb_TransformsType_serialize_obj( adb_TransformsType_t* _TransformsType, const axutil_env_t *env, axiom_node_t *parent, axiom_element_t *parent_element, int parent_tag_closed, axutil_hash_t *namespaces, int *next_ns_index) { axis2_char_t *string_to_stream; axiom_node_t* current_node = NULL; int tag_closed = 0; axis2_char_t* xsi_prefix = NULL; axiom_namespace_t* xsi_ns = NULL; axiom_attribute_t* xsi_type_attri = NULL; axis2_char_t* type_attrib = NULL; axiom_namespace_t *ns1 = NULL; axis2_char_t *qname_uri = NULL; axis2_char_t *qname_prefix = NULL; axis2_char_t *p_prefix = NULL; axis2_bool_t ns_already_defined; int i = 0; int count = 0; void *element = NULL; axis2_char_t text_value_1[ADB_DEFAULT_DIGIT_LIMIT]; axis2_char_t *start_input_str = NULL; axis2_char_t *end_input_str = NULL; unsigned int start_input_str_len = 0; unsigned int end_input_str_len = 0; axiom_data_source_t *data_source = NULL; axutil_stream_t *stream = NULL; AXIS2_ENV_CHECK(env, NULL); AXIS2_PARAM_CHECK(env->error, _TransformsType, NULL); current_node = parent; data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, env); if (!data_source) return NULL; stream = axiom_data_source_get_stream(data_source, env); /* assume parent is of type data source */ if (!stream) return NULL; if(!parent_tag_closed) { string_to_stream = ">"; axutil_stream_write(stream, env, string_to_stream, axutil_strlen(string_to_stream)); tag_closed = 1; } if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://www.w3.org/2000/09/xmldsig#", AXIS2_HASH_KEY_STRING))) { p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT); sprintf(p_prefix, "n%d", (*next_ns_index)++); axutil_hash_set(namespaces, "http://www.w3.org/2000/09/xmldsig#", AXIS2_HASH_KEY_STRING, p_prefix); axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env, "http://www.w3.org/2000/09/xmldsig#", p_prefix)); } if (!_TransformsType->is_valid_Transform) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Nil value found in non-nillable property Transform"); return NULL; } else { start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (4 + axutil_strlen(p_prefix) + axutil_strlen("Transform"))); /* axutil_strlen("<:>") + 1 = 4 */ end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (5 + axutil_strlen(p_prefix) + axutil_strlen("Transform"))); /* axutil_strlen("</:>") + 1 = 5 */ /* * Parsing Transform array */ if (_TransformsType->property_Transform != NULL) { sprintf(start_input_str, "<%s%sTransform", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); start_input_str_len = axutil_strlen(start_input_str); sprintf(end_input_str, "</%s%sTransform>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); end_input_str_len = axutil_strlen(end_input_str); count = axutil_array_list_size(_TransformsType->property_Transform, env); for(i = 0; i < count; i ++) { element = axutil_array_list_get(_TransformsType->property_Transform, env, i); if(NULL == element) { continue; } /* * parsing Transform element */ if(!adb_TransformType_is_particle()) { axutil_stream_write(stream, env, start_input_str, start_input_str_len); } adb_TransformType_serialize((adb_TransformType_t*)element, env, current_node, parent_element, adb_TransformType_is_particle() || AXIS2_FALSE, namespaces, next_ns_index); if(!adb_TransformType_is_particle()) { axutil_stream_write(stream, env, end_input_str, end_input_str_len); } } } AXIS2_FREE(env->allocator,start_input_str); AXIS2_FREE(env->allocator,end_input_str); } return parent; }
axiom_node_t* AXIS2_CALL adb_getOperationRequestCount_serialize_obj( adb_getOperationRequestCount_t* _getOperationRequestCount, const axutil_env_t *env, axiom_node_t *parent, axiom_element_t *parent_element, int parent_tag_closed, axutil_hash_t *namespaces, int *next_ns_index) { axiom_node_t* current_node = NULL; int tag_closed = 0; axiom_namespace_t *ns1 = NULL; axis2_char_t *qname_uri = NULL; axis2_char_t *qname_prefix = NULL; axis2_char_t *p_prefix = NULL; axis2_bool_t ns_already_defined; axis2_char_t *text_value_1; axis2_char_t *text_value_1_temp; axis2_char_t *text_value_2; axis2_char_t *text_value_2_temp; axis2_char_t *start_input_str = NULL; axis2_char_t *end_input_str = NULL; unsigned int start_input_str_len = 0; unsigned int end_input_str_len = 0; axiom_data_source_t *data_source = NULL; axutil_stream_t *stream = NULL; int next_ns_index_value = 0; AXIS2_ENV_CHECK(env, NULL); AXIS2_PARAM_CHECK(env->error, _getOperationRequestCount, NULL); namespaces = axutil_hash_make(env); next_ns_index = &next_ns_index_value; ns1 = axiom_namespace_create (env, "http://org.apache.axis2/xsd", "n"); axutil_hash_set(namespaces, "http://org.apache.axis2/xsd", AXIS2_HASH_KEY_STRING, axutil_strdup(env, "n")); parent_element = axiom_element_create (env, NULL, "getOperationRequestCount", ns1 , &parent); axiom_element_set_namespace(parent_element, env, ns1, parent); data_source = axiom_data_source_create(env, parent, ¤t_node); stream = axiom_data_source_get_stream(data_source, env); if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://org.apache.axis2/xsd", AXIS2_HASH_KEY_STRING))) { p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT); sprintf(p_prefix, "n%d", (*next_ns_index)++); axutil_hash_set(namespaces, "http://org.apache.axis2/xsd", AXIS2_HASH_KEY_STRING, p_prefix); axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env, "http://org.apache.axis2/xsd", p_prefix)); } if (!_getOperationRequestCount->is_valid_serviceName) { /* no need to complain for minoccurs=0 element */ } else { start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (4 + axutil_strlen(p_prefix) + axutil_strlen("serviceName"))); /* axutil_strlen("<:>") + 1 = 4 */ end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (5 + axutil_strlen(p_prefix) + axutil_strlen("serviceName"))); /* axutil_strlen("</:>") + 1 = 5 */ /* * parsing serviceName element */ sprintf(start_input_str, "<%s%sserviceName>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); start_input_str_len = axutil_strlen(start_input_str); sprintf(end_input_str, "</%s%sserviceName>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); end_input_str_len = axutil_strlen(end_input_str); text_value_1 = _getOperationRequestCount->property_serviceName; axutil_stream_write(stream, env, start_input_str, start_input_str_len); text_value_1_temp = axutil_xml_quote_string(env, text_value_1, AXIS2_TRUE); if (text_value_1_temp) { axutil_stream_write(stream, env, text_value_1_temp, axutil_strlen(text_value_1_temp)); AXIS2_FREE(env->allocator, text_value_1_temp); } else { axutil_stream_write(stream, env, text_value_1, axutil_strlen(text_value_1)); } axutil_stream_write(stream, env, end_input_str, end_input_str_len); AXIS2_FREE(env->allocator,start_input_str); AXIS2_FREE(env->allocator,end_input_str); } if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://org.apache.axis2/xsd", AXIS2_HASH_KEY_STRING))) { p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT); sprintf(p_prefix, "n%d", (*next_ns_index)++); axutil_hash_set(namespaces, "http://org.apache.axis2/xsd", AXIS2_HASH_KEY_STRING, p_prefix); axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env, "http://org.apache.axis2/xsd", p_prefix)); } if (!_getOperationRequestCount->is_valid_operationName) { /* no need to complain for minoccurs=0 element */ } else { start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (4 + axutil_strlen(p_prefix) + axutil_strlen("operationName"))); /* axutil_strlen("<:>") + 1 = 4 */ end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (5 + axutil_strlen(p_prefix) + axutil_strlen("operationName"))); /* axutil_strlen("</:>") + 1 = 5 */ /* * parsing operationName element */ sprintf(start_input_str, "<%s%soperationName>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); start_input_str_len = axutil_strlen(start_input_str); sprintf(end_input_str, "</%s%soperationName>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); end_input_str_len = axutil_strlen(end_input_str); text_value_2 = _getOperationRequestCount->property_operationName; axutil_stream_write(stream, env, start_input_str, start_input_str_len); text_value_2_temp = axutil_xml_quote_string(env, text_value_2, AXIS2_TRUE); if (text_value_2_temp) { axutil_stream_write(stream, env, text_value_2_temp, axutil_strlen(text_value_2_temp)); AXIS2_FREE(env->allocator, text_value_2_temp); } else { axutil_stream_write(stream, env, text_value_2, axutil_strlen(text_value_2)); } axutil_stream_write(stream, env, end_input_str, end_input_str_len); AXIS2_FREE(env->allocator,start_input_str); AXIS2_FREE(env->allocator,end_input_str); } if(namespaces) { axutil_hash_index_t *hi; void *val; for (hi = axutil_hash_first(namespaces, env); hi; hi = axutil_hash_next(env, hi)) { axutil_hash_this(hi, NULL, NULL, &val); AXIS2_FREE(env->allocator, val); } axutil_hash_free(namespaces, env); } return parent; }
axiom_node_t* AXIS2_CALL adb_additionalTransferProtocols_type0_serialize_obj( adb_additionalTransferProtocols_type0_t* _additionalTransferProtocols_type0, const axutil_env_t *env, axiom_node_t *parent, axiom_element_t *parent_element, int parent_tag_closed, axutil_hash_t *namespaces, int *next_ns_index) { axis2_char_t *string_to_stream; axiom_node_t* current_node = NULL; int tag_closed = 0; axis2_char_t* xsi_prefix = NULL; axiom_namespace_t* xsi_ns = NULL; axiom_attribute_t* xsi_type_attri = NULL; axis2_char_t* type_attrib = NULL; axiom_namespace_t *ns1 = NULL; axis2_char_t *qname_uri = NULL; axis2_char_t *qname_prefix = NULL; axis2_char_t *p_prefix = NULL; axis2_bool_t ns_already_defined; int i = 0; int count = 0; void *element = NULL; axis2_char_t *text_value_1; axis2_char_t *text_value_1_temp; axis2_char_t *start_input_str = NULL; axis2_char_t *end_input_str = NULL; unsigned int start_input_str_len = 0; unsigned int end_input_str_len = 0; axiom_data_source_t *data_source = NULL; axutil_stream_t *stream = NULL; AXIS2_ENV_CHECK(env, NULL); AXIS2_PARAM_CHECK(env->error, _additionalTransferProtocols_type0, NULL); current_node = parent; data_source = (axiom_data_source_t *)axiom_node_get_data_element(current_node, env); if (!data_source) return NULL; stream = axiom_data_source_get_stream(data_source, env); /* assume parent is of type data source */ if (!stream) return NULL; if(!parent_tag_closed) { string_to_stream = ">"; axutil_stream_write(stream, env, string_to_stream, axutil_strlen(string_to_stream)); tag_closed = 1; } if(!(p_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://www.daisy.org/ns/daisy-online/", AXIS2_HASH_KEY_STRING))) { p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof (axis2_char_t) * ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT); sprintf(p_prefix, "n%d", (*next_ns_index)++); axutil_hash_set(namespaces, "http://www.daisy.org/ns/daisy-online/", AXIS2_HASH_KEY_STRING, p_prefix); axiom_element_declare_namespace_assume_param_ownership(parent_element, env, axiom_namespace_create (env, "http://www.daisy.org/ns/daisy-online/", p_prefix)); } if (!_additionalTransferProtocols_type0->is_valid_protocol) { AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Nil value found in non-nillable property protocol"); return NULL; } else { start_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (4 + axutil_strlen(p_prefix) + axutil_strlen("protocol"))); /* axutil_strlen("<:>") + 1 = 4 */ end_input_str = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) * (5 + axutil_strlen(p_prefix) + axutil_strlen("protocol"))); /* axutil_strlen("</:>") + 1 = 5 */ /* * Parsing protocol array */ if (_additionalTransferProtocols_type0->property_protocol != NULL) { sprintf(start_input_str, "<%s%sprotocol>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); start_input_str_len = axutil_strlen(start_input_str); sprintf(end_input_str, "</%s%sprotocol>", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":""); end_input_str_len = axutil_strlen(end_input_str); count = axutil_array_list_size(_additionalTransferProtocols_type0->property_protocol, env); for(i = 0; i < count; i ++) { element = axutil_array_list_get(_additionalTransferProtocols_type0->property_protocol, env, i); if(NULL == element) { continue; } /* * parsing protocol element */ text_value_1 = (axis2_char_t*)element; axutil_stream_write(stream, env, start_input_str, start_input_str_len); text_value_1_temp = axutil_xml_quote_string(env, text_value_1, AXIS2_TRUE); if (text_value_1_temp) { axutil_stream_write(stream, env, text_value_1_temp, axutil_strlen(text_value_1_temp)); AXIS2_FREE(env->allocator, text_value_1_temp); } else { axutil_stream_write(stream, env, text_value_1, axutil_strlen(text_value_1)); } axutil_stream_write(stream, env, end_input_str, end_input_str_len); } } AXIS2_FREE(env->allocator,start_input_str); AXIS2_FREE(env->allocator,end_input_str); } return parent; }