| 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 | ||
| 13 | /* | |
| 14 | * This file is automatically generated by the Globus WSDLtoC converter | |
| 15 | */ | |
| 16 | ||
| 17 | #include "xsd_QName.h" | |
| 18 | #include "globus_soap_message.h" | |
| 19 | #include "globus_xsd_type_info.h" | |
| 20 | #include "wsse_SecurityTokenReferenceType.h" | |
| 21 | ||
| 22 | #ifndef GLOBUS_DONT_DOCUMENT_INTERNAL | |
| 23 | xsd_QName wsse_SecurityTokenReferenceType_qname = | |
| 24 | { | |
| 25 | WSSE_SECURITYTOKENREFERENCETYPE_NS, | |
| 26 | WSSE_SECURITYTOKENREFERENCETYPE_LOCAL | |
| 27 | }; | |
| 28 | #endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */ | |
| 29 | ||
| 30 | globus_result_t | |
| 31 | wsse_SecurityTokenReferenceType_serialize_wrapper( | |
| 32 | xsd_QName * element_qname, | |
| 33 | void * instance, | |
| 34 | globus_soap_message_handle_t message_handle, | |
| 35 | globus_xsd_element_options_t options) | |
| 36 | 0 | { |
| 37 | 0 | return wsse_SecurityTokenReferenceType_serialize( |
| 38 | element_qname, | |
| 39 | (wsse_SecurityTokenReferenceType *) instance, | |
| 40 | message_handle, options); | |
| 41 | } | |
| 42 | ||
| 43 | globus_result_t | |
| 44 | wsse_SecurityTokenReferenceType_deserialize_pointer_wrapper( | |
| 45 | xsd_QName * element_qname, | |
| 46 | void ** ip, | |
| 47 | globus_soap_message_handle_t message_handle, | |
| 48 | globus_xsd_element_options_t options) | |
| 49 | 0 | { |
| 50 | 0 | return wsse_SecurityTokenReferenceType_deserialize_pointer( |
| 51 | element_qname, | |
| 52 | (wsse_SecurityTokenReferenceType **) ip, | |
| 53 | message_handle, options); | |
| 54 | } | |
| 55 | ||
| 56 | globus_result_t | |
| 57 | wsse_SecurityTokenReferenceType_init_wrapper(void **object) | |
| 58 | 0 | { |
| 59 | 0 | return wsse_SecurityTokenReferenceType_init( |
| 60 | (wsse_SecurityTokenReferenceType **) object); | |
| 61 | } | |
| 62 | ||
| 63 | void | |
| 64 | wsse_SecurityTokenReferenceType_destroy_wrapper( | |
| 65 | void * object) | |
| 66 | 0 | { |
| 67 | 0 | wsse_SecurityTokenReferenceType_destroy( |
| 68 | (wsse_SecurityTokenReferenceType *) object); | |
| 69 | } | |
| 70 | ||
| 71 | globus_result_t | |
| 72 | wsse_SecurityTokenReferenceType_copy_wrapper( | |
| 73 | void ** dest_obj, | |
| 74 | void * src_obj) | |
| 75 | 0 | { |
| 76 | 0 | return wsse_SecurityTokenReferenceType_copy( |
| 77 | (wsse_SecurityTokenReferenceType **) dest_obj, | |
| 78 | (wsse_SecurityTokenReferenceType *) src_obj); | |
| 79 | } | |
| 80 | ||
| 81 | globus_result_t | |
| 82 | wsse_SecurityTokenReferenceType_init_contents_wrapper(void *object) | |
| 83 | 0 | { |
| 84 | 0 | return wsse_SecurityTokenReferenceType_init_contents( |
| 85 | (wsse_SecurityTokenReferenceType *) object); | |
| 86 | } | |
| 87 | ||
| 88 | void | |
| 89 | wsse_SecurityTokenReferenceType_destroy_contents_wrapper( | |
| 90 | void * object) | |
| 91 | 0 | { |
| 92 | 0 | wsse_SecurityTokenReferenceType_destroy_contents( |
| 93 | (wsse_SecurityTokenReferenceType *) object); | |
| 94 | } | |
| 95 | ||
| 96 | globus_result_t | |
| 97 | wsse_SecurityTokenReferenceType_copy_contents_wrapper( | |
| 98 | void * dest_obj, | |
| 99 | void * src_obj) | |
| 100 | 0 | { |
| 101 | 0 | return wsse_SecurityTokenReferenceType_copy_contents( |
| 102 | (wsse_SecurityTokenReferenceType *) dest_obj, | |
| 103 | (wsse_SecurityTokenReferenceType *) src_obj); | |
| 104 | } | |
| 105 | ||
| 106 | globus_result_t | |
| 107 | wsse_SecurityTokenReferenceType_serialize_contents_wrapper( | |
| 108 | xsd_QName * element_qname, | |
| 109 | void * instance, | |
| 110 | globus_soap_message_handle_t message_handle, | |
| 111 | globus_xsd_element_options_t options) | |
| 112 | 0 | { |
| 113 | 0 | return wsse_SecurityTokenReferenceType_serialize_contents( |
| 114 | element_qname, | |
| 115 | (wsse_SecurityTokenReferenceType *) instance, | |
| 116 | message_handle, options); | |
| 117 | } | |
| 118 | ||
| 119 | globus_result_t | |
| 120 | wsse_SecurityTokenReferenceType_deserialize_contents_wrapper( | |
| 121 | xsd_QName * element_qname, | |
| 122 | void ** instance, | |
| 123 | globus_soap_message_handle_t message_handle, | |
| 124 | globus_xsd_element_options_t options) | |
| 125 | 0 | { |
| 126 | 0 | globus_result_t result; |
| 127 | 0 | GlobusFuncName(wsse_SecurityTokenReferenceType_deserialize_contents_wrapper); |
| 128 | 0 | GlobusSoapMessageDebugEnter(); |
| 129 | ||
| 130 | 0 | if(!*instance) |
| 131 | { | |
| 132 | 0 | result = wsse_SecurityTokenReferenceType_init( |
| 133 | (wsse_SecurityTokenReferenceType **)instance); | |
| 134 | 0 | if(result != GLOBUS_SUCCESS) |
| 135 | { | |
| 136 | 0 | goto error; |
| 137 | } | |
| 138 | } | |
| 139 | ||
| 140 | 0 | result = wsse_SecurityTokenReferenceType_deserialize_contents( |
| 141 | element_qname, | |
| 142 | *(wsse_SecurityTokenReferenceType **)instance, | |
| 143 | message_handle, options); | |
| 144 | error: | |
| 145 | 0 | GlobusSoapMessageDebugExit(); |
| 146 | 0 | return result; |
| 147 | } | |
| 148 | ||
| 149 | globus_result_t | |
| 150 | wsse_SecurityTokenReferenceType_array_serialize_wrapper( | |
| 151 | xsd_QName * element, | |
| 152 | void * instance, | |
| 153 | globus_soap_message_handle_t message, | |
| 154 | globus_xsd_element_options_t options) | |
| 155 | 0 | { |
| 156 | 0 | return wsse_SecurityTokenReferenceType_array_serialize( |
| 157 | element, | |
| 158 | (wsse_SecurityTokenReferenceType_array *) instance, | |
| 159 | message, options); | |
| 160 | } | |
| 161 | ||
| 162 | globus_result_t | |
| 163 | wsse_SecurityTokenReferenceType_array_deserialize_wrapper( | |
| 164 | xsd_QName * element_qname, | |
| 165 | void ** inst, | |
| 166 | globus_soap_message_handle_t message, | |
| 167 | globus_xsd_element_options_t options) | |
| 168 | 0 | { |
| 169 | 0 | if(!*inst) |
| 170 | { | |
| 171 | 0 | globus_result_t result; |
| 172 | ||
| 173 | 0 | result = wsse_SecurityTokenReferenceType_array_init( |
| 174 | (wsse_SecurityTokenReferenceType_array **)inst); | |
| 175 | 0 | if(result != GLOBUS_SUCCESS) |
| 176 | { | |
| 177 | 0 | return result; |
| 178 | } | |
| 179 | } | |
| 180 | ||
| 181 | 0 | return wsse_SecurityTokenReferenceType_array_deserialize( |
| 182 | element_qname, | |
| 183 | *(wsse_SecurityTokenReferenceType_array **) inst, | |
| 184 | message, options); | |
| 185 | } | |
| 186 | ||
| 187 | globus_result_t | |
| 188 | wsse_SecurityTokenReferenceType_array_init_wrapper( | |
| 189 | void ** arr) | |
| 190 | 0 | { |
| 191 | 0 | return wsse_SecurityTokenReferenceType_array_init( |
| 192 | (wsse_SecurityTokenReferenceType_array **) arr); | |
| 193 | } | |
| 194 | ||
| 195 | void | |
| 196 | wsse_SecurityTokenReferenceType_array_destroy_wrapper( | |
| 197 | void * arr) | |
| 198 | 0 | { |
| 199 | 0 | wsse_SecurityTokenReferenceType_array_destroy( |
| 200 | (wsse_SecurityTokenReferenceType_array *) arr); | |
| 201 | } | |
| 202 | ||
| 203 | globus_result_t | |
| 204 | wsse_SecurityTokenReferenceType_array_copy_wrapper( | |
| 205 | void ** dest_arr, | |
| 206 | void * src_arr) | |
| 207 | 0 | { |
| 208 | 0 | return wsse_SecurityTokenReferenceType_array_copy( |
| 209 | (wsse_SecurityTokenReferenceType_array **) dest_arr, | |
| 210 | (wsse_SecurityTokenReferenceType_array *) src_arr); | |
| 211 | } | |
| 212 | ||
| 213 | globus_result_t | |
| 214 | wsse_SecurityTokenReferenceType_array_init_contents_wrapper( | |
| 215 | void * arr) | |
| 216 | 0 | { |
| 217 | 0 | return wsse_SecurityTokenReferenceType_array_init_contents( |
| 218 | (wsse_SecurityTokenReferenceType_array *) arr); | |
| 219 | } | |
| 220 | ||
| 221 | void | |
| 222 | wsse_SecurityTokenReferenceType_array_destroy_contents_wrapper( | |
| 223 | void * arr) | |
| 224 | 0 | { |
| 225 | 0 | wsse_SecurityTokenReferenceType_array_destroy_contents( |
| 226 | (wsse_SecurityTokenReferenceType_array *) arr); | |
| 227 | } | |
| 228 | ||
| 229 | globus_result_t | |
| 230 | wsse_SecurityTokenReferenceType_array_copy_contents_wrapper( | |
| 231 | void * dest_arr, | |
| 232 | void * src_arr) | |
| 233 | 0 | { |
| 234 | 0 | return wsse_SecurityTokenReferenceType_array_copy_contents( |
| 235 | (wsse_SecurityTokenReferenceType_array *) dest_arr, | |
| 236 | (wsse_SecurityTokenReferenceType_array *) src_arr); | |
| 237 | } | |
| 238 | ||
| 239 | struct globus_xsd_type_info_s wsse_SecurityTokenReferenceType_contents_info = | |
| 240 | { | |
| 241 | &wsse_SecurityTokenReferenceType_qname, | |
| 242 | wsse_SecurityTokenReferenceType_serialize_contents_wrapper, | |
| 243 | wsse_SecurityTokenReferenceType_deserialize_contents_wrapper, | |
| 244 | wsse_SecurityTokenReferenceType_init_wrapper, | |
| 245 | wsse_SecurityTokenReferenceType_destroy_wrapper, | |
| 246 | wsse_SecurityTokenReferenceType_copy_wrapper, | |
| 247 | wsse_SecurityTokenReferenceType_init_contents_wrapper, | |
| 248 | wsse_SecurityTokenReferenceType_destroy_contents_wrapper, | |
| 249 | wsse_SecurityTokenReferenceType_copy_contents_wrapper, | |
| 250 | sizeof(wsse_SecurityTokenReferenceType), | |
| 251 | NULL, | |
| 252 | NULL, | |
| 253 | NULL | |
| 254 | }; | |
| 255 | ||
| 256 | struct globus_xsd_type_info_s wsse_SecurityTokenReferenceType_array_info = | |
| 257 | { | |
| 258 | &wsse_SecurityTokenReferenceType_qname, | |
| 259 | wsse_SecurityTokenReferenceType_array_serialize_wrapper, | |
| 260 | wsse_SecurityTokenReferenceType_array_deserialize_wrapper, | |
| 261 | wsse_SecurityTokenReferenceType_array_init_wrapper, | |
| 262 | wsse_SecurityTokenReferenceType_array_destroy_wrapper, | |
| 263 | wsse_SecurityTokenReferenceType_array_copy_wrapper, | |
| 264 | wsse_SecurityTokenReferenceType_array_init_contents_wrapper, | |
| 265 | wsse_SecurityTokenReferenceType_array_destroy_contents_wrapper, | |
| 266 | wsse_SecurityTokenReferenceType_array_copy_contents_wrapper, | |
| 267 | sizeof(wsse_SecurityTokenReferenceType), | |
| 268 | wsse_SecurityTokenReferenceType_array_push_wrapper, | |
| 269 | NULL, | |
| 270 | NULL | |
| 271 | }; | |
| 272 | ||
| 273 | struct globus_xsd_type_info_s wsse_SecurityTokenReferenceType_info = | |
| 274 | { | |
| 275 | &wsse_SecurityTokenReferenceType_qname, | |
| 276 | wsse_SecurityTokenReferenceType_serialize_wrapper, | |
| 277 | wsse_SecurityTokenReferenceType_deserialize_pointer_wrapper, | |
| 278 | wsse_SecurityTokenReferenceType_init_wrapper, | |
| 279 | wsse_SecurityTokenReferenceType_destroy_wrapper, | |
| 280 | wsse_SecurityTokenReferenceType_copy_wrapper, | |
| 281 | wsse_SecurityTokenReferenceType_init_contents_wrapper, | |
| 282 | wsse_SecurityTokenReferenceType_destroy_contents_wrapper, | |
| 283 | wsse_SecurityTokenReferenceType_copy_contents_wrapper, | |
| 284 | sizeof(wsse_SecurityTokenReferenceType), | |
| 285 | NULL, | |
| 286 | &wsse_SecurityTokenReferenceType_contents_info, | |
| 287 | &wsse_SecurityTokenReferenceType_array_info | |
| 288 | }; | |
| 289 | ||
| 290 | globus_result_t | |
| 291 | wsse_SecurityTokenReferenceType_init_contents( | |
| 292 | wsse_SecurityTokenReferenceType * instance) | |
| 293 | 0 | { |
| 294 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 295 | 0 | GlobusFuncName(wsse_SecurityTokenReferenceType_init_contents); |
| 296 | 0 | GlobusSoapMessageDebugEnter(); |
| 297 | ||
| 298 | 0 | memset(instance, 0, sizeof(wsse_SecurityTokenReferenceType)); |
| 299 | ||
| 300 | 0 | GlobusSoapMessageDebugExit(); |
| 301 | 0 | return result; |
| 302 | } | |
| 303 | ||
| 304 | globus_result_t | |
| 305 | wsse_SecurityTokenReferenceType_init( | |
| 306 | wsse_SecurityTokenReferenceType ** object) | |
| 307 | 0 | { |
| 308 | 0 | wsse_SecurityTokenReferenceType * instance; |
| 309 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 310 | 0 | GlobusFuncName(wsse_SecurityTokenReferenceType_init); |
| 311 | 0 | GlobusSoapMessageDebugEnter(); |
| 312 | ||
| 313 | 0 | instance = globus_malloc(sizeof(wsse_SecurityTokenReferenceType)); |
| 314 | 0 | if(!instance) |
| 315 | { | |
| 316 | 0 | result = GlobusSoapMessageErrorOutOfMemory; |
| 317 | 0 | goto exit; |
| 318 | } | |
| 319 | ||
| 320 | 0 | memset(instance, 0, sizeof(wsse_SecurityTokenReferenceType)); |
| 321 | ||
| 322 | 0 | *object = instance; |
| 323 | ||
| 324 | exit: | |
| 325 | 0 | GlobusSoapMessageDebugExit(); |
| 326 | 0 | return result; |
| 327 | } | |
| 328 | ||
| 329 | void | |
| 330 | wsse_SecurityTokenReferenceType_destroy( | |
| 331 | wsse_SecurityTokenReferenceType * instance) | |
| 332 | 0 | { |
| 333 | 0 | GlobusFuncName(wsse_SecurityTokenReferenceType_destroy); |
| 334 | 0 | GlobusSoapMessageDebugEnter(); |
| 335 | ||
| 336 | 0 | if(!instance) |
| 337 | { | |
| 338 | 0 | goto exit; |
| 339 | } | |
| 340 | ||
| 341 | 0 | wsse_SecurityTokenReferenceType_destroy_contents(instance); |
| 342 | 0 | globus_free(instance); |
| 343 | ||
| 344 | exit: | |
| 345 | ||
| 346 | 0 | GlobusSoapMessageDebugExit(); |
| 347 | } | |
| 348 | ||
| 349 | void | |
| 350 | wsse_SecurityTokenReferenceType_destroy_contents( | |
| 351 | wsse_SecurityTokenReferenceType * instance) | |
| 352 | 0 | { |
| 353 | 0 | GlobusFuncName(wsse_SecurityTokenReferenceType_destroy_contents); |
| 354 | 0 | GlobusSoapMessageDebugEnter(); |
| 355 | ||
| 356 | 0 | if(instance) |
| 357 | { | |
| 358 | ||
| 359 | ||
| 360 | 0 | xsd_any_destroy_contents( |
| 361 | &instance->any); | |
| 362 | ||
| 363 | 0 | xsd_anyAttributes_destroy(instance->anyAttributes); |
| 364 | 0 | instance->anyAttributes = NULL; |
| 365 | ||
| 366 | 0 | if(instance->_Usage) |
| 367 | { | |
| 368 | 0 | wsse_tUsage_destroy( |
| 369 | instance->_Usage); | |
| 370 | 0 | instance->_Usage = NULL; |
| 371 | } | |
| 372 | ||
| 373 | 0 | if(instance->_Id) |
| 374 | { | |
| 375 | 0 | xsd_ID_destroy( |
| 376 | instance->_Id); | |
| 377 | 0 | instance->_Id = NULL; |
| 378 | } | |
| 379 | ||
| 380 | } | |
| 381 | ||
| 382 | 0 | GlobusSoapMessageDebugExit(); |
| 383 | } | |
| 384 | ||
| 385 | globus_result_t | |
| 386 | wsse_SecurityTokenReferenceType_copy( | |
| 387 | wsse_SecurityTokenReferenceType ** dest_obj, | |
| 388 | const wsse_SecurityTokenReferenceType * src_obj) | |
| 389 | 0 | { |
| 390 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 391 | 0 | wsse_SecurityTokenReferenceType * instance; |
| 392 | 0 | GlobusFuncName(wsse_SecurityTokenReferenceType_copy); |
| 393 | ||
| 394 | 0 | GlobusSoapMessageDebugEnter(); |
| 395 | ||
| 396 | 0 | instance = malloc(sizeof(wsse_SecurityTokenReferenceType)); |
| 397 | 0 | if (instance == NULL) |
| 398 | { | |
| 399 | 0 | GlobusSoapMessageDebugExit(); |
| 400 | 0 | return GlobusSoapMessageErrorOutOfMemory; |
| 401 | } | |
| 402 | ||
| 403 | 0 | result = wsse_SecurityTokenReferenceType_copy_contents(instance, src_obj); |
| 404 | 0 | if(result != GLOBUS_SUCCESS) |
| 405 | { | |
| 406 | 0 | globus_free(instance); |
| 407 | 0 | GlobusSoapMessageDebugExit(); |
| 408 | 0 | return GlobusSoapMessageErrorOutOfMemory; |
| 409 | } | |
| 410 | ||
| 411 | 0 | *dest_obj = instance; |
| 412 | 0 | GlobusSoapMessageDebugExit(); |
| 413 | 0 | return result; |
| 414 | } | |
| 415 | ||
| 416 | globus_result_t | |
| 417 | wsse_SecurityTokenReferenceType_copy_contents( | |
| 418 | wsse_SecurityTokenReferenceType * instance, | |
| 419 | const wsse_SecurityTokenReferenceType * src_obj) | |
| 420 | 0 | { |
| 421 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 422 | 0 | GlobusFuncName(wsse_SecurityTokenReferenceType_copy_contents); |
| 423 | ||
| 424 | 0 | GlobusSoapMessageDebugEnter(); |
| 425 | ||
| 426 | ||
| 427 | 0 | if(src_obj->anyAttributes) |
| 428 | { | |
| 429 | 0 | result = xsd_anyAttributes_copy(&instance->anyAttributes, |
| 430 | src_obj->anyAttributes); | |
| 431 | 0 | if(result != GLOBUS_SUCCESS) |
| 432 | { | |
| 433 | 0 | result = GlobusSoapMessageErrorCopyAnyAttrsFailed( |
| 434 | result, NULL); | |
| 435 | 0 | goto xsd_anyAttributes_after_destroy; |
| 436 | } | |
| 437 | } | |
| 438 | else | |
| 439 | { | |
| 440 | 0 | instance->anyAttributes = NULL; |
| 441 | } | |
| 442 | ||
| 443 | 0 | if(src_obj->_Usage) |
| 444 | { | |
| 445 | 0 | result = wsse_tUsage_copy( |
| 446 | &instance->_Usage, | |
| 447 | src_obj->_Usage); | |
| 448 | 0 | if(result != GLOBUS_SUCCESS) |
| 449 | { | |
| 450 | 0 | result = GlobusSoapMessageErrorCopyFailed( |
| 451 | result, NULL, &wsse_tUsage_qname); | |
| 452 | 0 | goto _Usage_destroy; |
| 453 | } | |
| 454 | } | |
| 455 | else | |
| 456 | { | |
| 457 | 0 | instance->_Usage = NULL; |
| 458 | } | |
| 459 | ||
| 460 | 0 | if(src_obj->_Id) |
| 461 | { | |
| 462 | 0 | result = xsd_ID_copy( |
| 463 | &instance->_Id, | |
| 464 | src_obj->_Id); | |
| 465 | 0 | if(result != GLOBUS_SUCCESS) |
| 466 | { | |
| 467 | 0 | result = GlobusSoapMessageErrorCopyFailed( |
| 468 | result, NULL, &xsd_ID_qname); | |
| 469 | 0 | goto _Id_destroy; |
| 470 | } | |
| 471 | } | |
| 472 | else | |
| 473 | { | |
| 474 | 0 | instance->_Id = NULL; |
| 475 | } | |
| 476 | ||
| 477 | 0 | result = xsd_any_copy_contents( |
| 478 | &instance->any, | |
| 479 | &src_obj->any); | |
| 480 | 0 | if(result != GLOBUS_SUCCESS) |
| 481 | { | |
| 482 | 0 | result = GlobusSoapMessageErrorCopyFailed( |
| 483 | result, NULL, &xsd_any_qname); | |
| 484 | 0 | goto any_destroy; |
| 485 | } | |
| 486 | ||
| 487 | 0 | goto exit; |
| 488 | ||
| 489 | fail_deserialize: | |
| 490 | ||
| 491 | xsd_anyAttributes_destroy: | |
| 492 | 0 | xsd_anyAttributes_destroy(instance->anyAttributes); |
| 493 | 0 | instance->anyAttributes = NULL; |
| 494 | xsd_anyAttributes_after_destroy: | |
| 495 | ||
| 496 | _Usage_destroy: | |
| 497 | ||
| 498 | 0 | if(instance->_Usage) |
| 499 | { | |
| 500 | 0 | wsse_tUsage_destroy( |
| 501 | instance->_Usage); | |
| 502 | 0 | instance->_Usage = NULL; |
| 503 | } | |
| 504 | ||
| 505 | _Id_destroy: | |
| 506 | ||
| 507 | 0 | if(instance->_Id) |
| 508 | { | |
| 509 | 0 | xsd_ID_destroy( |
| 510 | instance->_Id); | |
| 511 | 0 | instance->_Id = NULL; |
| 512 | } | |
| 513 | 0 | xsd_any_destroy_contents( |
| 514 | &instance->any); | |
| 515 | ||
| 516 | any_destroy: | |
| 517 | ||
| 518 | ||
| 519 | exit: | |
| 520 | ||
| 521 | 0 | GlobusSoapMessageDebugExit(); |
| 522 | 0 | return result; |
| 523 | } | |
| 524 | ||
| 525 | ||
| 526 | ||
| 527 | globus_result_t | |
| 528 | wsse_SecurityTokenReferenceType_serialize_contents( | |
| 529 | xsd_QName * element_qname, /* ignored */ | |
| 530 | wsse_SecurityTokenReferenceType * inst, | |
| 531 | globus_soap_message_handle_t message_handle, | |
| 532 | globus_xsd_element_options_t options) | |
| 533 | 0 | { |
| 534 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 535 | 0 | GlobusFuncName(wsse_SecurityTokenReferenceType_serialize_contents); |
| 536 | 0 | GlobusSoapMessageDebugEnter(); |
| 537 | ||
| 538 | 0 | result = wsse_SecurityTokenReferenceType_serialize( |
| 539 | NULL, | |
| 540 | inst, | |
| 541 | message_handle, | |
| 542 | options | GLOBUS_XSD_ELEMENT_CONTENTS_ONLY); | |
| 543 | 0 | if(result != GLOBUS_SUCCESS) |
| 544 | { | |
| 545 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 546 | result, NULL, element_qname); | |
| 547 | goto exit; | |
| 548 | } | |
| 549 | ||
| 550 | exit: | |
| 551 | ||
| 552 | 0 | GlobusSoapMessageDebugExit(); |
| 553 | 0 | return result; |
| 554 | } | |
| 555 | ||
| 556 | ||
| 557 | ||
| 558 | globus_result_t | |
| 559 | wsse_SecurityTokenReferenceType_serialize( | |
| 560 | xsd_QName * element_qname, | |
| 561 | wsse_SecurityTokenReferenceType * instance, | |
| 562 | globus_soap_message_handle_t message_handle, | |
| 563 | globus_xsd_element_options_t options) | |
| 564 | 0 | { |
| 565 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 566 | 0 | xsd_QName subelement; |
| 567 | 0 | globus_list_t * any_attr_keys = NULL; |
| 568 | 0 | globus_list_t * any_attr_keys_iterator = NULL; |
| 569 | 0 | xsd_QName * type_attr = NULL; |
| 570 | 0 | char * prefix = NULL; |
| 571 | 0 | int prefix_created; |
| 572 | 0 | int define_prefix = 0; |
| 573 | 0 | int save_options = options; |
| 574 | ||
| 575 | 0 | GlobusFuncName(wsse_SecurityTokenReferenceType_serialize); |
| 576 | 0 | GlobusSoapMessageDebugEnter(); |
| 577 | ||
| 578 | ||
| 579 | 0 | if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY)) |
| 580 | { | |
| 581 | /* serialize wsse_SecurityTokenReferenceType element */ | |
| 582 | ||
| 583 | 0 | result = globus_soap_message_invoke_ns_callouts( |
| 584 | message_handle, | |
| 585 | element_qname, | |
| 586 | GLOBUS_SOAP_MESSAGE_CALLOUT_NS_SET, | |
| 587 | &options); | |
| 588 | 0 | if(result != GLOBUS_SUCCESS) |
| 589 | { | |
| 590 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 591 | result, NULL, element_qname); | |
| 592 | 0 | goto exit; |
| 593 | } | |
| 594 | ||
| 595 | 0 | result = globus_soap_message_element_ns_set( |
| 596 | message_handle, | |
| 597 | element_qname->Namespace, | |
| 598 | &options); | |
| 599 | 0 | if(result != GLOBUS_SUCCESS) |
| 600 | { | |
| 601 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 602 | result, NULL, element_qname); | |
| 603 | 0 | goto exit; |
| 604 | } | |
| 605 | ||
| 606 | 0 | result = xsd_anyAttributes_namespace_set( |
| 607 | message_handle, instance->anyAttributes, &options); | |
| 608 | 0 | if(result != GLOBUS_SUCCESS) |
| 609 | { | |
| 610 | 0 | result = GlobusSoapMessageErrorSerializeAnyAttrsFailed( |
| 611 | result, "Failed to set namespace"); | |
| 612 | 0 | goto exit; |
| 613 | } | |
| 614 | ||
| 615 | 0 | if(instance->_Usage) |
| 616 | { | |
| 617 | ||
| 618 | 0 | result = globus_soap_message_attribute_ns_set( |
| 619 | message_handle, | |
| 620 | "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", | |
| 621 | &options); | |
| 622 | ||
| 623 | 0 | if(result != GLOBUS_SUCCESS) |
| 624 | { | |
| 625 | 0 | xsd_QName error_qname; |
| 626 | 0 | error_qname.local = prefix; |
| 627 | 0 | error_qname.Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"; |
| 628 | 0 | result = GlobusSoapMessageErrorSerializeFailed(result, |
| 629 | NULL, | |
| 630 | &error_qname); | |
| 631 | 0 | goto exit; |
| 632 | } | |
| 633 | ||
| 634 | ||
| 635 | } | |
| 636 | ||
| 637 | 0 | if(instance->_Id) |
| 638 | { | |
| 639 | ||
| 640 | 0 | result = globus_soap_message_attribute_ns_set( |
| 641 | message_handle, | |
| 642 | "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd", | |
| 643 | &options); | |
| 644 | ||
| 645 | 0 | if(result != GLOBUS_SUCCESS) |
| 646 | { | |
| 647 | 0 | xsd_QName error_qname; |
| 648 | 0 | error_qname.local = prefix; |
| 649 | 0 | error_qname.Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"; |
| 650 | 0 | result = GlobusSoapMessageErrorSerializeFailed(result, |
| 651 | NULL, | |
| 652 | &error_qname); | |
| 653 | 0 | goto exit; |
| 654 | } | |
| 655 | ||
| 656 | ||
| 657 | } | |
| 658 | ||
| 659 | 0 | if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) && |
| 660 | !globus_soap_message_serialize_is_c14n_subset(message_handle)) | |
| 661 | { | |
| 662 | 0 | result = globus_soap_message_attribute_ns_set( |
| 663 | message_handle, | |
| 664 | "http://www.w3.org/2001/XMLSchema-instance", | |
| 665 | &options); | |
| 666 | 0 | if(result != GLOBUS_SUCCESS) |
| 667 | { | |
| 668 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 669 | result, NULL, element_qname); | |
| 670 | 0 | goto exit; |
| 671 | } | |
| 672 | ||
| 673 | 0 | result = globus_soap_message_attribute_ns_set( |
| 674 | message_handle, | |
| 675 | wsse_SecurityTokenReferenceType_qname.Namespace, | |
| 676 | &options); | |
| 677 | 0 | if(result != GLOBUS_SUCCESS) |
| 678 | { | |
| 679 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 680 | result, NULL, element_qname); | |
| 681 | 0 | goto exit; |
| 682 | } | |
| 683 | } | |
| 684 | ||
| 685 | 0 | result = globus_soap_message_invoke_callouts( |
| 686 | message_handle, | |
| 687 | element_qname, | |
| 688 | GLOBUS_SOAP_MESSAGE_CALLOUT_BEGIN); | |
| 689 | 0 | if(result != GLOBUS_SUCCESS) |
| 690 | { | |
| 691 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 692 | result, NULL, element_qname); | |
| 693 | 0 | goto exit; |
| 694 | } | |
| 695 | ||
| 696 | 0 | result = globus_soap_message_serialize_element( |
| 697 | message_handle, | |
| 698 | element_qname, | |
| 699 | options, | |
| 700 | &wsse_SecurityTokenReferenceType_qname); | |
| 701 | 0 | if(result != GLOBUS_SUCCESS) |
| 702 | { | |
| 703 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 704 | result, NULL, element_qname); | |
| 705 | 0 | goto exit; |
| 706 | } | |
| 707 | ||
| 708 | 0 | if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) && |
| 709 | !globus_soap_message_serialize_is_c14n_subset(message_handle)) | |
| 710 | { | |
| 711 | 0 | xsd_QName_init(&type_attr); |
| 712 | ||
| 713 | 0 | type_attr->local = globus_libc_strdup("type"); |
| 714 | 0 | type_attr->Namespace = globus_libc_strdup(XSI_NS); |
| 715 | } | |
| 716 | ||
| 717 | /* serialize namespaces */ | |
| 718 | ||
| 719 | 0 | result = globus_soap_message_invoke_ns_callouts( |
| 720 | message_handle, | |
| 721 | element_qname, | |
| 722 | GLOBUS_SOAP_MESSAGE_CALLOUT_NS_ADD, | |
| 723 | &options); | |
| 724 | 0 | if(result != GLOBUS_SUCCESS) |
| 725 | { | |
| 726 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 727 | result, NULL, element_qname); | |
| 728 | 0 | goto exit; |
| 729 | } | |
| 730 | ||
| 731 | 0 | result = globus_soap_message_element_ns_add( |
| 732 | message_handle, | |
| 733 | element_qname->Namespace, | |
| 734 | &options); | |
| 735 | 0 | if(result != GLOBUS_SUCCESS) |
| 736 | { | |
| 737 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 738 | result, NULL, element_qname); | |
| 739 | 0 | goto exit; |
| 740 | } | |
| 741 | ||
| 742 | 0 | result = xsd_anyAttributes_namespace_add( |
| 743 | message_handle, instance->anyAttributes, &options); | |
| 744 | 0 | if(result != GLOBUS_SUCCESS) |
| 745 | { | |
| 746 | 0 | result = GlobusSoapMessageErrorSerializeAnyAttrsFailed( |
| 747 | result, "Failed to add namespace"); | |
| 748 | 0 | goto exit; |
| 749 | } | |
| 750 | ||
| 751 | 0 | if(instance->_Usage) |
| 752 | { | |
| 753 | ||
| 754 | 0 | result = globus_soap_message_attribute_ns_add( |
| 755 | message_handle, | |
| 756 | "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", | |
| 757 | &options); | |
| 758 | ||
| 759 | 0 | if(result != GLOBUS_SUCCESS) |
| 760 | { | |
| 761 | 0 | xsd_QName error_qname; |
| 762 | 0 | error_qname.local = prefix; |
| 763 | 0 | error_qname.Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"; |
| 764 | 0 | result = GlobusSoapMessageErrorSerializeFailed(result, |
| 765 | NULL, | |
| 766 | &error_qname); | |
| 767 | 0 | goto exit; |
| 768 | } | |
| 769 | ||
| 770 | ||
| 771 | } | |
| 772 | ||
| 773 | 0 | if(instance->_Id) |
| 774 | { | |
| 775 | ||
| 776 | 0 | result = globus_soap_message_attribute_ns_add( |
| 777 | message_handle, | |
| 778 | "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd", | |
| 779 | &options); | |
| 780 | ||
| 781 | 0 | if(result != GLOBUS_SUCCESS) |
| 782 | { | |
| 783 | 0 | xsd_QName error_qname; |
| 784 | 0 | error_qname.local = prefix; |
| 785 | 0 | error_qname.Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"; |
| 786 | 0 | result = GlobusSoapMessageErrorSerializeFailed(result, |
| 787 | NULL, | |
| 788 | &error_qname); | |
| 789 | 0 | goto exit; |
| 790 | } | |
| 791 | ||
| 792 | ||
| 793 | } | |
| 794 | ||
| 795 | 0 | if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) && |
| 796 | !globus_soap_message_serialize_is_c14n_subset(message_handle)) | |
| 797 | { | |
| 798 | 0 | result = globus_soap_message_attribute_ns_add( |
| 799 | message_handle, | |
| 800 | "http://www.w3.org/2001/XMLSchema-instance", | |
| 801 | &options); | |
| 802 | 0 | if(result != GLOBUS_SUCCESS) |
| 803 | { | |
| 804 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 805 | result, NULL, element_qname); | |
| 806 | 0 | goto exit; |
| 807 | } | |
| 808 | ||
| 809 | 0 | result = globus_soap_message_attribute_ns_add( |
| 810 | message_handle, | |
| 811 | wsse_SecurityTokenReferenceType_qname.Namespace, | |
| 812 | &options); | |
| 813 | 0 | if(result != GLOBUS_SUCCESS) |
| 814 | { | |
| 815 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 816 | result, NULL, element_qname); | |
| 817 | 0 | goto exit; |
| 818 | } | |
| 819 | } | |
| 820 | ||
| 821 | /* serialize attributes */ | |
| 822 | ||
| 823 | 0 | if(instance->anyAttributes) |
| 824 | { | |
| 825 | 0 | any_attr_keys = xsd_anyAttributes_lex_sort( |
| 826 | instance->anyAttributes); | |
| 827 | 0 | any_attr_keys_iterator = any_attr_keys; |
| 828 | } | |
| 829 | ||
| 830 | 0 | subelement.Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"; |
| 831 | 0 | subelement.local = "Usage"; |
| 832 | ||
| 833 | 0 | if(any_attr_keys_iterator) |
| 834 | { | |
| 835 | 0 | result = xsd_anyAttributes_serialize_lex_before( |
| 836 | message_handle, | |
| 837 | &any_attr_keys_iterator, | |
| 838 | instance->anyAttributes, | |
| 839 | &subelement); | |
| 840 | 0 | if(result != GLOBUS_SUCCESS) |
| 841 | { | |
| 842 | 0 | result = GlobusSoapMessageErrorSerializeFailed(result, |
| 843 | NULL, | |
| 844 | element_qname); | |
| 845 | 0 | goto exit; |
| 846 | } | |
| 847 | } | |
| 848 | ||
| 849 | 0 | if(instance->_Usage) |
| 850 | { | |
| 851 | ||
| 852 | 0 | result = wsse_tUsage_serialize_attribute( |
| 853 | &subelement, | |
| 854 | instance->_Usage, | |
| 855 | message_handle, | |
| 856 | options & (~GLOBUS_XSD_ELEMENT_SET_DEFAULT_NS)); | |
| 857 | 0 | if(result != GLOBUS_SUCCESS) |
| 858 | { | |
| 859 | 0 | result = GlobusSoapMessageErrorSerializeFailed(result, |
| 860 | NULL, | |
| 861 | element_qname); | |
| 862 | 0 | goto exit; |
| 863 | } | |
| 864 | ||
| 865 | } | |
| 866 | ||
| 867 | 0 | subelement.Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"; |
| 868 | 0 | subelement.local = "Id"; |
| 869 | ||
| 870 | 0 | if(any_attr_keys_iterator) |
| 871 | { | |
| 872 | 0 | result = xsd_anyAttributes_serialize_lex_before( |
| 873 | message_handle, | |
| 874 | &any_attr_keys_iterator, | |
| 875 | instance->anyAttributes, | |
| 876 | &subelement); | |
| 877 | 0 | if(result != GLOBUS_SUCCESS) |
| 878 | { | |
| 879 | 0 | result = GlobusSoapMessageErrorSerializeFailed(result, |
| 880 | NULL, | |
| 881 | element_qname); | |
| 882 | 0 | goto exit; |
| 883 | } | |
| 884 | } | |
| 885 | ||
| 886 | 0 | if(instance->_Id) |
| 887 | { | |
| 888 | ||
| 889 | 0 | result = xsd_ID_serialize_attribute( |
| 890 | &subelement, | |
| 891 | instance->_Id, | |
| 892 | message_handle, | |
| 893 | options & (~GLOBUS_XSD_ELEMENT_SET_DEFAULT_NS)); | |
| 894 | 0 | if(result != GLOBUS_SUCCESS) |
| 895 | { | |
| 896 | 0 | result = GlobusSoapMessageErrorSerializeFailed(result, |
| 897 | NULL, | |
| 898 | element_qname); | |
| 899 | 0 | goto exit; |
| 900 | } | |
| 901 | ||
| 902 | } | |
| 903 | ||
| 904 | 0 | if(any_attr_keys_iterator) |
| 905 | { | |
| 906 | 0 | result = xsd_anyAttributes_serialize_lex_before( |
| 907 | message_handle, | |
| 908 | &any_attr_keys_iterator, | |
| 909 | instance->anyAttributes, | |
| 910 | &subelement); | |
| 911 | 0 | if(result != GLOBUS_SUCCESS) |
| 912 | { | |
| 913 | 0 | result = GlobusSoapMessageErrorSerializeFailed(result, |
| 914 | NULL, | |
| 915 | element_qname); | |
| 916 | 0 | goto exit; |
| 917 | } | |
| 918 | } | |
| 919 | ||
| 920 | 0 | if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) && |
| 921 | !globus_soap_message_serialize_is_c14n_subset(message_handle)) | |
| 922 | { | |
| 923 | 0 | result = globus_soap_message_serialize_QName_attribute( |
| 924 | message_handle, | |
| 925 | type_attr, | |
| 926 | &wsse_SecurityTokenReferenceType_qname); | |
| 927 | 0 | if(result != GLOBUS_SUCCESS) |
| 928 | { | |
| 929 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 930 | result, NULL, element_qname); | |
| 931 | 0 | goto exit; |
| 932 | } | |
| 933 | } | |
| 934 | ||
| 935 | ||
| 936 | 0 | result = globus_soap_message_invoke_callouts( |
| 937 | message_handle, | |
| 938 | element_qname, | |
| 939 | GLOBUS_SOAP_MESSAGE_CALLOUT_ATTR); | |
| 940 | 0 | if(result != GLOBUS_SUCCESS) |
| 941 | { | |
| 942 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 943 | result, NULL, element_qname); | |
| 944 | 0 | goto exit; |
| 945 | } | |
| 946 | } | |
| 947 | ||
| 948 | 0 | if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY)) |
| 949 | { | |
| 950 | 0 | result = globus_soap_message_serialize_element_begin_close( |
| 951 | message_handle); | |
| 952 | 0 | if(result != GLOBUS_SUCCESS) |
| 953 | { | |
| 954 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 955 | result, NULL, element_qname); | |
| 956 | 0 | goto exit; |
| 957 | } | |
| 958 | } | |
| 959 | 0 | options &= ~GLOBUS_XSD_ELEMENT_CONTENTS_ONLY; |
| 960 | ||
| 961 | /* serialize contents of type */ | |
| 962 | ||
| 963 | 0 | subelement.local = "any"; |
| 964 | 0 | subelement.Namespace = "http://www.w3.org/2001/XMLSchema"; |
| 965 | ||
| 966 | 0 | result = xsd_any_serialize( |
| 967 | &subelement, | |
| 968 | &instance->any, | |
| 969 | message_handle, | |
| 970 | options & (~GLOBUS_XSD_ELEMENT_SET_DEFAULT_NS)); | |
| 971 | 0 | if(result != GLOBUS_SUCCESS) |
| 972 | { | |
| 973 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 974 | result, NULL, &xsd_any_qname); | |
| 975 | 0 | goto exit; |
| 976 | } | |
| 977 | ||
| 978 | 0 | options = save_options; |
| 979 | ||
| 980 | 0 | if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY)) |
| 981 | { | |
| 982 | /* add end element */ | |
| 983 | 0 | result = globus_soap_message_serialize_element_end( |
| 984 | message_handle, | |
| 985 | element_qname, | |
| 986 | options, | |
| 987 | &wsse_SecurityTokenReferenceType_qname); | |
| 988 | 0 | if(result != GLOBUS_SUCCESS) |
| 989 | { | |
| 990 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 991 | result, NULL, element_qname); | |
| 992 | 0 | goto exit; |
| 993 | } | |
| 994 | ||
| 995 | 0 | globus_soap_message_element_ns_remove( |
| 996 | message_handle, | |
| 997 | element_qname->Namespace, | |
| 998 | &options); | |
| 999 | ||
| 1000 | /* remove namespace/prefix mappings for these types */ | |
| 1001 | ||
| 1002 | 0 | result = xsd_anyAttributes_namespace_remove( |
| 1003 | message_handle, instance->anyAttributes, &options); | |
| 1004 | 0 | if(result != GLOBUS_SUCCESS) |
| 1005 | { | |
| 1006 | 0 | result = GlobusSoapMessageErrorSerializeAnyAttrsFailed( |
| 1007 | result, "Failed to remove namespace"); | |
| 1008 | 0 | goto exit; |
| 1009 | } | |
| 1010 | ||
| 1011 | 0 | if(instance->_Usage) |
| 1012 | { | |
| 1013 | ||
| 1014 | 0 | globus_soap_message_attribute_ns_remove( |
| 1015 | message_handle, | |
| 1016 | "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", | |
| 1017 | &options); | |
| 1018 | ||
| 1019 | } | |
| 1020 | ||
| 1021 | 0 | if(instance->_Id) |
| 1022 | { | |
| 1023 | ||
| 1024 | 0 | globus_soap_message_attribute_ns_remove( |
| 1025 | message_handle, | |
| 1026 | "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd", | |
| 1027 | &options); | |
| 1028 | ||
| 1029 | } | |
| 1030 | ||
| 1031 | 0 | if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) && |
| 1032 | !globus_soap_message_serialize_is_c14n_subset(message_handle)) | |
| 1033 | { | |
| 1034 | 0 | globus_soap_message_attribute_ns_remove( |
| 1035 | message_handle, | |
| 1036 | "http://www.w3.org/2001/XMLSchema-instance", | |
| 1037 | &options); | |
| 1038 | ||
| 1039 | 0 | globus_soap_message_attribute_ns_remove( |
| 1040 | message_handle, | |
| 1041 | wsse_SecurityTokenReferenceType_qname.Namespace, | |
| 1042 | &options); | |
| 1043 | } | |
| 1044 | ||
| 1045 | 0 | result = globus_soap_message_invoke_ns_callouts( |
| 1046 | message_handle, | |
| 1047 | element_qname, | |
| 1048 | GLOBUS_SOAP_MESSAGE_CALLOUT_NS_REMOVE, | |
| 1049 | &options); | |
| 1050 | 0 | if(result != GLOBUS_SUCCESS) |
| 1051 | { | |
| 1052 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 1053 | result, NULL, element_qname); | |
| 1054 | 0 | goto exit; |
| 1055 | } | |
| 1056 | ||
| 1057 | 0 | result = globus_soap_message_invoke_callouts( |
| 1058 | message_handle, | |
| 1059 | element_qname, | |
| 1060 | GLOBUS_SOAP_MESSAGE_CALLOUT_END); | |
| 1061 | 0 | if(result != GLOBUS_SUCCESS) |
| 1062 | { | |
| 1063 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 1064 | result, NULL, element_qname); | |
| 1065 | goto exit; | |
| 1066 | } | |
| 1067 | } | |
| 1068 | ||
| 1069 | exit: | |
| 1070 | 0 | if (type_attr) |
| 1071 | { | |
| 1072 | 0 | xsd_QName_destroy(type_attr); |
| 1073 | } | |
| 1074 | ||
| 1075 | 0 | if(any_attr_keys) |
| 1076 | { | |
| 1077 | 0 | globus_list_free(any_attr_keys); |
| 1078 | } | |
| 1079 | ||
| 1080 | 0 | GlobusSoapMessageDebugExit(); |
| 1081 | 0 | return result; |
| 1082 | } | |
| 1083 | ||
| 1084 | ||
| 1085 | ||
| 1086 | globus_result_t | |
| 1087 | wsse_SecurityTokenReferenceType_deserialize_contents( | |
| 1088 | xsd_QName * element_qname, /* ignored */ | |
| 1089 | wsse_SecurityTokenReferenceType * inst, | |
| 1090 | globus_soap_message_handle_t message_handle, | |
| 1091 | globus_xsd_element_options_t options) | |
| 1092 | 0 | { |
| 1093 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 1094 | 0 | GlobusFuncName(wsse_SecurityTokenReferenceType_deserialize_contents); |
| 1095 | 0 | GlobusSoapMessageDebugEnter(); |
| 1096 | ||
| 1097 | 0 | result = wsse_SecurityTokenReferenceType_deserialize( |
| 1098 | NULL, | |
| 1099 | inst, | |
| 1100 | message_handle, | |
| 1101 | options | GLOBUS_XSD_ELEMENT_CONTENTS_ONLY); | |
| 1102 | 0 | if(result != GLOBUS_SUCCESS) |
| 1103 | { | |
| 1104 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 1105 | result, element_qname); | |
| 1106 | goto exit; | |
| 1107 | } | |
| 1108 | ||
| 1109 | exit: | |
| 1110 | ||
| 1111 | 0 | GlobusSoapMessageDebugExit(); |
| 1112 | 0 | return result; |
| 1113 | } | |
| 1114 | ||
| 1115 | ||
| 1116 | ||
| 1117 | globus_result_t | |
| 1118 | wsse_SecurityTokenReferenceType_deserialize( | |
| 1119 | xsd_QName * element_qname, | |
| 1120 | wsse_SecurityTokenReferenceType * instance, | |
| 1121 | globus_soap_message_handle_t message_handle, | |
| 1122 | globus_xsd_element_options_t options) | |
| 1123 | 0 | { |
| 1124 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 1125 | 0 | xsd_QName subelement; |
| 1126 | 0 | GlobusFuncName(wsse_SecurityTokenReferenceType_deserialize); |
| 1127 | 0 | GlobusSoapMessageDebugEnter(); |
| 1128 | ||
| 1129 | ||
| 1130 | 0 | if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY)) |
| 1131 | { | |
| 1132 | 0 | result = globus_soap_message_deserialize_element( |
| 1133 | message_handle, element_qname); | |
| 1134 | 0 | if(result != GLOBUS_SUCCESS) |
| 1135 | { | |
| 1136 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 1137 | result, element_qname); | |
| 1138 | 0 | goto exit; |
| 1139 | } | |
| 1140 | ||
| 1141 | 0 | result = xsd_anyAttributes_init(&instance->anyAttributes); |
| 1142 | 0 | if(result != GLOBUS_SUCCESS) |
| 1143 | { | |
| 1144 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 1145 | result, element_qname); | |
| 1146 | 0 | goto xsd_anyAttributes_after_destroy; |
| 1147 | } | |
| 1148 | ||
| 1149 | 0 | result = xsd_anyAttributes_deserialize( |
| 1150 | message_handle, | |
| 1151 | instance->anyAttributes); | |
| 1152 | 0 | if(result != GLOBUS_SUCCESS) |
| 1153 | { | |
| 1154 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 1155 | result, element_qname); | |
| 1156 | 0 | goto xsd_anyAttributes_destroy; |
| 1157 | } | |
| 1158 | ||
| 1159 | 0 | subelement.Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"; |
| 1160 | 0 | subelement.local = "Usage"; |
| 1161 | ||
| 1162 | 0 | result = wsse_tUsage_deserialize_attribute_pointer( |
| 1163 | &subelement, | |
| 1164 | &instance->_Usage, | |
| 1165 | message_handle, | |
| 1166 | 0); | |
| 1167 | 0 | if(result != GLOBUS_SUCCESS) |
| 1168 | { | |
| 1169 | 0 | result = GlobusSoapMessageErrorDeserializeFailed(result, &subelement); |
| 1170 | 0 | goto _Usage_destroy; |
| 1171 | } | |
| 1172 | ||
| 1173 | ||
| 1174 | 0 | subelement.Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"; |
| 1175 | 0 | subelement.local = "Id"; |
| 1176 | ||
| 1177 | 0 | result = xsd_ID_deserialize_attribute_pointer( |
| 1178 | &subelement, | |
| 1179 | &instance->_Id, | |
| 1180 | message_handle, | |
| 1181 | 0); | |
| 1182 | 0 | if(result != GLOBUS_SUCCESS) |
| 1183 | { | |
| 1184 | 0 | result = GlobusSoapMessageErrorDeserializeFailed(result, &subelement); |
| 1185 | 0 | goto _Id_destroy; |
| 1186 | } | |
| 1187 | ||
| 1188 | ||
| 1189 | ||
| 1190 | 0 | result = globus_soap_message_deserialize_element_begin_close( |
| 1191 | message_handle); | |
| 1192 | 0 | if(result != GLOBUS_SUCCESS) |
| 1193 | { | |
| 1194 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 1195 | result, element_qname); | |
| 1196 | 0 | goto fail_deserialize; |
| 1197 | } | |
| 1198 | } | |
| 1199 | ||
| 1200 | 0 | subelement.local = "any"; |
| 1201 | 0 | subelement.Namespace = "http://www.w3.org/2001/XMLSchema"; |
| 1202 | ||
| 1203 | 0 | result = xsd_any_deserialize( |
| 1204 | &subelement, | |
| 1205 | &instance->any, | |
| 1206 | message_handle, | |
| 1207 | 0); | |
| 1208 | 0 | if(result != GLOBUS_SUCCESS) |
| 1209 | { | |
| 1210 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 1211 | result, | |
| 1212 | &xsd_any_qname); | |
| 1213 | 0 | goto any_destroy; |
| 1214 | } | |
| 1215 | ||
| 1216 | 0 | if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY)) |
| 1217 | { | |
| 1218 | 0 | result = globus_soap_message_deserialize_element_end( |
| 1219 | message_handle, | |
| 1220 | element_qname); | |
| 1221 | 0 | if(result != GLOBUS_SUCCESS) |
| 1222 | { | |
| 1223 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 1224 | result, element_qname); | |
| 1225 | goto fail_deserialize; | |
| 1226 | } | |
| 1227 | } | |
| 1228 | ||
| 1229 | 0 | goto exit; |
| 1230 | ||
| 1231 | fail_deserialize: | |
| 1232 | ||
| 1233 | xsd_anyAttributes_destroy: | |
| 1234 | 0 | xsd_anyAttributes_destroy(instance->anyAttributes); |
| 1235 | 0 | instance->anyAttributes = NULL; |
| 1236 | xsd_anyAttributes_after_destroy: | |
| 1237 | ||
| 1238 | _Usage_destroy: | |
| 1239 | ||
| 1240 | 0 | if(instance->_Usage) |
| 1241 | { | |
| 1242 | 0 | wsse_tUsage_destroy( |
| 1243 | instance->_Usage); | |
| 1244 | 0 | instance->_Usage = NULL; |
| 1245 | } | |
| 1246 | ||
| 1247 | _Id_destroy: | |
| 1248 | ||
| 1249 | 0 | if(instance->_Id) |
| 1250 | { | |
| 1251 | 0 | xsd_ID_destroy( |
| 1252 | instance->_Id); | |
| 1253 | 0 | instance->_Id = NULL; |
| 1254 | } | |
| 1255 | 0 | xsd_any_destroy_contents( |
| 1256 | &instance->any); | |
| 1257 | ||
| 1258 | any_destroy: | |
| 1259 | ||
| 1260 | ||
| 1261 | exit: | |
| 1262 | ||
| 1263 | 0 | GlobusSoapMessageDebugExit(); |
| 1264 | 0 | return result; |
| 1265 | } | |
| 1266 | ||
| 1267 | ||
| 1268 | ||
| 1269 | globus_result_t | |
| 1270 | wsse_SecurityTokenReferenceType_deserialize_pointer( | |
| 1271 | xsd_QName * element_qname, | |
| 1272 | wsse_SecurityTokenReferenceType ** ip, | |
| 1273 | globus_soap_message_handle_t message_handle, | |
| 1274 | globus_xsd_element_options_t options) | |
| 1275 | 0 | { |
| 1276 | 0 | wsse_SecurityTokenReferenceType * instance = NULL; |
| 1277 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 1278 | 0 | xsd_QName subelement; |
| 1279 | 0 | int found_attrs = 0; |
| 1280 | 0 | int empty_element = 0; |
| 1281 | 0 | GlobusFuncName(wsse_SecurityTokenReferenceType_deserialize_pointer); |
| 1282 | 0 | GlobusSoapMessageDebugEnter(); |
| 1283 | ||
| 1284 | 0 | *ip = NULL; |
| 1285 | ||
| 1286 | 0 | result = globus_soap_message_deserialize_element( |
| 1287 | message_handle, element_qname); | |
| 1288 | 0 | if(result != GLOBUS_SUCCESS && |
| 1289 | (GlobusSoapMessageStatusElementNotFoundCheck(result) || | |
| 1290 | GlobusSoapMessageStatusFailedElementCheck(result) || | |
| 1291 | GlobusSoapMessageStatusFailedWithTextCheck(result))) | |
| 1292 | { | |
| 1293 | 0 | *ip = NULL; |
| 1294 | 0 | result = GLOBUS_SUCCESS; |
| 1295 | 0 | goto exit; |
| 1296 | } | |
| 1297 | ||
| 1298 | 0 | if(result != GLOBUS_SUCCESS) |
| 1299 | { | |
| 1300 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 1301 | result, element_qname); | |
| 1302 | 0 | goto exit; |
| 1303 | } | |
| 1304 | ||
| 1305 | 0 | if(globus_soap_message_deserialize_element_is_empty( |
| 1306 | message_handle)) | |
| 1307 | { | |
| 1308 | 0 | empty_element = 1; |
| 1309 | } | |
| 1310 | ||
| 1311 | ||
| 1312 | ||
| 1313 | 0 | result = wsse_SecurityTokenReferenceType_init(&instance); |
| 1314 | 0 | if(result != GLOBUS_SUCCESS) |
| 1315 | { | |
| 1316 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 1317 | result, element_qname); | |
| 1318 | 0 | goto exit; |
| 1319 | } | |
| 1320 | ||
| 1321 | ||
| 1322 | 0 | result = xsd_anyAttributes_init(&instance->anyAttributes); |
| 1323 | 0 | if(result != GLOBUS_SUCCESS) |
| 1324 | { | |
| 1325 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 1326 | result, element_qname); | |
| 1327 | 0 | goto xsd_anyAttributes_after_destroy; |
| 1328 | } | |
| 1329 | ||
| 1330 | 0 | result = xsd_anyAttributes_deserialize( |
| 1331 | message_handle, | |
| 1332 | instance->anyAttributes); | |
| 1333 | 0 | if(result != GLOBUS_SUCCESS) |
| 1334 | { | |
| 1335 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 1336 | result, element_qname); | |
| 1337 | 0 | goto xsd_anyAttributes_destroy; |
| 1338 | } | |
| 1339 | ||
| 1340 | 0 | if(instance->anyAttributes && |
| 1341 | xsd_anyAttributes_size(instance->anyAttributes) > 0) | |
| 1342 | { | |
| 1343 | 0 | found_attrs++; |
| 1344 | } | |
| 1345 | ||
| 1346 | 0 | subelement.Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"; |
| 1347 | 0 | subelement.local = "Usage"; |
| 1348 | ||
| 1349 | 0 | result = wsse_tUsage_deserialize_attribute_pointer( |
| 1350 | &subelement, | |
| 1351 | &instance->_Usage, | |
| 1352 | message_handle, | |
| 1353 | 0); | |
| 1354 | 0 | if(result != GLOBUS_SUCCESS) |
| 1355 | { | |
| 1356 | 0 | result = GlobusSoapMessageErrorDeserializeFailed(result, &subelement); |
| 1357 | 0 | goto _Usage_destroy; |
| 1358 | } | |
| 1359 | ||
| 1360 | ||
| 1361 | 0 | if(instance->_Usage) |
| 1362 | { | |
| 1363 | 0 | found_attrs++; |
| 1364 | } | |
| 1365 | ||
| 1366 | 0 | subelement.Namespace = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"; |
| 1367 | 0 | subelement.local = "Id"; |
| 1368 | ||
| 1369 | 0 | result = xsd_ID_deserialize_attribute_pointer( |
| 1370 | &subelement, | |
| 1371 | &instance->_Id, | |
| 1372 | message_handle, | |
| 1373 | 0); | |
| 1374 | 0 | if(result != GLOBUS_SUCCESS) |
| 1375 | { | |
| 1376 | 0 | result = GlobusSoapMessageErrorDeserializeFailed(result, &subelement); |
| 1377 | 0 | goto _Id_destroy; |
| 1378 | } | |
| 1379 | ||
| 1380 | ||
| 1381 | 0 | if(instance->_Id) |
| 1382 | { | |
| 1383 | 0 | found_attrs++; |
| 1384 | } | |
| 1385 | ||
| 1386 | ||
| 1387 | 0 | if(empty_element) |
| 1388 | { | |
| 1389 | 0 | result = globus_soap_message_deserialize_element_end( |
| 1390 | message_handle, | |
| 1391 | element_qname); | |
| 1392 | 0 | if(result != GLOBUS_SUCCESS) |
| 1393 | { | |
| 1394 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 1395 | result, element_qname); | |
| 1396 | 0 | goto fail_deserialize; |
| 1397 | } | |
| 1398 | ||
| 1399 | 0 | *ip = instance; |
| 1400 | 0 | goto exit; |
| 1401 | } | |
| 1402 | ||
| 1403 | 0 | result = globus_soap_message_deserialize_element_begin_close( |
| 1404 | message_handle); | |
| 1405 | 0 | if(result != GLOBUS_SUCCESS) |
| 1406 | { | |
| 1407 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 1408 | result, element_qname); | |
| 1409 | 0 | goto exit; |
| 1410 | } | |
| 1411 | ||
| 1412 | ||
| 1413 | 0 | subelement.local = "any"; |
| 1414 | 0 | subelement.Namespace = "http://www.w3.org/2001/XMLSchema"; |
| 1415 | ||
| 1416 | 0 | result = xsd_any_deserialize( |
| 1417 | &subelement, | |
| 1418 | &instance->any, | |
| 1419 | message_handle, | |
| 1420 | 0); | |
| 1421 | 0 | if(result != GLOBUS_SUCCESS) |
| 1422 | { | |
| 1423 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 1424 | result, | |
| 1425 | &xsd_any_qname); | |
| 1426 | 0 | goto any_destroy; |
| 1427 | } | |
| 1428 | ||
| 1429 | ||
| 1430 | 0 | result = globus_soap_message_deserialize_element_end( |
| 1431 | message_handle, | |
| 1432 | element_qname); | |
| 1433 | 0 | if(result != GLOBUS_SUCCESS) |
| 1434 | { | |
| 1435 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 1436 | result, element_qname); | |
| 1437 | 0 | goto fail_deserialize; |
| 1438 | } | |
| 1439 | ||
| 1440 | 0 | *ip = instance; |
| 1441 | ||
| 1442 | 0 | goto exit; |
| 1443 | ||
| 1444 | fail_deserialize: | |
| 1445 | ||
| 1446 | xsd_anyAttributes_destroy: | |
| 1447 | 0 | xsd_anyAttributes_destroy(instance->anyAttributes); |
| 1448 | 0 | instance->anyAttributes = NULL; |
| 1449 | xsd_anyAttributes_after_destroy: | |
| 1450 | ||
| 1451 | _Usage_destroy: | |
| 1452 | ||
| 1453 | 0 | if(instance->_Usage) |
| 1454 | { | |
| 1455 | 0 | wsse_tUsage_destroy( |
| 1456 | instance->_Usage); | |
| 1457 | 0 | instance->_Usage = NULL; |
| 1458 | } | |
| 1459 | ||
| 1460 | _Id_destroy: | |
| 1461 | ||
| 1462 | 0 | if(instance->_Id) |
| 1463 | { | |
| 1464 | 0 | xsd_ID_destroy( |
| 1465 | instance->_Id); | |
| 1466 | 0 | instance->_Id = NULL; |
| 1467 | } | |
| 1468 | 0 | xsd_any_destroy_contents( |
| 1469 | &instance->any); | |
| 1470 | ||
| 1471 | any_destroy: | |
| 1472 | ||
| 1473 | exit: | |
| 1474 | ||
| 1475 | 0 | GlobusSoapMessageDebugExit(); |
| 1476 | 0 | return result; |
| 1477 | } | |
| 1478 | ||
| 1479 | ||
| 1480 | globus_result_t | |
| 1481 | wsse_SecurityTokenReferenceType_array_init_contents( | |
| 1482 | wsse_SecurityTokenReferenceType_array * array) | |
| 1483 | 0 | { |
| 1484 | 0 | GlobusFuncName(wsse_SecurityTokenReferenceType_array_init_contents); |
| 1485 | 0 | GlobusSoapMessageDebugEnter(); |
| 1486 | ||
| 1487 | 0 | memset(array, 0, sizeof(wsse_SecurityTokenReferenceType_array)); |
| 1488 | ||
| 1489 | 0 | GlobusSoapMessageDebugExit(); |
| 1490 | 0 | return GLOBUS_SUCCESS; |
| 1491 | } | |
| 1492 | ||
| 1493 | globus_result_t | |
| 1494 | wsse_SecurityTokenReferenceType_array_init( | |
| 1495 | wsse_SecurityTokenReferenceType_array ** arr) | |
| 1496 | 0 | { |
| 1497 | 0 | wsse_SecurityTokenReferenceType_array * array; |
| 1498 | 0 | globus_result_t result; |
| 1499 | 0 | GlobusFuncName(wsse_SecurityTokenReferenceType_array_init); |
| 1500 | 0 | GlobusSoapMessageDebugEnter(); |
| 1501 | ||
| 1502 | 0 | array = (wsse_SecurityTokenReferenceType_array *) |
| 1503 | globus_malloc(sizeof(wsse_SecurityTokenReferenceType_array)); | |
| 1504 | 0 | if(!array) |
| 1505 | { | |
| 1506 | 0 | result = GlobusSoapMessageErrorOutOfMemory; |
| 1507 | 0 | goto exit; |
| 1508 | } | |
| 1509 | ||
| 1510 | 0 | result = wsse_SecurityTokenReferenceType_array_init_contents(array); |
| 1511 | 0 | if(result != GLOBUS_SUCCESS) |
| 1512 | { | |
| 1513 | 0 | globus_free(array); |
| 1514 | 0 | array = NULL; |
| 1515 | ||
| 1516 | } | |
| 1517 | ||
| 1518 | 0 | *arr = array; |
| 1519 | ||
| 1520 | exit: | |
| 1521 | 0 | GlobusSoapMessageDebugExit(); |
| 1522 | 0 | return result; |
| 1523 | } | |
| 1524 | ||
| 1525 | void | |
| 1526 | wsse_SecurityTokenReferenceType_array_destroy_contents( | |
| 1527 | wsse_SecurityTokenReferenceType_array * array) | |
| 1528 | 0 | { |
| 1529 | 0 | int i = 0; |
| 1530 | 0 | GlobusFuncName(wsse_SecurityTokenReferenceType_array_destroy_contents); |
| 1531 | 0 | GlobusSoapMessageDebugEnter(); |
| 1532 | ||
| 1533 | 0 | for(; i < array->length; ++i) |
| 1534 | { | |
| 1535 | 0 | wsse_SecurityTokenReferenceType_destroy_contents(&array->elements[i]); |
| 1536 | } | |
| 1537 | ||
| 1538 | 0 | if(array->elements) |
| 1539 | { | |
| 1540 | 0 | globus_free(array->elements); |
| 1541 | 0 | array->elements = NULL; |
| 1542 | } | |
| 1543 | 0 | array->length = 0; |
| 1544 | ||
| 1545 | 0 | GlobusSoapMessageDebugExit(); |
| 1546 | } | |
| 1547 | ||
| 1548 | void | |
| 1549 | wsse_SecurityTokenReferenceType_array_destroy( | |
| 1550 | wsse_SecurityTokenReferenceType_array * array) | |
| 1551 | 0 | { |
| 1552 | 0 | GlobusFuncName(wsse_SecurityTokenReferenceType_array_destroy); |
| 1553 | 0 | GlobusSoapMessageDebugEnter(); |
| 1554 | ||
| 1555 | 0 | wsse_SecurityTokenReferenceType_array_destroy_contents(array); |
| 1556 | 0 | globus_free(array); |
| 1557 | ||
| 1558 | 0 | GlobusSoapMessageDebugExit(); |
| 1559 | } | |
| 1560 | ||
| 1561 | globus_result_t | |
| 1562 | wsse_SecurityTokenReferenceType_array_copy( | |
| 1563 | wsse_SecurityTokenReferenceType_array ** dest_arr, | |
| 1564 | const wsse_SecurityTokenReferenceType_array * src_arr) | |
| 1565 | 0 | { |
| 1566 | 0 | wsse_SecurityTokenReferenceType_array * array; |
| 1567 | 0 | globus_result_t result; |
| 1568 | 0 | GlobusFuncName(wsse_SecurityTokenReferenceType_array_copy); |
| 1569 | 0 | GlobusSoapMessageDebugEnter(); |
| 1570 | ||
| 1571 | 0 | array = (wsse_SecurityTokenReferenceType_array *) globus_malloc( |
| 1572 | sizeof(wsse_SecurityTokenReferenceType_array)); | |
| 1573 | 0 | if(!array) |
| 1574 | { | |
| 1575 | 0 | result = GlobusSoapMessageErrorOutOfMemory; |
| 1576 | 0 | GlobusSoapMessageDebugExit(); |
| 1577 | 0 | return result; |
| 1578 | } | |
| 1579 | ||
| 1580 | 0 | result = wsse_SecurityTokenReferenceType_array_copy_contents(array, src_arr); |
| 1581 | 0 | if(result != GLOBUS_SUCCESS) |
| 1582 | { | |
| 1583 | 0 | globus_free(array); |
| 1584 | 0 | GlobusSoapMessageDebugExit(); |
| 1585 | 0 | return result; |
| 1586 | } | |
| 1587 | ||
| 1588 | 0 | *dest_arr = array; |
| 1589 | ||
| 1590 | 0 | GlobusSoapMessageDebugExit(); |
| 1591 | 0 | return GLOBUS_SUCCESS; |
| 1592 | } | |
| 1593 | ||
| 1594 | globus_result_t | |
| 1595 | wsse_SecurityTokenReferenceType_array_copy_contents( | |
| 1596 | wsse_SecurityTokenReferenceType_array * dest_arr, | |
| 1597 | const wsse_SecurityTokenReferenceType_array * src_arr) | |
| 1598 | 0 | { |
| 1599 | 0 | int i; |
| 1600 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 1601 | 0 | GlobusFuncName(wsse_SecurityTokenReferenceType_array_copy_contents); |
| 1602 | 0 | GlobusSoapMessageDebugEnter(); |
| 1603 | ||
| 1604 | 0 | dest_arr->length = src_arr->length; |
| 1605 | 0 | if(dest_arr->length > 0) |
| 1606 | { | |
| 1607 | 0 | dest_arr->elements = (wsse_SecurityTokenReferenceType *) malloc( |
| 1608 | sizeof(wsse_SecurityTokenReferenceType) * dest_arr->length); | |
| 1609 | 0 | if(!dest_arr->elements) |
| 1610 | { | |
| 1611 | 0 | result = GlobusSoapMessageErrorOutOfMemory; |
| 1612 | 0 | GlobusSoapMessageDebugExit(); |
| 1613 | 0 | return result; |
| 1614 | } | |
| 1615 | } | |
| 1616 | else | |
| 1617 | { | |
| 1618 | 0 | dest_arr->elements = NULL; |
| 1619 | } | |
| 1620 | ||
| 1621 | 0 | for(i = 0; i < dest_arr->length; i++) |
| 1622 | { | |
| 1623 | 0 | result = wsse_SecurityTokenReferenceType_copy_contents( |
| 1624 | &dest_arr->elements[i], &src_arr->elements[i]); | |
| 1625 | 0 | if(result != GLOBUS_SUCCESS) |
| 1626 | { | |
| 1627 | 0 | while(i--) |
| 1628 | { | |
| 1629 | 0 | wsse_SecurityTokenReferenceType_destroy_contents(&dest_arr->elements[i]); |
| 1630 | } | |
| 1631 | ||
| 1632 | 0 | globus_free(dest_arr->elements); |
| 1633 | 0 | dest_arr->elements = NULL; |
| 1634 | 0 | dest_arr->length = 0; |
| 1635 | 0 | break; |
| 1636 | } | |
| 1637 | } | |
| 1638 | ||
| 1639 | 0 | GlobusSoapMessageDebugExit(); |
| 1640 | 0 | return result; |
| 1641 | } | |
| 1642 | ||
| 1643 | wsse_SecurityTokenReferenceType * | |
| 1644 | wsse_SecurityTokenReferenceType_array_push( | |
| 1645 | wsse_SecurityTokenReferenceType_array * array) | |
| 1646 | 0 | { |
| 1647 | 0 | GlobusFuncName(wsse_SecurityTokenReferenceType_array_push); |
| 1648 | 0 | GlobusSoapMessageDebugEnter(); |
| 1649 | ||
| 1650 | 0 | array->elements = realloc(array->elements, |
| 1651 | sizeof(wsse_SecurityTokenReferenceType) * | |
| 1652 | (array->length + 1)); | |
| 1653 | 0 | memset(&array->elements[array->length], 0, sizeof(wsse_SecurityTokenReferenceType)); |
| 1654 | 0 | array->length++; |
| 1655 | ||
| 1656 | 0 | GlobusSoapMessageDebugExit(); |
| 1657 | 0 | return (&array->elements[array->length - 1]); |
| 1658 | } | |
| 1659 | ||
| 1660 | void * | |
| 1661 | wsse_SecurityTokenReferenceType_array_push_wrapper( | |
| 1662 | void * array) | |
| 1663 | 0 | { |
| 1664 | 0 | return (void *) wsse_SecurityTokenReferenceType_array_push((wsse_SecurityTokenReferenceType_array *) array); |
| 1665 | } | |
| 1666 | ||
| 1667 | globus_result_t | |
| 1668 | wsse_SecurityTokenReferenceType_array_serialize( | |
| 1669 | xsd_QName * element_qname, | |
| 1670 | wsse_SecurityTokenReferenceType_array * array, | |
| 1671 | globus_soap_message_handle_t message, | |
| 1672 | globus_xsd_element_options_t options) | |
| 1673 | 0 | { |
| 1674 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 1675 | 0 | int i = 0; |
| 1676 | 0 | GlobusFuncName(wsse_SecurityTokenReferenceType_array_serialize); |
| 1677 | 0 | GlobusSoapMessageDebugEnter(); |
| 1678 | ||
| 1679 | 0 | for(; i < array->length; ++i) |
| 1680 | { | |
| 1681 | 0 | result = wsse_SecurityTokenReferenceType_serialize( |
| 1682 | element_qname, | |
| 1683 | &array->elements[i], | |
| 1684 | message, | |
| 1685 | options); | |
| 1686 | 0 | if(result != GLOBUS_SUCCESS) |
| 1687 | { | |
| 1688 | 0 | goto exit; |
| 1689 | } | |
| 1690 | } | |
| 1691 | ||
| 1692 | exit: | |
| 1693 | ||
| 1694 | 0 | GlobusSoapMessageDebugExit(); |
| 1695 | 0 | return result; |
| 1696 | } | |
| 1697 | ||
| 1698 | globus_result_t | |
| 1699 | wsse_SecurityTokenReferenceType_array_deserialize( | |
| 1700 | xsd_QName * element_qname, | |
| 1701 | wsse_SecurityTokenReferenceType_array * array, | |
| 1702 | globus_soap_message_handle_t message, | |
| 1703 | globus_xsd_element_options_t options) | |
| 1704 | 0 | { |
| 1705 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 1706 | 0 | int i = 0; |
| 1707 | 0 | int pre_length; |
| 1708 | 0 | GlobusFuncName(wsse_SecurityTokenReferenceType_array_deserialize); |
| 1709 | 0 | GlobusSoapMessageDebugEnter(); |
| 1710 | ||
| 1711 | 0 | pre_length = array->length; |
| 1712 | ||
| 1713 | 0 | for(i = 0; i < pre_length; ++i) |
| 1714 | { | |
| 1715 | 0 | result = wsse_SecurityTokenReferenceType_deserialize( |
| 1716 | element_qname, | |
| 1717 | &array->elements[i], | |
| 1718 | message, | |
| 1719 | options); | |
| 1720 | 0 | if(result != GLOBUS_SUCCESS) |
| 1721 | { | |
| 1722 | 0 | if(GlobusSoapMessageStatusFailedElementCheck(result) || |
| 1723 | GlobusSoapMessageStatusElementNotFoundCheck(result) || | |
| 1724 | GlobusSoapMessageStatusFailedWithTextCheck(result)) | |
| 1725 | { | |
| 1726 | 0 | result = GLOBUS_SUCCESS; |
| 1727 | 0 | break; |
| 1728 | } | |
| 1729 | ||
| 1730 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 1731 | result, element_qname); | |
| 1732 | 0 | goto exit; |
| 1733 | } | |
| 1734 | } | |
| 1735 | ||
| 1736 | 0 | while(result == GLOBUS_SUCCESS) |
| 1737 | { | |
| 1738 | 0 | wsse_SecurityTokenReferenceType next; |
| 1739 | 0 | memset(&next, 0, sizeof(wsse_SecurityTokenReferenceType)); |
| 1740 | ||
| 1741 | 0 | result = wsse_SecurityTokenReferenceType_deserialize( |
| 1742 | element_qname, | |
| 1743 | &next, | |
| 1744 | message, | |
| 1745 | options); | |
| 1746 | 0 | if(result != GLOBUS_SUCCESS) |
| 1747 | { | |
| 1748 | 0 | if(GlobusSoapMessageStatusFailedElementCheck(result) || |
| 1749 | GlobusSoapMessageStatusElementNotFoundCheck(result) || | |
| 1750 | GlobusSoapMessageStatusFailedWithTextCheck(result)) | |
| 1751 | { | |
| 1752 | 0 | result = GLOBUS_SUCCESS; |
| 1753 | 0 | break; |
| 1754 | } | |
| 1755 | ||
| 1756 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 1757 | result, element_qname); | |
| 1758 | 0 | goto exit; |
| 1759 | } | |
| 1760 | ||
| 1761 | 0 | array->elements = realloc( |
| 1762 | array->elements, | |
| 1763 | (array->length + 1) * sizeof(wsse_SecurityTokenReferenceType)); | |
| 1764 | 0 | if(!array->elements) |
| 1765 | { | |
| 1766 | 0 | result = GlobusSoapMessageErrorOutOfMemory; |
| 1767 | 0 | goto exit; |
| 1768 | } | |
| 1769 | 0 | array->elements[array->length] = next; |
| 1770 | 0 | array->length++; |
| 1771 | 0 | ++i; |
| 1772 | } | |
| 1773 | ||
| 1774 | exit: | |
| 1775 | ||
| 1776 | 0 | if(result != GLOBUS_SUCCESS) |
| 1777 | { | |
| 1778 | 0 | int di = 0; |
| 1779 | 0 | for(; di < i; ++di) |
| 1780 | { | |
| 1781 | 0 | wsse_SecurityTokenReferenceType_destroy_contents( |
| 1782 | &array->elements[di]); | |
| 1783 | 0 | memset(&array->elements[di], 0, sizeof(wsse_SecurityTokenReferenceType)); |
| 1784 | } | |
| 1785 | } | |
| 1786 | ||
| 1787 | 0 | GlobusSoapMessageDebugExit(); |
| 1788 | 0 | return result; |