| 1 | /* | |
| 2 | * Copyright 1999-2006 University of Chicago | |
| 3 | * | |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
| 5 | * you may not use this file except in compliance with the License. | |
| 6 | * You may obtain a copy of the License at | |
| 7 | * | |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 | |
| 9 | * | |
| 10 | * Unless required by applicable law or agreed to in writing, software | |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 13 | * See the License for the specific language governing permissions and | |
| 14 | * limitations under the License. | |
| 15 | */ | |
| 16 | ||
| 17 | ||
| 18 | /* | |
| 19 | * This file is automatically generated by the Globus WSDLtoC converter | |
| 20 | */ | |
| 21 | ||
| 22 | #include "xsd_QName.h" | |
| 23 | #include "globus_soap_message.h" | |
| 24 | #include "globus_xsd_type_info.h" | |
| 25 | #include "wst_RequestSecurityTokenType.h" | |
| 26 | ||
| 27 | #ifndef GLOBUS_DONT_DOCUMENT_INTERNAL | |
| 28 | xsd_QName wst_RequestSecurityTokenType_qname = | |
| 29 | { | |
| 30 | WST_REQUESTSECURITYTOKENTYPE_NS, | |
| 31 | WST_REQUESTSECURITYTOKENTYPE_LOCAL | |
| 32 | }; | |
| 33 | #endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */ | |
| 34 | ||
| 35 | globus_result_t | |
| 36 | wst_RequestSecurityTokenType_serialize_wrapper( | |
| 37 | const xsd_QName * element_qname, | |
| 38 | const void * instance, | |
| 39 | globus_soap_message_handle_t message_handle, | |
| 40 | globus_xsd_element_options_t options) | |
| 41 | 0 | { |
| 42 | 0 | return wst_RequestSecurityTokenType_serialize( |
| 43 | element_qname, | |
| 44 | (const wst_RequestSecurityTokenType *) instance, | |
| 45 | message_handle, options); | |
| 46 | } | |
| 47 | ||
| 48 | globus_result_t | |
| 49 | wst_RequestSecurityTokenType_deserialize_pointer_wrapper( | |
| 50 | const xsd_QName * element_qname, | |
| 51 | void ** ip, | |
| 52 | globus_soap_message_handle_t message_handle, | |
| 53 | globus_xsd_element_options_t options) | |
| 54 | 0 | { |
| 55 | 0 | return wst_RequestSecurityTokenType_deserialize_pointer( |
| 56 | element_qname, | |
| 57 | (wst_RequestSecurityTokenType **) ip, | |
| 58 | message_handle, options); | |
| 59 | } | |
| 60 | ||
| 61 | globus_result_t | |
| 62 | wst_RequestSecurityTokenType_init_wrapper(void **object) | |
| 63 | 0 | { |
| 64 | 0 | return wst_RequestSecurityTokenType_init( |
| 65 | (wst_RequestSecurityTokenType **) object); | |
| 66 | } | |
| 67 | ||
| 68 | void | |
| 69 | wst_RequestSecurityTokenType_destroy_wrapper( | |
| 70 | void * object) | |
| 71 | 0 | { |
| 72 | 0 | wst_RequestSecurityTokenType_destroy( |
| 73 | (wst_RequestSecurityTokenType *) object); | |
| 74 | } | |
| 75 | ||
| 76 | globus_result_t | |
| 77 | wst_RequestSecurityTokenType_copy_wrapper( | |
| 78 | void ** dest_obj, | |
| 79 | const void * src_obj) | |
| 80 | 0 | { |
| 81 | 0 | return wst_RequestSecurityTokenType_copy( |
| 82 | (wst_RequestSecurityTokenType **) dest_obj, | |
| 83 | (wst_RequestSecurityTokenType *) src_obj); | |
| 84 | } | |
| 85 | ||
| 86 | globus_result_t | |
| 87 | wst_RequestSecurityTokenType_init_contents_wrapper(void *object) | |
| 88 | 0 | { |
| 89 | 0 | return wst_RequestSecurityTokenType_init_contents( |
| 90 | (wst_RequestSecurityTokenType *) object); | |
| 91 | } | |
| 92 | ||
| 93 | void | |
| 94 | wst_RequestSecurityTokenType_destroy_contents_wrapper( | |
| 95 | void * object) | |
| 96 | 0 | { |
| 97 | 0 | wst_RequestSecurityTokenType_destroy_contents( |
| 98 | (wst_RequestSecurityTokenType *) object); | |
| 99 | } | |
| 100 | ||
| 101 | globus_result_t | |
| 102 | wst_RequestSecurityTokenType_copy_contents_wrapper( | |
| 103 | void * dest_obj, | |
| 104 | const void * src_obj) | |
| 105 | 0 | { |
| 106 | 0 | return wst_RequestSecurityTokenType_copy_contents( |
| 107 | (wst_RequestSecurityTokenType *) dest_obj, | |
| 108 | (const wst_RequestSecurityTokenType *) src_obj); | |
| 109 | } | |
| 110 | ||
| 111 | globus_result_t | |
| 112 | wst_RequestSecurityTokenType_serialize_contents_wrapper( | |
| 113 | const xsd_QName * element_qname, | |
| 114 | const void * instance, | |
| 115 | globus_soap_message_handle_t message_handle, | |
| 116 | globus_xsd_element_options_t options) | |
| 117 | 0 | { |
| 118 | 0 | return wst_RequestSecurityTokenType_serialize_contents( |
| 119 | element_qname, | |
| 120 | (wst_RequestSecurityTokenType *) instance, | |
| 121 | message_handle, options); | |
| 122 | } | |
| 123 | ||
| 124 | globus_result_t | |
| 125 | wst_RequestSecurityTokenType_deserialize_contents_wrapper( | |
| 126 | const xsd_QName * element_qname, | |
| 127 | void ** instance, | |
| 128 | globus_soap_message_handle_t message_handle, | |
| 129 | globus_xsd_element_options_t options) | |
| 130 | 0 | { |
| 131 | 0 | globus_result_t result; |
| 132 | 0 | GlobusFuncName(wst_RequestSecurityTokenType_deserialize_contents_wrapper); |
| 133 | 0 | GlobusSoapMessageDebugEnter(); |
| 134 | ||
| 135 | 0 | if(!*instance) |
| 136 | { | |
| 137 | 0 | result = wst_RequestSecurityTokenType_init( |
| 138 | (wst_RequestSecurityTokenType **)instance); | |
| 139 | 0 | if(result != GLOBUS_SUCCESS) |
| 140 | { | |
| 141 | 0 | goto error; |
| 142 | } | |
| 143 | } | |
| 144 | ||
| 145 | 0 | result = wst_RequestSecurityTokenType_deserialize_contents( |
| 146 | element_qname, | |
| 147 | *(wst_RequestSecurityTokenType **)instance, | |
| 148 | message_handle, options); | |
| 149 | error: | |
| 150 | 0 | GlobusSoapMessageDebugExit(); |
| 151 | 0 | return result; |
| 152 | } | |
| 153 | ||
| 154 | globus_result_t | |
| 155 | wst_RequestSecurityTokenType_array_serialize_wrapper( | |
| 156 | const xsd_QName * element, | |
| 157 | const void * instance, | |
| 158 | globus_soap_message_handle_t message, | |
| 159 | globus_xsd_element_options_t options) | |
| 160 | 0 | { |
| 161 | 0 | return wst_RequestSecurityTokenType_array_serialize( |
| 162 | element, | |
| 163 | (wst_RequestSecurityTokenType_array *) instance, | |
| 164 | message, options); | |
| 165 | } | |
| 166 | ||
| 167 | globus_result_t | |
| 168 | wst_RequestSecurityTokenType_array_deserialize_wrapper( | |
| 169 | const xsd_QName * element_qname, | |
| 170 | void ** inst, | |
| 171 | globus_soap_message_handle_t message, | |
| 172 | globus_xsd_element_options_t options) | |
| 173 | 0 | { |
| 174 | 0 | if(!*inst) |
| 175 | { | |
| 176 | 0 | globus_result_t result; |
| 177 | ||
| 178 | 0 | result = wst_RequestSecurityTokenType_array_init( |
| 179 | (wst_RequestSecurityTokenType_array **)inst); | |
| 180 | 0 | if(result != GLOBUS_SUCCESS) |
| 181 | { | |
| 182 | 0 | return result; |
| 183 | } | |
| 184 | } | |
| 185 | ||
| 186 | 0 | return wst_RequestSecurityTokenType_array_deserialize( |
| 187 | element_qname, | |
| 188 | *(wst_RequestSecurityTokenType_array **) inst, | |
| 189 | message, options); | |
| 190 | } | |
| 191 | ||
| 192 | globus_result_t | |
| 193 | wst_RequestSecurityTokenType_array_init_wrapper( | |
| 194 | void ** arr) | |
| 195 | 0 | { |
| 196 | 0 | return wst_RequestSecurityTokenType_array_init( |
| 197 | (wst_RequestSecurityTokenType_array **) arr); | |
| 198 | } | |
| 199 | ||
| 200 | void | |
| 201 | wst_RequestSecurityTokenType_array_destroy_wrapper( | |
| 202 | void * arr) | |
| 203 | 0 | { |
| 204 | 0 | wst_RequestSecurityTokenType_array_destroy( |
| 205 | (wst_RequestSecurityTokenType_array *) arr); | |
| 206 | } | |
| 207 | ||
| 208 | globus_result_t | |
| 209 | wst_RequestSecurityTokenType_array_copy_wrapper( | |
| 210 | void ** dest_arr, | |
| 211 | const void * src_arr) | |
| 212 | 0 | { |
| 213 | 0 | return wst_RequestSecurityTokenType_array_copy( |
| 214 | (wst_RequestSecurityTokenType_array **) dest_arr, | |
| 215 | (const wst_RequestSecurityTokenType_array *) src_arr); | |
| 216 | } | |
| 217 | ||
| 218 | globus_result_t | |
| 219 | wst_RequestSecurityTokenType_array_init_contents_wrapper( | |
| 220 | void * arr) | |
| 221 | 0 | { |
| 222 | 0 | return wst_RequestSecurityTokenType_array_init_contents( |
| 223 | (wst_RequestSecurityTokenType_array *) arr); | |
| 224 | } | |
| 225 | ||
| 226 | void | |
| 227 | wst_RequestSecurityTokenType_array_destroy_contents_wrapper( | |
| 228 | void * arr) | |
| 229 | 0 | { |
| 230 | 0 | wst_RequestSecurityTokenType_array_destroy_contents( |
| 231 | (wst_RequestSecurityTokenType_array *) arr); | |
| 232 | } | |
| 233 | ||
| 234 | globus_result_t | |
| 235 | wst_RequestSecurityTokenType_array_copy_contents_wrapper( | |
| 236 | void * dest_arr, | |
| 237 | const void * src_arr) | |
| 238 | 0 | { |
| 239 | 0 | return wst_RequestSecurityTokenType_array_copy_contents( |
| 240 | (wst_RequestSecurityTokenType_array *) dest_arr, | |
| 241 | (const wst_RequestSecurityTokenType_array *) src_arr); | |
| 242 | } | |
| 243 | ||
| 244 | struct globus_xsd_type_info_s wst_RequestSecurityTokenType_contents_info = | |
| 245 | { | |
| 246 | &wst_RequestSecurityTokenType_qname, | |
| 247 | wst_RequestSecurityTokenType_serialize_contents_wrapper, | |
| 248 | wst_RequestSecurityTokenType_deserialize_contents_wrapper, | |
| 249 | wst_RequestSecurityTokenType_init_wrapper, | |
| 250 | wst_RequestSecurityTokenType_destroy_wrapper, | |
| 251 | wst_RequestSecurityTokenType_copy_wrapper, | |
| 252 | wst_RequestSecurityTokenType_init_contents_wrapper, | |
| 253 | wst_RequestSecurityTokenType_destroy_contents_wrapper, | |
| 254 | wst_RequestSecurityTokenType_copy_contents_wrapper, | |
| 255 | sizeof(wst_RequestSecurityTokenType), | |
| 256 | NULL, | |
| 257 | NULL, | |
| 258 | NULL | |
| 259 | }; | |
| 260 | ||
| 261 | struct globus_xsd_type_info_s wst_RequestSecurityTokenType_array_info = | |
| 262 | { | |
| 263 | &wst_RequestSecurityTokenType_qname, | |
| 264 | wst_RequestSecurityTokenType_array_serialize_wrapper, | |
| 265 | wst_RequestSecurityTokenType_array_deserialize_wrapper, | |
| 266 | wst_RequestSecurityTokenType_array_init_wrapper, | |
| 267 | wst_RequestSecurityTokenType_array_destroy_wrapper, | |
| 268 | wst_RequestSecurityTokenType_array_copy_wrapper, | |
| 269 | wst_RequestSecurityTokenType_array_init_contents_wrapper, | |
| 270 | wst_RequestSecurityTokenType_array_destroy_contents_wrapper, | |
| 271 | wst_RequestSecurityTokenType_array_copy_contents_wrapper, | |
| 272 | sizeof(wst_RequestSecurityTokenType), | |
| 273 | wst_RequestSecurityTokenType_array_push_wrapper, | |
| 274 | NULL, | |
| 275 | NULL | |
| 276 | }; | |
| 277 | ||
| 278 | struct globus_xsd_type_info_s wst_RequestSecurityTokenType_info = | |
| 279 | { | |
| 280 | &wst_RequestSecurityTokenType_qname, | |
| 281 | wst_RequestSecurityTokenType_serialize_wrapper, | |
| 282 | wst_RequestSecurityTokenType_deserialize_pointer_wrapper, | |
| 283 | wst_RequestSecurityTokenType_init_wrapper, | |
| 284 | wst_RequestSecurityTokenType_destroy_wrapper, | |
| 285 | wst_RequestSecurityTokenType_copy_wrapper, | |
| 286 | wst_RequestSecurityTokenType_init_contents_wrapper, | |
| 287 | wst_RequestSecurityTokenType_destroy_contents_wrapper, | |
| 288 | wst_RequestSecurityTokenType_copy_contents_wrapper, | |
| 289 | sizeof(wst_RequestSecurityTokenType), | |
| 290 | NULL, | |
| 291 | &wst_RequestSecurityTokenType_contents_info, | |
| 292 | &wst_RequestSecurityTokenType_array_info | |
| 293 | }; | |
| 294 | ||
| 295 | globus_result_t | |
| 296 | wst_RequestSecurityTokenType_init_contents( | |
| 297 | wst_RequestSecurityTokenType * instance) | |
| 298 | 0 | { |
| 299 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 300 | 0 | GlobusFuncName(wst_RequestSecurityTokenType_init_contents); |
| 301 | 0 | GlobusSoapMessageDebugEnter(); |
| 302 | ||
| 303 | 0 | memset(instance, 0, sizeof(wst_RequestSecurityTokenType)); |
| 304 | ||
| 305 | 0 | GlobusSoapMessageDebugExit(); |
| 306 | 0 | return result; |
| 307 | } | |
| 308 | ||
| 309 | globus_result_t | |
| 310 | wst_RequestSecurityTokenType_init( | |
| 311 | wst_RequestSecurityTokenType ** object) | |
| 312 | 0 | { |
| 313 | 0 | wst_RequestSecurityTokenType * instance; |
| 314 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 315 | 0 | GlobusFuncName(wst_RequestSecurityTokenType_init); |
| 316 | 0 | GlobusSoapMessageDebugEnter(); |
| 317 | ||
| 318 | 0 | instance = globus_malloc(sizeof(wst_RequestSecurityTokenType)); |
| 319 | 0 | if(!instance) |
| 320 | { | |
| 321 | 0 | result = GlobusSoapMessageErrorOutOfMemory; |
| 322 | 0 | goto exit; |
| 323 | } | |
| 324 | ||
| 325 | 0 | memset(instance, 0, sizeof(wst_RequestSecurityTokenType)); |
| 326 | ||
| 327 | 0 | *object = instance; |
| 328 | ||
| 329 | exit: | |
| 330 | 0 | GlobusSoapMessageDebugExit(); |
| 331 | 0 | return result; |
| 332 | } | |
| 333 | ||
| 334 | void | |
| 335 | wst_RequestSecurityTokenType_destroy( | |
| 336 | wst_RequestSecurityTokenType * instance) | |
| 337 | 0 | { |
| 338 | 0 | GlobusFuncName(wst_RequestSecurityTokenType_destroy); |
| 339 | 0 | GlobusSoapMessageDebugEnter(); |
| 340 | ||
| 341 | 0 | if(!instance) |
| 342 | { | |
| 343 | 0 | goto exit; |
| 344 | } | |
| 345 | ||
| 346 | 0 | wst_RequestSecurityTokenType_destroy_contents(instance); |
| 347 | 0 | globus_free(instance); |
| 348 | ||
| 349 | exit: | |
| 350 | ||
| 351 | 0 | GlobusSoapMessageDebugExit(); |
| 352 | } | |
| 353 | ||
| 354 | ||
| 355 | void | |
| 356 | wst_RequestSecurityTokenType_destroy_contents( | |
| 357 | wst_RequestSecurityTokenType * instance) | |
| 358 | 0 | { |
| 359 | 0 | GlobusFuncName(wst_RequestSecurityTokenType_destroy_contents); |
| 360 | 0 | GlobusSoapMessageDebugEnter(); |
| 361 | ||
| 362 | 0 | if(instance) |
| 363 | { | |
| 364 | ||
| 365 | ||
| 366 | 0 | xsd_any_array_destroy_contents(&instance->any); |
| 367 | ||
| 368 | 0 | xsd_anyAttributes_destroy(instance->anyAttributes); |
| 369 | 0 | instance->anyAttributes = NULL; |
| 370 | ||
| 371 | 0 | if(instance->_Context) |
| 372 | { | |
| 373 | 0 | xsd_anyURI_destroy( |
| 374 | instance->_Context); | |
| 375 | 0 | instance->_Context = NULL; |
| 376 | } | |
| 377 | ||
| 378 | } | |
| 379 | ||
| 380 | 0 | GlobusSoapMessageDebugExit(); |
| 381 | } | |
| 382 | ||
| 383 | ||
| 384 | globus_result_t | |
| 385 | wst_RequestSecurityTokenType_copy( | |
| 386 | wst_RequestSecurityTokenType ** dest_obj, | |
| 387 | const wst_RequestSecurityTokenType * src_obj) | |
| 388 | 0 | { |
| 389 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 390 | 0 | wst_RequestSecurityTokenType * instance; |
| 391 | 0 | GlobusFuncName(wst_RequestSecurityTokenType_copy); |
| 392 | ||
| 393 | 0 | GlobusSoapMessageDebugEnter(); |
| 394 | ||
| 395 | 0 | instance = calloc(1, sizeof(wst_RequestSecurityTokenType)); |
| 396 | 0 | if (instance == NULL) |
| 397 | { | |
| 398 | 0 | GlobusSoapMessageDebugExit(); |
| 399 | 0 | return GlobusSoapMessageErrorOutOfMemory; |
| 400 | } | |
| 401 | ||
| 402 | 0 | result = wst_RequestSecurityTokenType_copy_contents(instance, src_obj); |
| 403 | 0 | if(result != GLOBUS_SUCCESS) |
| 404 | { | |
| 405 | 0 | globus_free(instance); |
| 406 | 0 | GlobusSoapMessageDebugExit(); |
| 407 | 0 | return GlobusSoapMessageErrorOutOfMemory; |
| 408 | } | |
| 409 | ||
| 410 | 0 | *dest_obj = instance; |
| 411 | 0 | GlobusSoapMessageDebugExit(); |
| 412 | 0 | return result; |
| 413 | } | |
| 414 | ||
| 415 | globus_result_t | |
| 416 | wst_RequestSecurityTokenType_copy_contents( | |
| 417 | wst_RequestSecurityTokenType * instance, | |
| 418 | const wst_RequestSecurityTokenType * src_obj) | |
| 419 | 0 | { |
| 420 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 421 | 0 | GlobusFuncName(wst_RequestSecurityTokenType_copy_contents); |
| 422 | ||
| 423 | 0 | GlobusSoapMessageDebugEnter(); |
| 424 | ||
| 425 | 0 | if(src_obj->anyAttributes) |
| 426 | { | |
| 427 | 0 | result = xsd_anyAttributes_copy(&instance->anyAttributes, |
| 428 | src_obj->anyAttributes); | |
| 429 | 0 | if(result != GLOBUS_SUCCESS) |
| 430 | { | |
| 431 | 0 | result = GlobusSoapMessageErrorCopyAnyAttrsFailed( |
| 432 | result, NULL); | |
| 433 | 0 | goto xsd_anyAttributes_after_destroy; |
| 434 | } | |
| 435 | } | |
| 436 | else | |
| 437 | { | |
| 438 | 0 | instance->anyAttributes = NULL; |
| 439 | } | |
| 440 | ||
| 441 | 0 | if(src_obj->_Context) |
| 442 | { | |
| 443 | 0 | result = xsd_anyURI_copy( |
| 444 | &instance->_Context, | |
| 445 | src_obj->_Context); | |
| 446 | 0 | if(result != GLOBUS_SUCCESS) |
| 447 | { | |
| 448 | 0 | result = GlobusSoapMessageErrorCopyFailed( |
| 449 | result, NULL, &xsd_anyURI_qname); | |
| 450 | 0 | goto _Context_destroy; |
| 451 | } | |
| 452 | } | |
| 453 | else | |
| 454 | { | |
| 455 | 0 | instance->_Context = NULL; |
| 456 | } | |
| 457 | ||
| 458 | 0 | result = xsd_any_array_copy_contents( |
| 459 | &instance->any, | |
| 460 | &src_obj->any); | |
| 461 | 0 | if(result != GLOBUS_SUCCESS) |
| 462 | { | |
| 463 | 0 | result = GlobusSoapMessageErrorCopyFailed( |
| 464 | result, NULL, &xsd_any_qname); | |
| 465 | 0 | goto any_destroy_array; |
| 466 | } | |
| 467 | ||
| 468 | 0 | goto exit; |
| 469 | ||
| 470 | fail_deserialize: | |
| 471 | ||
| 472 | xsd_anyAttributes_destroy: | |
| 473 | 0 | xsd_anyAttributes_destroy(instance->anyAttributes); |
| 474 | 0 | instance->anyAttributes = NULL; |
| 475 | xsd_anyAttributes_after_destroy: | |
| 476 | ||
| 477 | _Context_destroy: | |
| 478 | ||
| 479 | 0 | if(instance->_Context) |
| 480 | { | |
| 481 | 0 | xsd_anyURI_destroy( |
| 482 | instance->_Context); | |
| 483 | 0 | instance->_Context = NULL; |
| 484 | } | |
| 485 | 0 | xsd_any_array_destroy_contents( |
| 486 | &instance->any); | |
| 487 | ||
| 488 | any_destroy_array: | |
| 489 | ||
| 490 | ||
| 491 | exit: | |
| 492 | ||
| 493 | 0 | GlobusSoapMessageDebugExit(); |
| 494 | 0 | return result; |
| 495 | } | |
| 496 | ||
| 497 | ||
| 498 | ||
| 499 | globus_result_t | |
| 500 | wst_RequestSecurityTokenType_serialize_contents( | |
| 501 | const xsd_QName * element_qname, /* ignored */ | |
| 502 | const wst_RequestSecurityTokenType * inst, | |
| 503 | globus_soap_message_handle_t message_handle, | |
| 504 | globus_xsd_element_options_t options) | |
| 505 | 0 | { |
| 506 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 507 | 0 | GlobusFuncName(wst_RequestSecurityTokenType_serialize_contents); |
| 508 | 0 | GlobusSoapMessageDebugEnter(); |
| 509 | ||
| 510 | 0 | result = wst_RequestSecurityTokenType_serialize( |
| 511 | NULL, | |
| 512 | inst, | |
| 513 | message_handle, | |
| 514 | options | GLOBUS_XSD_ELEMENT_CONTENTS_ONLY); | |
| 515 | 0 | if(result != GLOBUS_SUCCESS) |
| 516 | { | |
| 517 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 518 | result, NULL, element_qname); | |
| 519 | goto exit; | |
| 520 | } | |
| 521 | ||
| 522 | exit: | |
| 523 | ||
| 524 | 0 | GlobusSoapMessageDebugExit(); |
| 525 | 0 | return result; |
| 526 | } | |
| 527 | ||
| 528 | ||
| 529 | ||
| 530 | globus_result_t | |
| 531 | wst_RequestSecurityTokenType_serialize( | |
| 532 | const xsd_QName * element_qname, | |
| 533 | const wst_RequestSecurityTokenType * instance, | |
| 534 | globus_soap_message_handle_t message_handle, | |
| 535 | globus_xsd_element_options_t options) | |
| 536 | 0 | { |
| 537 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 538 | 0 | xsd_QName subelement; |
| 539 | 0 | globus_list_t * any_attr_keys = NULL; |
| 540 | 0 | globus_list_t * any_attr_keys_iterator = NULL; |
| 541 | 0 | xsd_QName * type_attr = NULL; |
| 542 | ||
| 543 | 0 | char * prefix = NULL; |
| 544 | 0 | int prefix_created; |
| 545 | 0 | int define_prefix = 0; |
| 546 | 0 | int save_options = options; |
| 547 | ||
| 548 | 0 | GlobusFuncName(wst_RequestSecurityTokenType_serialize); |
| 549 | 0 | GlobusSoapMessageDebugEnter(); |
| 550 | ||
| 551 | ||
| 552 | 0 | if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY)) |
| 553 | { | |
| 554 | /* serialize wst_RequestSecurityTokenType element */ | |
| 555 | 0 | result = globus_soap_message_element_ns_set( |
| 556 | message_handle, | |
| 557 | element_qname, | |
| 558 | element_qname->Namespace, | |
| 559 | &options); | |
| 560 | 0 | if(result != GLOBUS_SUCCESS) |
| 561 | { | |
| 562 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 563 | result, NULL, element_qname); | |
| 564 | 0 | goto exit; |
| 565 | } | |
| 566 | ||
| 567 | { | |
| 568 | 0 | int ani; |
| 569 | ||
| 570 | 0 | for (ani = 0; ani < instance->any.length; ani++) |
| 571 | ||
| 572 | { | |
| 573 | /* | |
| 574 | int nsi; | |
| 575 | for (nsi = 0; nsi < instance->any.elements[ani].namespaces.length; nsi++) | |
| 576 | { | |
| 577 | if (instance->any.elements[ani].namespaces.elements[nsi] != NULL) | |
| 578 | { | |
| 579 | char * prefix; | |
| 580 | char * ns; | |
| 581 | prefix = globus_libc_strdup( | |
| 582 | instance->any.elements[ani].namespaces.elements[nsi]); | |
| 583 | if (prefix == NULL) | |
| 584 | { | |
| 585 | result = GlobusSoapMessageErrorOutOfMemory; | |
| 586 | ||
| 587 | goto exit; | |
| 588 | } | |
| 589 | ns = strchr(prefix, '='); | |
| 590 | if (ns == NULL) | |
| 591 | { | |
| 592 | free(prefix); | |
| 593 | ||
| 594 | result = GlobusSoapMessageErrorSerializeNamespaceFailed(ns, prefix); | |
| 595 | goto exit; | |
| 596 | } | |
| 597 | *(ns) = '\0'; | |
| 598 | ns++; | |
| 599 | result = globus_soap_message_serialize_ns_set_prefix( | |
| 600 | message_handle, | |
| 601 | element_qname, | |
| 602 | ns, | |
| 603 | prefix, | |
| 604 | &options); | |
| 605 | free(prefix); | |
| 606 | if(result != GLOBUS_SUCCESS) | |
| 607 | { | |
| 608 | goto exit; | |
| 609 | } | |
| 610 | } | |
| 611 | } | |
| 612 | */ | |
| 613 | } | |
| 614 | ||
| 615 | } | |
| 616 | ||
| 617 | 0 | if(((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) && |
| 618 | !globus_soap_message_serialize_is_c14n_subset(message_handle))) | |
| 619 | { | |
| 620 | 0 | result = globus_soap_message_attribute_ns_set( |
| 621 | message_handle, | |
| 622 | element_qname, | |
| 623 | "http://www.w3.org/2001/XMLSchema-instance", | |
| 624 | &options); | |
| 625 | 0 | if(result != GLOBUS_SUCCESS) |
| 626 | { | |
| 627 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 628 | result, NULL, element_qname); | |
| 629 | 0 | goto exit; |
| 630 | } | |
| 631 | } | |
| 632 | ||
| 633 | 0 | if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) && |
| 634 | !globus_soap_message_serialize_is_c14n_subset(message_handle)) | |
| 635 | { | |
| 636 | ||
| 637 | 0 | result = globus_soap_message_attribute_ns_set( |
| 638 | message_handle, | |
| 639 | element_qname, | |
| 640 | wst_RequestSecurityTokenType_qname.Namespace, | |
| 641 | &options); | |
| 642 | 0 | if(result != GLOBUS_SUCCESS) |
| 643 | { | |
| 644 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 645 | result, NULL, element_qname); | |
| 646 | 0 | goto exit; |
| 647 | } | |
| 648 | } | |
| 649 | ||
| 650 | 0 | result = xsd_anyAttributes_namespace_set( |
| 651 | message_handle, element_qname, instance->anyAttributes, &options); | |
| 652 | 0 | if(result != GLOBUS_SUCCESS) |
| 653 | { | |
| 654 | 0 | result = GlobusSoapMessageErrorSerializeAnyAttrsFailed( |
| 655 | result, "Failed to set namespace"); | |
| 656 | 0 | goto exit; |
| 657 | } | |
| 658 | ||
| 659 | 0 | if(instance->_Context) |
| 660 | { | |
| 661 | ||
| 662 | 0 | result = globus_soap_message_attribute_ns_set( |
| 663 | message_handle, | |
| 664 | element_qname, | |
| 665 | NULL, | |
| 666 | &options); | |
| 667 | ||
| 668 | 0 | if(result != GLOBUS_SUCCESS) |
| 669 | { | |
| 670 | 0 | xsd_QName error_qname; |
| 671 | 0 | error_qname.local = prefix; |
| 672 | 0 | error_qname.Namespace = ""; |
| 673 | 0 | result = GlobusSoapMessageErrorSerializeFailed(result, |
| 674 | NULL, | |
| 675 | &error_qname); | |
| 676 | 0 | goto exit; |
| 677 | } | |
| 678 | ||
| 679 | ||
| 680 | } | |
| 681 | ||
| 682 | 0 | result = globus_soap_message_serialize_element( |
| 683 | message_handle, | |
| 684 | element_qname, | |
| 685 | options, | |
| 686 | &wst_RequestSecurityTokenType_qname); | |
| 687 | 0 | if(result != GLOBUS_SUCCESS) |
| 688 | { | |
| 689 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 690 | result, NULL, element_qname); | |
| 691 | 0 | goto exit; |
| 692 | } | |
| 693 | ||
| 694 | 0 | if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) && |
| 695 | !globus_soap_message_serialize_is_c14n_subset(message_handle)) | |
| 696 | { | |
| 697 | 0 | xsd_QName_init(&type_attr); |
| 698 | ||
| 699 | 0 | type_attr->local = globus_libc_strdup("type"); |
| 700 | 0 | type_attr->Namespace = globus_libc_strdup(XSI_NS); |
| 701 | } | |
| 702 | ||
| 703 | ||
| 704 | /* serialize namespaces */ | |
| 705 | 0 | result = globus_soap_message_element_ns_add( |
| 706 | message_handle, | |
| 707 | element_qname, | |
| 708 | element_qname->Namespace, | |
| 709 | &options); | |
| 710 | 0 | if(result != GLOBUS_SUCCESS) |
| 711 | { | |
| 712 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 713 | result, NULL, element_qname); | |
| 714 | 0 | goto exit; |
| 715 | } | |
| 716 | ||
| 717 | { | |
| 718 | 0 | int ani; |
| 719 | ||
| 720 | 0 | for (ani = 0; ani < instance->any.length; ani++) |
| 721 | ||
| 722 | { | |
| 723 | /* | |
| 724 | int nsi; | |
| 725 | for (nsi = 0; nsi < instance->any.elements[ani].namespaces.length; nsi++) | |
| 726 | { | |
| 727 | if (instance->any.elements[ani].namespaces.elements[nsi] != NULL) | |
| 728 | { | |
| 729 | char * prefix; | |
| 730 | char * ns; | |
| 731 | ||
| 732 | prefix = globus_libc_strdup( | |
| 733 | instance->any.elements[ani].namespaces.elements[nsi]); | |
| 734 | if (prefix == NULL) | |
| 735 | { | |
| 736 | result = GlobusSoapMessageErrorOutOfMemory; | |
| 737 | ||
| 738 | goto exit; | |
| 739 | } | |
| 740 | ns = strchr(prefix, '='); | |
| 741 | if (ns == NULL) | |
| 742 | { | |
| 743 | free(prefix); | |
| 744 | ||
| 745 | result = GlobusSoapMessageErrorSerializeNamespaceFailed(ns, prefix); | |
| 746 | goto exit; | |
| 747 | } | |
| 748 | *(ns) = '\0'; | |
| 749 | ns++; | |
| 750 | result = globus_soap_message_serialize_ns_add_prefix( | |
| 751 | message_handle, | |
| 752 | element_qname, | |
| 753 | ns, | |
| 754 | prefix, | |
| 755 | &options); | |
| 756 | free(prefix); | |
| 757 | if(result != GLOBUS_SUCCESS) | |
| 758 | { | |
| 759 | goto exit; | |
| 760 | } | |
| 761 | } | |
| 762 | } | |
| 763 | */ | |
| 764 | } | |
| 765 | ||
| 766 | } | |
| 767 | ||
| 768 | 0 | if(((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) && |
| 769 | !globus_soap_message_serialize_is_c14n_subset(message_handle))) | |
| 770 | { | |
| 771 | 0 | result = globus_soap_message_attribute_ns_add( |
| 772 | message_handle, | |
| 773 | element_qname, | |
| 774 | "http://www.w3.org/2001/XMLSchema-instance", | |
| 775 | &options); | |
| 776 | 0 | if(result != GLOBUS_SUCCESS) |
| 777 | { | |
| 778 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 779 | result, NULL, element_qname); | |
| 780 | 0 | goto exit; |
| 781 | } | |
| 782 | } | |
| 783 | 0 | if ((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) && |
| 784 | !globus_soap_message_serialize_is_c14n_subset(message_handle)) | |
| 785 | { | |
| 786 | ||
| 787 | 0 | result = globus_soap_message_attribute_ns_add( |
| 788 | message_handle, | |
| 789 | element_qname, | |
| 790 | wst_RequestSecurityTokenType_qname.Namespace, | |
| 791 | &options); | |
| 792 | 0 | if(result != GLOBUS_SUCCESS) |
| 793 | { | |
| 794 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 795 | result, NULL, element_qname); | |
| 796 | 0 | goto exit; |
| 797 | } | |
| 798 | } | |
| 799 | ||
| 800 | 0 | result = xsd_anyAttributes_namespace_add( |
| 801 | message_handle, element_qname, instance->anyAttributes, &options); | |
| 802 | 0 | if(result != GLOBUS_SUCCESS) |
| 803 | { | |
| 804 | 0 | result = GlobusSoapMessageErrorSerializeAnyAttrsFailed( |
| 805 | result, "Failed to add namespace"); | |
| 806 | 0 | goto exit; |
| 807 | } | |
| 808 | ||
| 809 | 0 | if(instance->_Context) |
| 810 | { | |
| 811 | ||
| 812 | 0 | result = globus_soap_message_attribute_ns_add( |
| 813 | message_handle, | |
| 814 | element_qname, | |
| 815 | NULL, | |
| 816 | &options); | |
| 817 | ||
| 818 | 0 | if(result != GLOBUS_SUCCESS) |
| 819 | { | |
| 820 | 0 | xsd_QName error_qname; |
| 821 | 0 | error_qname.local = prefix; |
| 822 | 0 | error_qname.Namespace = ""; |
| 823 | 0 | result = GlobusSoapMessageErrorSerializeFailed(result, |
| 824 | NULL, | |
| 825 | &error_qname); | |
| 826 | 0 | goto exit; |
| 827 | } | |
| 828 | ||
| 829 | ||
| 830 | } | |
| 831 | ||
| 832 | /* serialize attributes */ | |
| 833 | ||
| 834 | 0 | if(instance->anyAttributes) |
| 835 | { | |
| 836 | 0 | any_attr_keys = xsd_anyAttributes_lex_sort( |
| 837 | instance->anyAttributes); | |
| 838 | 0 | any_attr_keys_iterator = any_attr_keys; |
| 839 | } | |
| 840 | ||
| 841 | 0 | subelement.Namespace = ""; |
| 842 | 0 | subelement.local = "Context"; |
| 843 | ||
| 844 | 0 | if(any_attr_keys_iterator) |
| 845 | { | |
| 846 | 0 | result = xsd_anyAttributes_serialize_lex_before( |
| 847 | message_handle, | |
| 848 | &any_attr_keys_iterator, | |
| 849 | instance->anyAttributes, | |
| 850 | &subelement); | |
| 851 | 0 | if(result != GLOBUS_SUCCESS) |
| 852 | { | |
| 853 | 0 | result = GlobusSoapMessageErrorSerializeFailed(result, |
| 854 | NULL, | |
| 855 | element_qname); | |
| 856 | 0 | goto exit; |
| 857 | } | |
| 858 | } | |
| 859 | ||
| 860 | 0 | if(instance->_Context) |
| 861 | { | |
| 862 | ||
| 863 | 0 | result = xsd_anyURI_serialize_attribute( |
| 864 | &subelement, | |
| 865 | instance->_Context, | |
| 866 | message_handle, | |
| 867 | options & (~GLOBUS_XSD_ELEMENT_SET_DEFAULT_NS)); | |
| 868 | 0 | if(result != GLOBUS_SUCCESS) |
| 869 | { | |
| 870 | 0 | result = GlobusSoapMessageErrorSerializeFailed(result, |
| 871 | NULL, | |
| 872 | element_qname); | |
| 873 | 0 | goto exit; |
| 874 | } | |
| 875 | ||
| 876 | } | |
| 877 | ||
| 878 | 0 | if(any_attr_keys_iterator) |
| 879 | { | |
| 880 | 0 | result = xsd_anyAttributes_serialize_lex_before( |
| 881 | message_handle, | |
| 882 | &any_attr_keys_iterator, | |
| 883 | instance->anyAttributes, | |
| 884 | type_attr); | |
| 885 | 0 | if(result != GLOBUS_SUCCESS) |
| 886 | { | |
| 887 | 0 | result = GlobusSoapMessageErrorSerializeFailed(result, |
| 888 | NULL, | |
| 889 | element_qname); | |
| 890 | 0 | goto exit; |
| 891 | } | |
| 892 | } | |
| 893 | ||
| 894 | 0 | if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) && |
| 895 | !globus_soap_message_serialize_is_c14n_subset(message_handle)) | |
| 896 | { | |
| 897 | 0 | result = globus_soap_message_serialize_QName_attribute( |
| 898 | message_handle, | |
| 899 | type_attr, | |
| 900 | &wst_RequestSecurityTokenType_qname); | |
| 901 | 0 | if(result != GLOBUS_SUCCESS) |
| 902 | { | |
| 903 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 904 | result, NULL, element_qname); | |
| 905 | 0 | goto exit; |
| 906 | } | |
| 907 | } | |
| 908 | ||
| 909 | ||
| 910 | } | |
| 911 | ||
| 912 | 0 | if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY)) |
| 913 | { | |
| 914 | 0 | result = globus_soap_message_serialize_element_begin_close( |
| 915 | message_handle, element_qname); | |
| 916 | 0 | if(result != GLOBUS_SUCCESS) |
| 917 | { | |
| 918 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 919 | result, NULL, element_qname); | |
| 920 | 0 | goto exit; |
| 921 | } | |
| 922 | } | |
| 923 | 0 | options &= ~GLOBUS_XSD_ELEMENT_CONTENTS_ONLY; |
| 924 | ||
| 925 | ||
| 926 | /* serialize contents of type */ | |
| 927 | ||
| 928 | 0 | subelement.local = "any"; |
| 929 | 0 | subelement.Namespace = "http://www.w3.org/2001/XMLSchema"; |
| 930 | ||
| 931 | 0 | result = xsd_any_array_serialize( |
| 932 | &subelement, | |
| 933 | &instance->any, | |
| 934 | message_handle, | |
| 935 | options & (~GLOBUS_XSD_ELEMENT_SET_DEFAULT_NS)); | |
| 936 | 0 | if(result != GLOBUS_SUCCESS) |
| 937 | { | |
| 938 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 939 | result, NULL, &xsd_any_qname); | |
| 940 | 0 | goto exit; |
| 941 | } | |
| 942 | ||
| 943 | 0 | options = save_options; |
| 944 | ||
| 945 | 0 | if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY)) |
| 946 | { | |
| 947 | /* add end element */ | |
| 948 | 0 | result = globus_soap_message_serialize_element_end( |
| 949 | message_handle, | |
| 950 | element_qname, | |
| 951 | options, | |
| 952 | &wst_RequestSecurityTokenType_qname); | |
| 953 | 0 | if(result != GLOBUS_SUCCESS) |
| 954 | { | |
| 955 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 956 | result, NULL, element_qname); | |
| 957 | 0 | goto exit; |
| 958 | } | |
| 959 | ||
| 960 | 0 | globus_soap_message_element_ns_remove( |
| 961 | message_handle, | |
| 962 | element_qname->Namespace, | |
| 963 | &options); | |
| 964 | ||
| 965 | /* remove namespace/prefix mappings for these types */ | |
| 966 | ||
| 967 | { | |
| 968 | 0 | int ani; |
| 969 | ||
| 970 | 0 | for (ani = 0; ani < instance->any.length; ani++) |
| 971 | ||
| 972 | { | |
| 973 | /* | |
| 974 | int nsi; | |
| 975 | for (nsi = 0; nsi < instance->any.elements[ani].namespaces.length; nsi++) | |
| 976 | { | |
| 977 | if (instance->any.elements[ani].namespaces.elements[nsi] != NULL) | |
| 978 | { | |
| 979 | char * prefix; | |
| 980 | char * ns; | |
| 981 | ||
| 982 | prefix = globus_libc_strdup( | |
| 983 | instance->any.elements[ani].namespaces.elements[nsi]); | |
| 984 | if (prefix == NULL) | |
| 985 | { | |
| 986 | result = GlobusSoapMessageErrorOutOfMemory; | |
| 987 | ||
| 988 | goto exit; | |
| 989 | } | |
| 990 | ns = strchr(prefix, '='); | |
| 991 | if (ns == NULL) | |
| 992 | { | |
| 993 | free(prefix); | |
| 994 | ||
| 995 | result = GlobusSoapMessageErrorSerializeNamespaceFailed(ns, prefix); | |
| 996 | goto exit; | |
| 997 | } | |
| 998 | *(ns) = '\0'; | |
| 999 | ns++; | |
| 1000 | ||
| 1001 | globus_soap_message_serialize_ns_remove_prefix( | |
| 1002 | message_handle, | |
| 1003 | ns, | |
| 1004 | prefix, | |
| 1005 | &options); | |
| 1006 | free(prefix); | |
| 1007 | } | |
| 1008 | } | |
| 1009 | */ | |
| 1010 | } | |
| 1011 | ||
| 1012 | } | |
| 1013 | ||
| 1014 | 0 | if(((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) && |
| 1015 | !globus_soap_message_serialize_is_c14n_subset(message_handle))) | |
| 1016 | { | |
| 1017 | 0 | globus_soap_message_attribute_ns_remove( |
| 1018 | message_handle, | |
| 1019 | "http://www.w3.org/2001/XMLSchema-instance", | |
| 1020 | &options); | |
| 1021 | } | |
| 1022 | 0 | if((options & GLOBUS_XSD_ELEMENT_TYPE_ATTR) && |
| 1023 | !globus_soap_message_serialize_is_c14n_subset(message_handle)) | |
| 1024 | { | |
| 1025 | 0 | globus_soap_message_attribute_ns_remove( |
| 1026 | message_handle, | |
| 1027 | wst_RequestSecurityTokenType_qname.Namespace, | |
| 1028 | &options); | |
| 1029 | } | |
| 1030 | ||
| 1031 | 0 | result = xsd_anyAttributes_namespace_remove( |
| 1032 | message_handle, instance->anyAttributes, &options); | |
| 1033 | 0 | if(result != GLOBUS_SUCCESS) |
| 1034 | { | |
| 1035 | 0 | result = GlobusSoapMessageErrorSerializeAnyAttrsFailed( |
| 1036 | result, "Failed to remove namespace"); | |
| 1037 | 0 | goto exit; |
| 1038 | } | |
| 1039 | ||
| 1040 | 0 | if(instance->_Context) |
| 1041 | { | |
| 1042 | ||
| 1043 | 0 | globus_soap_message_attribute_ns_remove( |
| 1044 | message_handle, | |
| 1045 | NULL, | |
| 1046 | &options); | |
| 1047 | ||
| 1048 | } | |
| 1049 | ||
| 1050 | } | |
| 1051 | ||
| 1052 | exit: | |
| 1053 | 0 | if (type_attr) |
| 1054 | { | |
| 1055 | 0 | xsd_QName_destroy(type_attr); |
| 1056 | } | |
| 1057 | ||
| 1058 | ||
| 1059 | 0 | if(any_attr_keys) |
| 1060 | { | |
| 1061 | 0 | globus_list_free(any_attr_keys); |
| 1062 | } | |
| 1063 | ||
| 1064 | 0 | GlobusSoapMessageDebugExit(); |
| 1065 | 0 | return result; |
| 1066 | } | |
| 1067 | ||
| 1068 | ||
| 1069 | ||
| 1070 | globus_result_t | |
| 1071 | wst_RequestSecurityTokenType_deserialize_contents( | |
| 1072 | const xsd_QName * element_qname, /* ignored */ | |
| 1073 | wst_RequestSecurityTokenType * inst, | |
| 1074 | globus_soap_message_handle_t message_handle, | |
| 1075 | globus_xsd_element_options_t options) | |
| 1076 | 0 | { |
| 1077 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 1078 | 0 | GlobusFuncName(wst_RequestSecurityTokenType_deserialize_contents); |
| 1079 | 0 | GlobusSoapMessageDebugEnter(); |
| 1080 | ||
| 1081 | 0 | result = wst_RequestSecurityTokenType_deserialize( |
| 1082 | NULL, | |
| 1083 | inst, | |
| 1084 | message_handle, | |
| 1085 | options | GLOBUS_XSD_ELEMENT_CONTENTS_ONLY); | |
| 1086 | 0 | if(result != GLOBUS_SUCCESS) |
| 1087 | { | |
| 1088 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 1089 | result, element_qname); | |
| 1090 | goto exit; | |
| 1091 | } | |
| 1092 | ||
| 1093 | exit: | |
| 1094 | ||
| 1095 | 0 | GlobusSoapMessageDebugExit(); |
| 1096 | 0 | return result; |
| 1097 | } | |
| 1098 | ||
| 1099 | ||
| 1100 | ||
| 1101 | globus_result_t | |
| 1102 | wst_RequestSecurityTokenType_deserialize( | |
| 1103 | const xsd_QName * element_qname, | |
| 1104 | wst_RequestSecurityTokenType * instance, | |
| 1105 | globus_soap_message_handle_t message_handle, | |
| 1106 | globus_xsd_element_options_t options) | |
| 1107 | 0 | { |
| 1108 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 1109 | 0 | xsd_QName subelement; |
| 1110 | 0 | GlobusFuncName(wst_RequestSecurityTokenType_deserialize); |
| 1111 | 0 | GlobusSoapMessageDebugEnter(); |
| 1112 | ||
| 1113 | ||
| 1114 | 0 | if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY)) |
| 1115 | { | |
| 1116 | 0 | result = globus_soap_message_deserialize_element( |
| 1117 | message_handle, element_qname); | |
| 1118 | 0 | if(result != GLOBUS_SUCCESS) |
| 1119 | { | |
| 1120 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 1121 | result, element_qname); | |
| 1122 | 0 | goto exit; |
| 1123 | } | |
| 1124 | ||
| 1125 | 0 | result = xsd_anyAttributes_init(&instance->anyAttributes); |
| 1126 | 0 | if(result != GLOBUS_SUCCESS) |
| 1127 | { | |
| 1128 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 1129 | result, element_qname); | |
| 1130 | 0 | goto xsd_anyAttributes_after_destroy; |
| 1131 | } | |
| 1132 | ||
| 1133 | 0 | result = xsd_anyAttributes_deserialize( |
| 1134 | message_handle, | |
| 1135 | instance->anyAttributes); | |
| 1136 | 0 | if(result != GLOBUS_SUCCESS) |
| 1137 | { | |
| 1138 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 1139 | result, element_qname); | |
| 1140 | 0 | goto xsd_anyAttributes_destroy; |
| 1141 | } | |
| 1142 | ||
| 1143 | 0 | subelement.Namespace = ""; |
| 1144 | 0 | subelement.local = "Context"; |
| 1145 | ||
| 1146 | 0 | result = xsd_anyURI_deserialize_attribute_pointer( |
| 1147 | &subelement, | |
| 1148 | &instance->_Context, | |
| 1149 | message_handle, | |
| 1150 | 0); | |
| 1151 | 0 | if(result != GLOBUS_SUCCESS) |
| 1152 | { | |
| 1153 | 0 | result = GlobusSoapMessageErrorDeserializeFailed(result, &subelement); |
| 1154 | 0 | goto _Context_destroy; |
| 1155 | } | |
| 1156 | ||
| 1157 | ||
| 1158 | ||
| 1159 | 0 | result = globus_soap_message_deserialize_element_begin_close( |
| 1160 | message_handle); | |
| 1161 | 0 | if(result != GLOBUS_SUCCESS) |
| 1162 | { | |
| 1163 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 1164 | result, element_qname); | |
| 1165 | 0 | goto fail_deserialize; |
| 1166 | } | |
| 1167 | } | |
| 1168 | ||
| 1169 | 0 | subelement.local = "any"; |
| 1170 | 0 | subelement.Namespace = "http://www.w3.org/2001/XMLSchema"; |
| 1171 | ||
| 1172 | 0 | result = xsd_any_array_deserialize( |
| 1173 | &subelement, | |
| 1174 | &instance->any, | |
| 1175 | message_handle, | |
| 1176 | 0); | |
| 1177 | 0 | if(result != GLOBUS_SUCCESS) |
| 1178 | { | |
| 1179 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 1180 | result, | |
| 1181 | (&subelement)); | |
| 1182 | 0 | goto any_destroy_array; |
| 1183 | } | |
| 1184 | ||
| 1185 | 0 | if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY)) |
| 1186 | { | |
| 1187 | 0 | result = globus_soap_message_deserialize_element_end( |
| 1188 | message_handle, | |
| 1189 | element_qname); | |
| 1190 | 0 | if(result != GLOBUS_SUCCESS) |
| 1191 | { | |
| 1192 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 1193 | result, element_qname); | |
| 1194 | goto fail_deserialize; | |
| 1195 | } | |
| 1196 | } | |
| 1197 | ||
| 1198 | 0 | goto exit; |
| 1199 | ||
| 1200 | fail_deserialize: | |
| 1201 | ||
| 1202 | xsd_anyAttributes_destroy: | |
| 1203 | 0 | xsd_anyAttributes_destroy(instance->anyAttributes); |
| 1204 | 0 | instance->anyAttributes = NULL; |
| 1205 | xsd_anyAttributes_after_destroy: | |
| 1206 | ||
| 1207 | _Context_destroy: | |
| 1208 | /* output_fail_destroy_attribute() */ | |
| 1209 | ||
| 1210 | 0 | if(instance->_Context) |
| 1211 | { | |
| 1212 | 0 | xsd_anyURI_destroy( |
| 1213 | instance->_Context); | |
| 1214 | 0 | instance->_Context = NULL; |
| 1215 | } | |
| 1216 | 0 | xsd_any_array_destroy_contents( |
| 1217 | &instance->any); | |
| 1218 | ||
| 1219 | any_destroy_array: | |
| 1220 | ||
| 1221 | ||
| 1222 | exit: | |
| 1223 | ||
| 1224 | 0 | GlobusSoapMessageDebugExit(); |
| 1225 | 0 | return result; |
| 1226 | } | |
| 1227 | ||
| 1228 | ||
| 1229 | ||
| 1230 | globus_result_t | |
| 1231 | wst_RequestSecurityTokenType_deserialize_pointer( | |
| 1232 | const xsd_QName * element_qname, | |
| 1233 | wst_RequestSecurityTokenType ** ip, | |
| 1234 | globus_soap_message_handle_t message_handle, | |
| 1235 | globus_xsd_element_options_t options) | |
| 1236 | 0 | { |
| 1237 | 0 | wst_RequestSecurityTokenType * instance = NULL; |
| 1238 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 1239 | 0 | xsd_QName subelement; |
| 1240 | 0 | int found_attrs = 0; |
| 1241 | 0 | int empty_element = 0; |
| 1242 | 0 | GlobusFuncName(wst_RequestSecurityTokenType_deserialize_pointer); |
| 1243 | 0 | GlobusSoapMessageDebugEnter(); |
| 1244 | ||
| 1245 | 0 | *ip = NULL; |
| 1246 | ||
| 1247 | 0 | result = globus_soap_message_deserialize_element( |
| 1248 | message_handle, element_qname); | |
| 1249 | 0 | if(result != GLOBUS_SUCCESS && |
| 1250 | (GlobusSoapMessageStatusElementNotFoundCheck(result) || | |
| 1251 | GlobusSoapMessageStatusFailedElementCheck(result) || | |
| 1252 | GlobusSoapMessageStatusFailedWithTextCheck(result))) | |
| 1253 | { | |
| 1254 | 0 | result = GLOBUS_SUCCESS; |
| 1255 | 0 | goto exit; |
| 1256 | } | |
| 1257 | ||
| 1258 | 0 | if(result != GLOBUS_SUCCESS) |
| 1259 | { | |
| 1260 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 1261 | result, element_qname); | |
| 1262 | 0 | goto exit; |
| 1263 | } | |
| 1264 | ||
| 1265 | 0 | if(globus_soap_message_deserialize_element_is_empty( |
| 1266 | message_handle)) | |
| 1267 | { | |
| 1268 | 0 | empty_element = 1; |
| 1269 | } | |
| 1270 | ||
| 1271 | 0 | result = wst_RequestSecurityTokenType_init(&instance); |
| 1272 | 0 | if(result != GLOBUS_SUCCESS) |
| 1273 | { | |
| 1274 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 1275 | result, element_qname); | |
| 1276 | 0 | goto exit; |
| 1277 | } | |
| 1278 | ||
| 1279 | ||
| 1280 | 0 | result = xsd_anyAttributes_init(&instance->anyAttributes); |
| 1281 | 0 | if(result != GLOBUS_SUCCESS) |
| 1282 | { | |
| 1283 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 1284 | result, element_qname); | |
| 1285 | 0 | goto xsd_anyAttributes_after_destroy; |
| 1286 | } | |
| 1287 | ||
| 1288 | 0 | result = xsd_anyAttributes_deserialize( |
| 1289 | message_handle, | |
| 1290 | instance->anyAttributes); | |
| 1291 | 0 | if(result != GLOBUS_SUCCESS) |
| 1292 | { | |
| 1293 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 1294 | result, element_qname); | |
| 1295 | 0 | goto xsd_anyAttributes_destroy; |
| 1296 | } | |
| 1297 | ||
| 1298 | 0 | if(instance->anyAttributes && |
| 1299 | xsd_anyAttributes_size(instance->anyAttributes) > 0) | |
| 1300 | { | |
| 1301 | 0 | found_attrs++; |
| 1302 | } | |
| 1303 | ||
| 1304 | 0 | subelement.Namespace = ""; |
| 1305 | 0 | subelement.local = "Context"; |
| 1306 | ||
| 1307 | 0 | result = xsd_anyURI_deserialize_attribute_pointer( |
| 1308 | &subelement, | |
| 1309 | &instance->_Context, | |
| 1310 | message_handle, | |
| 1311 | 0); | |
| 1312 | 0 | if(result != GLOBUS_SUCCESS) |
| 1313 | { | |
| 1314 | 0 | result = GlobusSoapMessageErrorDeserializeFailed(result, &subelement); |
| 1315 | 0 | goto _Context_destroy; |
| 1316 | } | |
| 1317 | ||
| 1318 | ||
| 1319 | 0 | if(instance->_Context) |
| 1320 | { | |
| 1321 | 0 | found_attrs++; |
| 1322 | } | |
| 1323 | ||
| 1324 | ||
| 1325 | 0 | if(empty_element) |
| 1326 | { | |
| 1327 | 0 | result = globus_soap_message_deserialize_element_end( |
| 1328 | message_handle, | |
| 1329 | element_qname); | |
| 1330 | 0 | if(result != GLOBUS_SUCCESS) |
| 1331 | { | |
| 1332 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 1333 | result, element_qname); | |
| 1334 | 0 | goto fail_deserialize; |
| 1335 | } | |
| 1336 | ||
| 1337 | 0 | *ip = instance; |
| 1338 | 0 | goto exit; |
| 1339 | } | |
| 1340 | ||
| 1341 | 0 | result = globus_soap_message_deserialize_element_begin_close( |
| 1342 | message_handle); | |
| 1343 | 0 | if(result != GLOBUS_SUCCESS) |
| 1344 | { | |
| 1345 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 1346 | result, element_qname); | |
| 1347 | 0 | goto exit; |
| 1348 | } | |
| 1349 | ||
| 1350 | 0 | result = wst_RequestSecurityTokenType_deserialize( |
| 1351 | element_qname, | |
| 1352 | instance, | |
| 1353 | message_handle, | |
| 1354 | options | GLOBUS_XSD_ELEMENT_CONTENTS_ONLY); | |
| 1355 | ||
| 1356 | 0 | result = globus_soap_message_deserialize_element_end( |
| 1357 | message_handle, | |
| 1358 | element_qname); | |
| 1359 | 0 | if(result != GLOBUS_SUCCESS) |
| 1360 | { | |
| 1361 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 1362 | result, element_qname); | |
| 1363 | 0 | goto fail_deserialize; |
| 1364 | } | |
| 1365 | ||
| 1366 | 0 | *ip = instance; |
| 1367 | ||
| 1368 | 0 | goto exit; |
| 1369 | ||
| 1370 | fail_deserialize: | |
| 1371 | ||
| 1372 | xsd_anyAttributes_destroy: | |
| 1373 | 0 | xsd_anyAttributes_destroy(instance->anyAttributes); |
| 1374 | 0 | instance->anyAttributes = NULL; |
| 1375 | xsd_anyAttributes_after_destroy: | |
| 1376 | ||
| 1377 | _Context_destroy: | |
| 1378 | /* output_fail_destroy_attribute() */ | |
| 1379 | ||
| 1380 | 0 | if(instance->_Context) |
| 1381 | { | |
| 1382 | 0 | xsd_anyURI_destroy( |
| 1383 | instance->_Context); | |
| 1384 | 0 | instance->_Context = NULL; |
| 1385 | } | |
| 1386 | 0 | xsd_any_array_destroy_contents( |
| 1387 | &instance->any); | |
| 1388 | ||
| 1389 | any_destroy_array: | |
| 1390 | ||
| 1391 | exit: | |
| 1392 | ||
| 1393 | 0 | GlobusSoapMessageDebugExit(); |
| 1394 | 0 | return result; |
| 1395 | } | |
| 1396 | ||
| 1397 | ||
| 1398 | globus_result_t | |
| 1399 | wst_RequestSecurityTokenType_array_init_contents( | |
| 1400 | wst_RequestSecurityTokenType_array * array) | |
| 1401 | 0 | { |
| 1402 | 0 | return globus_xsd_generic_array_init_contents( |
| 1403 | (globus_xsd_generic_array_t *) array, | |
| 1404 | &wst_RequestSecurityTokenType_info); | |
| 1405 | } | |
| 1406 | /* wst_RequestSecurityTokenType_array_init_contents() */ | |
| 1407 | ||
| 1408 | globus_result_t | |
| 1409 | wst_RequestSecurityTokenType_array_init( | |
| 1410 | wst_RequestSecurityTokenType_array ** arr) | |
| 1411 | 0 | { |
| 1412 | 0 | return globus_xsd_generic_array_init( |
| 1413 | (globus_xsd_generic_array_t **) arr, | |
| 1414 | &wst_RequestSecurityTokenType_info); | |
| 1415 | } | |
| 1416 | /* wst_RequestSecurityTokenType_array_init() */ | |
| 1417 | ||
| 1418 | void | |
| 1419 | wst_RequestSecurityTokenType_array_destroy_contents( | |
| 1420 | wst_RequestSecurityTokenType_array * array) | |
| 1421 | 0 | { |
| 1422 | 0 | globus_xsd_generic_array_destroy_contents( |
| 1423 | (globus_xsd_generic_array_t *) array); | |
| 1424 | } | |
| 1425 | /* wst_RequestSecurityTokenType_array_destroy_contents() */ | |
| 1426 | ||
| 1427 | void | |
| 1428 | wst_RequestSecurityTokenType_array_destroy( | |
| 1429 | wst_RequestSecurityTokenType_array * array) | |
| 1430 | 0 | { |
| 1431 | 0 | globus_xsd_generic_array_destroy( |
| 1432 | (globus_xsd_generic_array_t *) array); | |
| 1433 | } | |
| 1434 | /* wst_RequestSecurityTokenType_array_destroy() */ | |
| 1435 | ||
| 1436 | globus_result_t | |
| 1437 | wst_RequestSecurityTokenType_array_copy( | |
| 1438 | wst_RequestSecurityTokenType_array ** dest_arr, | |
| 1439 | const wst_RequestSecurityTokenType_array * src_arr) | |
| 1440 | 0 | { |
| 1441 | 0 | return globus_xsd_generic_array_copy( |
| 1442 | (globus_xsd_generic_array_t **) dest_arr, | |
| 1443 | (globus_xsd_generic_array_t *) src_arr); | |
| 1444 | } | |
| 1445 | /* wst_RequestSecurityTokenType_array_copy() */ | |
| 1446 | ||
| 1447 | globus_result_t | |
| 1448 | wst_RequestSecurityTokenType_array_copy_contents( | |
| 1449 | wst_RequestSecurityTokenType_array * dest_arr, | |
| 1450 | const wst_RequestSecurityTokenType_array * src_arr) | |
| 1451 | 0 | { |
| 1452 | 0 | return globus_xsd_generic_array_copy_contents( |
| 1453 | (globus_xsd_generic_array_t *) dest_arr, | |
| 1454 | (globus_xsd_generic_array_t *) src_arr); | |
| 1455 | } | |
| 1456 | /* wst_RequestSecurityTokenType_array_copy_contents() */ | |
| 1457 | ||
| 1458 | wst_RequestSecurityTokenType * | |
| 1459 | wst_RequestSecurityTokenType_array_push( | |
| 1460 | wst_RequestSecurityTokenType_array * array) | |
| 1461 | 0 | { |
| 1462 | /* Some contents initializers don't initialize subelments but to set their | |
| 1463 | * values to be NULL | |
| 1464 | */ | |
| 1465 | 0 | if (array->type_info == NULL) |
| 1466 | { | |
| 1467 | 0 | array->type_info = &wst_RequestSecurityTokenType_info; |
| 1468 | } | |
| 1469 | ||
| 1470 | 0 | return globus_xsd_generic_array_push( |
| 1471 | (globus_xsd_generic_array_t *) array); | |
| 1472 | } | |
| 1473 | /* wst_RequestSecurityTokenType_array_push() */ | |
| 1474 | ||
| 1475 | void * | |
| 1476 | wst_RequestSecurityTokenType_array_push_wrapper( | |
| 1477 | void * array) | |
| 1478 | 0 | { |
| 1479 | 0 | return (void *) wst_RequestSecurityTokenType_array_push((wst_RequestSecurityTokenType_array *) array); |
| 1480 | } | |
| 1481 | ||
| 1482 | globus_result_t | |
| 1483 | wst_RequestSecurityTokenType_array_serialize( | |
| 1484 | const xsd_QName * element_qname, | |
| 1485 | const wst_RequestSecurityTokenType_array * array, | |
| 1486 | globus_soap_message_handle_t message, | |
| 1487 | globus_xsd_element_options_t options) | |
| 1488 | 0 | { |
| 1489 | 0 | return globus_xsd_generic_array_serialize( |
| 1490 | element_qname, | |
| 1491 | (const globus_xsd_generic_array_t *) array, | |
| 1492 | message, | |
| 1493 | options); | |
| 1494 | } | |
| 1495 | /* wst_RequestSecurityTokenType_array_serialize() */ | |
| 1496 | ||
| 1497 | globus_result_t | |
| 1498 | wst_RequestSecurityTokenType_array_deserialize( | |
| 1499 | const xsd_QName * element_qname, | |
| 1500 | wst_RequestSecurityTokenType_array * array, | |
| 1501 | globus_soap_message_handle_t message, | |
| 1502 | globus_xsd_element_options_t options) | |
| 1503 | 0 | { |
| 1504 | /* Some initializers set the array's contents to NULL */ | |
| 1505 | 0 | if (array->type_info == NULL) |
| 1506 | { | |
| 1507 | 0 | array->type_info = &wst_RequestSecurityTokenType_info; |
| 1508 | } | |
| 1509 | 0 | return globus_xsd_generic_array_deserialize( |
| 1510 | element_qname, | |
| 1511 | (globus_xsd_generic_array_t *) array, | |
| 1512 | message, | |
| 1513 | options); |