| 1 | /* | |
| 2 | * Portions of this file Copyright 1999-2005 University of Chicago | |
| 3 | * Portions of this file Copyright 1999-2005 The University of Southern California. | |
| 4 | * | |
| 5 | * This file or a portion of this file is licensed under the | |
| 6 | * terms of the Globus Toolkit Public License, found at | |
| 7 | * http://www.globus.org/toolkit/download/license.html. | |
| 8 | * If you redistribute this file, with or without | |
| 9 | * modifications, you must include this notice in the file. | |
| 10 | */ | |
| 11 | ||
| 12 | #include "xsd_anyURI.h" | |
| 13 | #include "globus_i_xsd.h" | |
| 14 | ||
| 15 | GLOBUS_I_XSD_DEFINE_QNAME(xsd, anyURI); | |
| 16 | 38452 | GLOBUS_I_XSD_DEFINE_TYPE_FUNCTIONS(xsd_anyURI); |
| 17 | GLOBUS_I_XSD_DEFINE_TYPE_INFO(xsd_anyURI); | |
| 18 | 0 | GLOBUS_I_XSD_DEFINE_INIT_CONTENTS_GENERIC(xsd_anyURI); |
| 19 | 0 | GLOBUS_I_XSD_DEFINE_LIST_SERIALIZE(xsd_anyURI, anyURI); |
| 20 | 0 | GLOBUS_I_XSD_DEFINE_LIST_DESERIALIZE(xsd_anyURI, anyURI); |
| 21 | ||
| 22 | globus_result_t | |
| 23 | xsd_anyURI_copy_contents( | |
| 24 | xsd_anyURI * dest, | |
| 25 | const xsd_anyURI * src) | |
| 26 | { | |
| 27 | 7753 | globus_result_t result = GLOBUS_SUCCESS; |
| 28 | 7753 | GlobusFuncName(xsd_anyURI_copy_contents); |
| 29 | 7753 | GlobusSoapMessageDebugEnter(); |
| 30 | ||
| 31 | 7753 | if(dest) |
| 32 | { | |
| 33 | 7753 | if(!src || !*src) |
| 34 | { | |
| 35 | 0 | *dest = NULL; |
| 36 | } | |
| 37 | else | |
| 38 | { | |
| 39 | 7753 | *dest = globus_libc_strdup(*src); |
| 40 | 7753 | if(!*dest) |
| 41 | { | |
| 42 | 0 | result = GlobusSoapMessageErrorOutOfMemory; |
| 43 | } | |
| 44 | } | |
| 45 | } | |
| 46 | ||
| 47 | 7753 | GlobusSoapMessageDebugExit(); |
| 48 | 7753 | return result; |
| 49 | } | |
| 50 | ||
| 51 | void | |
| 52 | xsd_anyURI_destroy_contents( | |
| 53 | xsd_anyURI * instance) | |
| 54 | 31500 | { |
| 55 | 31500 | GlobusFuncName(xsd_anyURI_destroy_contents); |
| 56 | 31500 | GlobusSoapMessageDebugEnter(); |
| 57 | ||
| 58 | 31500 | if(*instance) |
| 59 | { | |
| 60 | 31500 | free(*instance); |
| 61 | 31500 | *instance = NULL; |
| 62 | } | |
| 63 | ||
| 64 | 31500 | GlobusSoapMessageDebugExit(); |
| 65 | } | |
| 66 | ||
| 67 | globus_result_t | |
| 68 | xsd_anyURI_serialize_contents( | |
| 69 | xsd_QName * element_name, | |
| 70 | xsd_anyURI * instance, | |
| 71 | globus_soap_message_handle_t message_handle, | |
| 72 | globus_xsd_element_options_t options) | |
| 73 | 18962 | { |
| 74 | 18962 | globus_result_t result = GLOBUS_SUCCESS; |
| 75 | 18962 | GlobusFuncName(xsd_anyURI_serialize_contents); |
| 76 | 18962 | GlobusSoapMessageDebugEnter(); |
| 77 | ||
| 78 | /* serialize contents of type */ | |
| 79 | 18962 | result = globus_soap_message_serialize_string( |
| 80 | message_handle, instance); | |
| 81 | ||
| 82 | 18962 | GlobusSoapMessageDebugExit(); |
| 83 | 18962 | return result; |
| 84 | } | |
| 85 | ||
| 86 | globus_result_t | |
| 87 | xsd_anyURI_deserialize_contents( | |
| 88 | xsd_QName * element_qname, | |
| 89 | xsd_anyURI * instance, | |
| 90 | globus_soap_message_handle_t message_handle, | |
| 91 | globus_xsd_element_options_t options) | |
| 92 | 19438 | { |
| 93 | 19438 | globus_result_t result = GLOBUS_SUCCESS; |
| 94 | 19438 | GlobusFuncName(xsd_anyURI_deserialize_contents); |
| 95 | 19438 | GlobusSoapMessageDebugEnter(); |
| 96 | ||
| 97 | 19438 | result = globus_soap_message_deserialize_anyURI( |
| 98 | message_handle, instance); | |
| 99 | ||
| 100 | 19438 | GlobusSoapMessageDebugExit(); |
| 101 | 19438 | return result; |
| 102 | } | |
| 103 | ||
| 104 | globus_result_t | |
| 105 | xsd_anyURI_serialize_attribute( | |
| 106 | xsd_QName * element_qname, | |
| 107 | xsd_anyURI * instance, | |
| 108 | globus_soap_message_handle_t message_handle, | |
| 109 | globus_xsd_element_options_t options) | |
| 110 | 5 | { |
| 111 | 5 | globus_result_t result = GLOBUS_SUCCESS; |
| 112 | 5 | GlobusFuncName(xsd_anyURI_serialize_attribute); |
| 113 | 5 | GlobusSoapMessageDebugEnter(); |
| 114 | ||
| 115 | 5 | result = globus_soap_message_serialize_string_attribute( |
| 116 | message_handle, element_qname, instance); | |
| 117 | 5 | if(result != GLOBUS_SUCCESS) |
| 118 | { | |
| 119 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 120 | result, NULL, element_qname); | |
| 121 | goto exit; | |
| 122 | } | |
| 123 | ||
| 124 | exit: | |
| 125 | ||
| 126 | 5 | GlobusSoapMessageDebugExit(); |
| 127 | 5 | return result; |
| 128 | } | |
| 129 | ||
| 130 | globus_result_t | |
| 131 | xsd_anyURI_deserialize_attribute( | |
| 132 | xsd_QName * element_qname, | |
| 133 | xsd_anyURI * ip, | |
| 134 | globus_soap_message_handle_t message_handle, | |
| 135 | globus_xsd_element_options_t options) | |
| 136 | 0 | { |
| 137 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 138 | 0 | GlobusFuncName(xsd_anyURI_deserialize_attribute); |
| 139 | 0 | GlobusSoapMessageDebugEnter(); |
| 140 | ||
| 141 | 0 | result = globus_soap_message_deserialize_string_attribute( |
| 142 | message_handle, element_qname, ip); | |
| 143 | 0 | if(GlobusSoapMessageStatusAttributeNotFoundCheck(result)) |
| 144 | { | |
| 145 | 0 | result = GLOBUS_SUCCESS; |
| 146 | 0 | goto exit; |
| 147 | } | |
| 148 | ||
| 149 | 0 | if(result != GLOBUS_SUCCESS) |
| 150 | { | |
| 151 | 0 | goto error_exit; |
| 152 | } | |
| 153 | ||
| 154 | 0 | goto exit; |
| 155 | ||
| 156 | error_exit: | |
| 157 | ||
| 158 | 0 | GlobusSoapMessageErrorDeserializeFailed(result, element_qname); |
| 159 | ||
| 160 | exit: | |
| 161 | ||
| 162 | 0 | GlobusSoapMessageDebugExit(); |
| 163 | 0 | return result; |
| 164 | } | |
| 165 | ||
| 166 | globus_result_t | |
| 167 | xsd_anyURI_deserialize_attribute_pointer( | |
| 168 | xsd_QName * element_qname, | |
| 169 | xsd_anyURI ** ip, | |
| 170 | globus_soap_message_handle_t message_handle, | |
| 171 | globus_xsd_element_options_t options) | |
| 172 | 4 | { |
| 173 | 4 | xsd_anyURI * instance = NULL; |
| 174 | 4 | globus_result_t result = GLOBUS_SUCCESS; |
| 175 | 4 | GlobusFuncName(xsd_anyURI_deserialize_attribute_pointer); |
| 176 | 4 | GlobusSoapMessageDebugEnter(); |
| 177 | ||
| 178 | 4 | *ip = NULL; |
| 179 | ||
| 180 | 4 | result = xsd_anyURI_init(&instance); |
| 181 | ||
| 182 | 4 | if(result != GLOBUS_SUCCESS) |
| 183 | { | |
| 184 | 0 | goto error_exit; |
| 185 | } | |
| 186 | ||
| 187 | 4 | result = globus_soap_message_deserialize_string_attribute( |
| 188 | message_handle, element_qname, instance); | |
| 189 | 4 | if(GlobusSoapMessageStatusAttributeNotFoundCheck(result)) |
| 190 | { | |
| 191 | 0 | xsd_anyURI_destroy(instance); |
| 192 | 0 | result = GLOBUS_SUCCESS; |
| 193 | 0 | goto exit; |
| 194 | } | |
| 195 | ||
| 196 | 4 | if(result != GLOBUS_SUCCESS) |
| 197 | { | |
| 198 | 0 | goto error_exit; |
| 199 | } | |
| 200 | ||
| 201 | 4 | *ip = instance; |
| 202 | ||
| 203 | 4 | goto exit; |
| 204 | ||
| 205 | error_exit: | |
| 206 | ||
| 207 | 0 | GlobusSoapMessageErrorDeserializeFailed(result, element_qname); |
| 208 | ||
| 209 | exit: | |
| 210 | ||
| 211 | 4 | if(result != GLOBUS_SUCCESS && instance) |
| 212 | { | |
| 213 | 0 | xsd_anyURI_destroy(instance); |
| 214 | 0 | *ip = NULL; |
| 215 | } | |
| 216 | ||
| 217 | 4 | GlobusSoapMessageDebugExit(); |
| 218 | 4 | return result; |
| 219 | } | |
| 220 | ||
| 221 | globus_result_t | |
| 222 | xsd_anyURI_list_serialize_contents( | |
| 223 | xsd_anyURI_array * inst, | |
| 224 | globus_soap_message_handle_t message_handle, | |
| 225 | globus_xsd_element_options_t options) | |
| 226 | 0 | { |
| 227 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 228 | 0 | GlobusFuncName(xsd_anyURI_list_serialize); |
| 229 | 0 | GlobusSoapMessageDebugEnter(); |
| 230 | ||
| 231 | 0 | result = globus_soap_message_serialize_string_list( |
| 232 | message_handle, | |
| 233 | (xsd_string_array *)inst); | |
| 234 | 0 | if(result != GLOBUS_SUCCESS) |
| 235 | { | |
| 236 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 237 | result, "could not serialize as list", &xsd_anyURI_qname); | |
| 238 | goto exit; | |
| 239 | } | |
| 240 | ||
| 241 | exit: | |
| 242 | ||
| 243 | 0 | GlobusSoapMessageDebugExit(); |
| 244 | 0 | return result; |
| 245 | } | |
| 246 | ||
| 247 | globus_result_t | |
| 248 | xsd_anyURI_list_deserialize_contents( | |
| 249 | xsd_anyURI_array * ip, | |
| 250 | globus_soap_message_handle_t message_handle, | |
| 251 | globus_xsd_element_options_t options) | |
| 252 | 0 | { |
| 253 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 254 | 0 | GlobusFuncName(xsd_anyURI_list_deserialize_contents); |
| 255 | 0 | GlobusSoapMessageDebugEnter(); |
| 256 | ||
| 257 | 0 | result = globus_soap_message_deserialize_string_list( |
| 258 | message_handle, (xsd_string_array *) ip); | |
| 259 | 0 | if(result != GLOBUS_SUCCESS) |
| 260 | { | |
| 261 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 262 | result, &xsd_anyURI_qname); | |
| 263 | goto exit; | |
| 264 | } | |
| 265 | ||
| 266 | exit: | |
| 267 | ||
| 268 | 0 | GlobusSoapMessageDebugExit(); |
| 269 | 0 | return result; |
| 270 | } | |
| 271 | ||
| 272 | globus_result_t | |
| 273 | xsd_anyURI_list_serialize_attribute( | |
| 274 | xsd_QName * attr_qname, | |
| 275 | xsd_anyURI_array * inst, | |
| 276 | globus_soap_message_handle_t message_handle, | |
| 277 | globus_xsd_element_options_t options) | |
| 278 | 0 | { |
| 279 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 280 | 0 | GlobusFuncName(xsd_anyURI_list_serialize_attribute); |
| 281 | 0 | GlobusSoapMessageDebugEnter(); |
| 282 | ||
| 283 | 0 | result = globus_soap_message_serialize_string_attribute_list( |
| 284 | message_handle, attr_qname, (xsd_string_array *) inst); | |
| 285 | 0 | if(result != GLOBUS_SUCCESS) |
| 286 | { | |
| 287 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 288 | result, "could not serialize list of xsd:anyURI as attribute", | |
| 289 | &xsd_anyURI_qname); | |
| 290 | goto exit; | |
| 291 | } | |
| 292 | ||
| 293 | exit: | |
| 294 | ||
| 295 | 0 | GlobusSoapMessageDebugExit(); |
| 296 | 0 | return result; |
| 297 | } | |
| 298 | ||
| 299 | globus_result_t | |
| 300 | xsd_anyURI_list_deserialize_attribute( | |
| 301 | xsd_QName * attr_qname, | |
| 302 | xsd_anyURI_array * inst, | |
| 303 | globus_soap_message_handle_t message_handle, | |
| 304 | globus_xsd_element_options_t options) | |
| 305 | 0 | { |
| 306 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 307 | 0 | GlobusFuncName(xsd_anyURI_list_deserialize_attribute); |
| 308 | 0 | GlobusSoapMessageDebugEnter(); |
| 309 | ||
| 310 | 0 | result = globus_soap_message_deserialize_string_attribute_list( |
| 311 | message_handle, attr_qname, (xsd_string_array *) inst); | |
| 312 | 0 | if(result != GLOBUS_SUCCESS) |
| 313 | { | |
| 314 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 315 | result, &xsd_anyURI_qname); | |
| 316 | goto exit; | |
| 317 | } | |
| 318 | ||
| 319 | exit: | |
| 320 | ||
| 321 | 0 | GlobusSoapMessageDebugExit(); |
| 322 | 0 | return result; |