| 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 "ds_KeyValueType.h" | |
| 26 | ||
| 27 | xsd_QName ds_KeyValueType_choice_qname = | |
| 28 | { | |
| 29 | "http://www.w3.org/2000/09/xmldsig#", | |
| 30 | "KeyValueType_choice" | |
| 31 | }; | |
| 32 | ||
| 33 | globus_result_t | |
| 34 | ds_KeyValueType_choice_serialize_wrapper( | |
| 35 | const xsd_QName * element_qname, | |
| 36 | const void * instance, | |
| 37 | globus_soap_message_handle_t message_handle, | |
| 38 | globus_xsd_element_options_t options) | |
| 39 | 0 | { |
| 40 | 0 | return ds_KeyValueType_choice_serialize( |
| 41 | element_qname, | |
| 42 | (ds_KeyValueType_choice *) instance, | |
| 43 | message_handle, options); | |
| 44 | } | |
| 45 | ||
| 46 | globus_result_t | |
| 47 | ds_KeyValueType_choice_deserialize_pointer_wrapper( | |
| 48 | const xsd_QName * element_qname, | |
| 49 | void ** ip, | |
| 50 | globus_soap_message_handle_t message_handle, | |
| 51 | globus_xsd_element_options_t options) | |
| 52 | 0 | { |
| 53 | 0 | return ds_KeyValueType_choice_deserialize_pointer( |
| 54 | element_qname, | |
| 55 | (ds_KeyValueType_choice **) ip, | |
| 56 | message_handle, options); | |
| 57 | } | |
| 58 | ||
| 59 | globus_result_t | |
| 60 | ds_KeyValueType_choice_init_wrapper(void **object) | |
| 61 | 0 | { |
| 62 | 0 | return ds_KeyValueType_choice_init( |
| 63 | (ds_KeyValueType_choice **) object); | |
| 64 | } | |
| 65 | ||
| 66 | void | |
| 67 | ds_KeyValueType_choice_destroy_wrapper( | |
| 68 | void * object) | |
| 69 | 0 | { |
| 70 | 0 | ds_KeyValueType_choice_destroy( |
| 71 | (ds_KeyValueType_choice *) object); | |
| 72 | } | |
| 73 | ||
| 74 | globus_result_t | |
| 75 | ds_KeyValueType_choice_copy_wrapper( | |
| 76 | void ** dest_obj, | |
| 77 | const void * src_obj) | |
| 78 | 0 | { |
| 79 | 0 | return ds_KeyValueType_choice_copy( |
| 80 | (ds_KeyValueType_choice **) dest_obj, | |
| 81 | (ds_KeyValueType_choice *) src_obj); | |
| 82 | } | |
| 83 | ||
| 84 | globus_result_t | |
| 85 | ds_KeyValueType_choice_init_contents_wrapper(void *object) | |
| 86 | 0 | { |
| 87 | 0 | return ds_KeyValueType_choice_init_contents( |
| 88 | (ds_KeyValueType_choice *) object); | |
| 89 | } | |
| 90 | ||
| 91 | void | |
| 92 | ds_KeyValueType_choice_destroy_contents_wrapper( | |
| 93 | void * object) | |
| 94 | 0 | { |
| 95 | 0 | ds_KeyValueType_choice_destroy_contents( |
| 96 | (ds_KeyValueType_choice *) object); | |
| 97 | } | |
| 98 | ||
| 99 | globus_result_t | |
| 100 | ds_KeyValueType_choice_copy_contents_wrapper( | |
| 101 | void * dest_obj, | |
| 102 | const void * src_obj) | |
| 103 | 0 | { |
| 104 | 0 | return ds_KeyValueType_choice_copy_contents( |
| 105 | (ds_KeyValueType_choice *) dest_obj, | |
| 106 | (ds_KeyValueType_choice *) src_obj); | |
| 107 | } | |
| 108 | ||
| 109 | globus_result_t | |
| 110 | ds_KeyValueType_choice_serialize_contents_wrapper( | |
| 111 | const xsd_QName * element_qname, | |
| 112 | const void * instance, | |
| 113 | globus_soap_message_handle_t message_handle, | |
| 114 | globus_xsd_element_options_t options) | |
| 115 | 0 | { |
| 116 | 0 | return ds_KeyValueType_choice_serialize_contents( |
| 117 | element_qname, | |
| 118 | (const ds_KeyValueType_choice *) instance, | |
| 119 | message_handle, options); | |
| 120 | } | |
| 121 | ||
| 122 | globus_result_t | |
| 123 | ds_KeyValueType_choice_deserialize_contents_wrapper( | |
| 124 | const xsd_QName * element_qname, | |
| 125 | void ** instance, | |
| 126 | globus_soap_message_handle_t message_handle, | |
| 127 | globus_xsd_element_options_t options) | |
| 128 | 0 | { |
| 129 | 0 | globus_result_t result; |
| 130 | 0 | GlobusFuncName(ds_KeyValueType_choice_deserialize_contents_wrapper); |
| 131 | 0 | GlobusSoapMessageDebugEnter(); |
| 132 | ||
| 133 | 0 | if(!*instance) |
| 134 | { | |
| 135 | 0 | result = ds_KeyValueType_choice_init( |
| 136 | (ds_KeyValueType_choice **)instance); | |
| 137 | 0 | if(result != GLOBUS_SUCCESS) |
| 138 | { | |
| 139 | 0 | goto error; |
| 140 | } | |
| 141 | } | |
| 142 | ||
| 143 | 0 | result = ds_KeyValueType_choice_deserialize_contents( |
| 144 | element_qname, | |
| 145 | *(ds_KeyValueType_choice **)instance, | |
| 146 | message_handle, options); | |
| 147 | error: | |
| 148 | 0 | GlobusSoapMessageDebugExit(); |
| 149 | 0 | return result; |
| 150 | } | |
| 151 | ||
| 152 | globus_result_t | |
| 153 | ds_KeyValueType_choice_array_serialize_wrapper( | |
| 154 | const xsd_QName * element, | |
| 155 | const void * instance, | |
| 156 | globus_soap_message_handle_t message, | |
| 157 | globus_xsd_element_options_t options) | |
| 158 | 0 | { |
| 159 | 0 | return ds_KeyValueType_choice_array_serialize( |
| 160 | element, | |
| 161 | (ds_KeyValueType_choice_array *) instance, | |
| 162 | message, options); | |
| 163 | } | |
| 164 | ||
| 165 | globus_result_t | |
| 166 | ds_KeyValueType_choice_array_deserialize_wrapper( | |
| 167 | const xsd_QName * element_qname, | |
| 168 | void ** inst, | |
| 169 | globus_soap_message_handle_t message, | |
| 170 | globus_xsd_element_options_t options) | |
| 171 | 0 | { |
| 172 | 0 | if(!*inst) |
| 173 | { | |
| 174 | 0 | globus_result_t result; |
| 175 | ||
| 176 | 0 | result = ds_KeyValueType_choice_array_init( |
| 177 | (ds_KeyValueType_choice_array **)inst); | |
| 178 | 0 | if(result != GLOBUS_SUCCESS) |
| 179 | { | |
| 180 | 0 | return result; |
| 181 | } | |
| 182 | } | |
| 183 | ||
| 184 | 0 | return ds_KeyValueType_choice_array_deserialize( |
| 185 | element_qname, | |
| 186 | *(ds_KeyValueType_choice_array **) inst, | |
| 187 | message, options); | |
| 188 | } | |
| 189 | ||
| 190 | globus_result_t | |
| 191 | ds_KeyValueType_choice_array_init_wrapper( | |
| 192 | void ** arr) | |
| 193 | 0 | { |
| 194 | 0 | return ds_KeyValueType_choice_array_init( |
| 195 | (ds_KeyValueType_choice_array **) arr); | |
| 196 | } | |
| 197 | ||
| 198 | void | |
| 199 | ds_KeyValueType_choice_array_destroy_wrapper( | |
| 200 | void * arr) | |
| 201 | 0 | { |
| 202 | 0 | ds_KeyValueType_choice_array_destroy( |
| 203 | (ds_KeyValueType_choice_array *) arr); | |
| 204 | } | |
| 205 | ||
| 206 | globus_result_t | |
| 207 | ds_KeyValueType_choice_array_copy_wrapper( | |
| 208 | void ** dest_arr, | |
| 209 | const void * src_arr) | |
| 210 | 0 | { |
| 211 | 0 | return ds_KeyValueType_choice_array_copy( |
| 212 | (ds_KeyValueType_choice_array **) dest_arr, | |
| 213 | (const ds_KeyValueType_choice_array *) src_arr); | |
| 214 | } | |
| 215 | ||
| 216 | globus_result_t | |
| 217 | ds_KeyValueType_choice_array_init_contents_wrapper( | |
| 218 | void * arr) | |
| 219 | 0 | { |
| 220 | 0 | return ds_KeyValueType_choice_array_init_contents( |
| 221 | (ds_KeyValueType_choice_array *) arr); | |
| 222 | } | |
| 223 | ||
| 224 | void | |
| 225 | ds_KeyValueType_choice_array_destroy_contents_wrapper( | |
| 226 | void * arr) | |
| 227 | 0 | { |
| 228 | 0 | ds_KeyValueType_choice_array_destroy_contents( |
| 229 | (ds_KeyValueType_choice_array *) arr); | |
| 230 | } | |
| 231 | ||
| 232 | globus_result_t | |
| 233 | ds_KeyValueType_choice_array_copy_contents_wrapper( | |
| 234 | void * dest_arr, | |
| 235 | const void * src_arr) | |
| 236 | 0 | { |
| 237 | 0 | return ds_KeyValueType_choice_array_copy_contents( |
| 238 | (ds_KeyValueType_choice_array *) dest_arr, | |
| 239 | (const ds_KeyValueType_choice_array *) src_arr); | |
| 240 | } | |
| 241 | ||
| 242 | struct globus_xsd_type_info_s ds_KeyValueType_choice_array_info = | |
| 243 | { | |
| 244 | &ds_KeyValueType_choice_qname, | |
| 245 | ds_KeyValueType_choice_array_serialize_wrapper, | |
| 246 | ds_KeyValueType_choice_array_deserialize_wrapper, | |
| 247 | ds_KeyValueType_choice_array_init_wrapper, | |
| 248 | ds_KeyValueType_choice_array_destroy_wrapper, | |
| 249 | ds_KeyValueType_choice_array_copy_wrapper, | |
| 250 | ds_KeyValueType_choice_array_init_contents_wrapper, | |
| 251 | ds_KeyValueType_choice_array_destroy_contents_wrapper, | |
| 252 | ds_KeyValueType_choice_array_copy_contents_wrapper, | |
| 253 | sizeof(ds_KeyValueType_choice), | |
| 254 | ds_KeyValueType_choice_array_push_wrapper, | |
| 255 | NULL, | |
| 256 | NULL | |
| 257 | }; | |
| 258 | ||
| 259 | struct globus_xsd_type_info_s ds_KeyValueType_choice_contents_info = | |
| 260 | { | |
| 261 | &ds_KeyValueType_choice_qname, | |
| 262 | ds_KeyValueType_choice_serialize_contents_wrapper, | |
| 263 | ds_KeyValueType_choice_deserialize_contents_wrapper, | |
| 264 | ds_KeyValueType_choice_init_wrapper, | |
| 265 | ds_KeyValueType_choice_destroy_wrapper, | |
| 266 | ds_KeyValueType_choice_copy_wrapper, | |
| 267 | ds_KeyValueType_choice_init_contents_wrapper, | |
| 268 | ds_KeyValueType_choice_destroy_contents_wrapper, | |
| 269 | ds_KeyValueType_choice_copy_contents_wrapper, | |
| 270 | sizeof(ds_KeyValueType_choice), | |
| 271 | NULL, | |
| 272 | NULL, | |
| 273 | NULL | |
| 274 | }; | |
| 275 | ||
| 276 | struct globus_xsd_type_info_s ds_KeyValueType_choice_info = | |
| 277 | { | |
| 278 | &ds_KeyValueType_choice_qname, | |
| 279 | ds_KeyValueType_choice_serialize_wrapper, | |
| 280 | ds_KeyValueType_choice_deserialize_pointer_wrapper, | |
| 281 | ds_KeyValueType_choice_init_wrapper, | |
| 282 | ds_KeyValueType_choice_destroy_wrapper, | |
| 283 | ds_KeyValueType_choice_copy_wrapper, | |
| 284 | ds_KeyValueType_choice_init_contents_wrapper, | |
| 285 | ds_KeyValueType_choice_destroy_contents_wrapper, | |
| 286 | ds_KeyValueType_choice_copy_contents_wrapper, | |
| 287 | sizeof(ds_KeyValueType_choice), | |
| 288 | NULL, | |
| 289 | &ds_KeyValueType_choice_contents_info, | |
| 290 | &ds_KeyValueType_choice_array_info | |
| 291 | }; | |
| 292 | ||
| 293 | globus_result_t | |
| 294 | ds_KeyValueType_choice_init_contents( | |
| 295 | ds_KeyValueType_choice * instance) | |
| 296 | 0 | { |
| 297 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 298 | 0 | GlobusFuncName(ds_KeyValueType_choice_init_contents); |
| 299 | 0 | GlobusSoapMessageDebugEnter(); |
| 300 | ||
| 301 | 0 | memset(instance, 0, sizeof(ds_KeyValueType)); |
| 302 | ||
| 303 | 0 | GlobusSoapMessageDebugExit(); |
| 304 | 0 | return result; |
| 305 | } | |
| 306 | ||
| 307 | globus_result_t | |
| 308 | ds_KeyValueType_choice_init( | |
| 309 | ds_KeyValueType_choice ** object) | |
| 310 | 0 | { |
| 311 | 0 | ds_KeyValueType_choice * instance; |
| 312 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 313 | 0 | GlobusFuncName(ds_KeyValueType_choice_init); |
| 314 | 0 | GlobusSoapMessageDebugEnter(); |
| 315 | ||
| 316 | 0 | instance = globus_malloc(sizeof(ds_KeyValueType_choice)); |
| 317 | 0 | if(!instance) |
| 318 | { | |
| 319 | 0 | result = GlobusSoapMessageErrorOutOfMemory; |
| 320 | 0 | goto exit; |
| 321 | } | |
| 322 | ||
| 323 | 0 | memset(instance, 0, sizeof(ds_KeyValueType_choice)); |
| 324 | ||
| 325 | 0 | *object = instance; |
| 326 | ||
| 327 | exit: | |
| 328 | 0 | GlobusSoapMessageDebugExit(); |
| 329 | 0 | return result; |
| 330 | } | |
| 331 | ||
| 332 | void | |
| 333 | ds_KeyValueType_choice_destroy( | |
| 334 | ds_KeyValueType_choice * instance) | |
| 335 | 0 | { |
| 336 | 0 | GlobusFuncName(ds_KeyValueType_choice_destroy); |
| 337 | 0 | GlobusSoapMessageDebugEnter(); |
| 338 | ||
| 339 | 0 | if(!instance) |
| 340 | { | |
| 341 | 0 | goto exit; |
| 342 | } | |
| 343 | ||
| 344 | 0 | ds_KeyValueType_choice_destroy_contents(instance); |
| 345 | 0 | free(instance); |
| 346 | ||
| 347 | exit: | |
| 348 | ||
| 349 | 0 | GlobusSoapMessageDebugExit(); |
| 350 | } | |
| 351 | ||
| 352 | ||
| 353 | ||
| 354 | void | |
| 355 | ds_KeyValueType_choice_destroy_contents( | |
| 356 | ds_KeyValueType_choice * instance) | |
| 357 | 0 | { |
| 358 | 0 | GlobusFuncName(ds_KeyValueType_choice_destroy_contents); |
| 359 | 0 | GlobusSoapMessageDebugEnter(); |
| 360 | ||
| 361 | 0 | switch(instance->type) |
| 362 | { | |
| 363 | ||
| 364 | case ds_KeyValueType_DSAKeyValue: | |
| 365 | ||
| 366 | 0 | ds_DSAKeyValueType_destroy_contents( |
| 367 | &instance->value.DSAKeyValue); | |
| 368 | 0 | break; |
| 369 | ||
| 370 | case ds_KeyValueType_RSAKeyValue: | |
| 371 | ||
| 372 | 0 | ds_RSAKeyValueType_destroy_contents( |
| 373 | &instance->value.RSAKeyValue); | |
| 374 | 0 | break; |
| 375 | ||
| 376 | case ds_KeyValueType_any: | |
| 377 | ||
| 378 | 0 | xsd_any_destroy_contents( |
| 379 | &instance->value.any); | |
| 380 | break; | |
| 381 | ||
| 382 | default: | |
| 383 | 0 | break; |
| 384 | } | |
| 385 | ||
| 386 | 0 | instance->type = ds_KeyValueType_undefined; |
| 387 | ||
| 388 | 0 | GlobusSoapMessageDebugExit(); |
| 389 | } | |
| 390 | ||
| 391 | globus_result_t | |
| 392 | ds_KeyValueType_choice_copy( | |
| 393 | ds_KeyValueType_choice ** dest_obj, | |
| 394 | const ds_KeyValueType_choice * src_obj) | |
| 395 | 0 | { |
| 396 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 397 | 0 | ds_KeyValueType_choice * instance; |
| 398 | 0 | GlobusFuncName(ds_KeyValueType_choice_copy); |
| 399 | ||
| 400 | 0 | GlobusSoapMessageDebugEnter(); |
| 401 | ||
| 402 | 0 | instance = malloc(sizeof(ds_KeyValueType_choice)); |
| 403 | 0 | if (instance == NULL) |
| 404 | { | |
| 405 | 0 | GlobusSoapMessageDebugExit(); |
| 406 | 0 | return GlobusSoapMessageErrorOutOfMemory; |
| 407 | } | |
| 408 | ||
| 409 | 0 | result = ds_KeyValueType_choice_copy_contents(instance, src_obj); |
| 410 | 0 | if(result != GLOBUS_SUCCESS) |
| 411 | { | |
| 412 | 0 | globus_free(instance); |
| 413 | 0 | GlobusSoapMessageDebugExit(); |
| 414 | 0 | return GlobusSoapMessageErrorOutOfMemory; |
| 415 | } | |
| 416 | ||
| 417 | 0 | *dest_obj = instance; |
| 418 | 0 | GlobusSoapMessageDebugExit(); |
| 419 | 0 | return result; |
| 420 | } | |
| 421 | ||
| 422 | ||
| 423 | ||
| 424 | globus_result_t | |
| 425 | ds_KeyValueType_choice_copy_contents( | |
| 426 | ds_KeyValueType_choice * instance, | |
| 427 | const ds_KeyValueType_choice * src_obj) | |
| 428 | 0 | { |
| 429 | 0 | xsd_QName subelement; |
| 430 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 431 | 0 | GlobusFuncName(ds_KeyValueType_choice_copy_contents); |
| 432 | ||
| 433 | 0 | GlobusSoapMessageDebugEnter(); |
| 434 | ||
| 435 | 0 | switch(src_obj->type) |
| 436 | { | |
| 437 | ||
| 438 | case ds_KeyValueType_DSAKeyValue: | |
| 439 | 0 | instance->type = ds_KeyValueType_DSAKeyValue; |
| 440 | 0 | result = ds_DSAKeyValueType_copy_contents( |
| 441 | &instance->value.DSAKeyValue, | |
| 442 | &src_obj->value.DSAKeyValue); | |
| 443 | 0 | if(result != GLOBUS_SUCCESS) |
| 444 | { | |
| 445 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 446 | result, NULL, &ds_KeyValueType_choice_qname); | |
| 447 | 0 | goto exit; |
| 448 | } | |
| 449 | ||
| 450 | 0 | break; |
| 451 | ||
| 452 | case ds_KeyValueType_RSAKeyValue: | |
| 453 | 0 | instance->type = ds_KeyValueType_RSAKeyValue; |
| 454 | 0 | result = ds_RSAKeyValueType_copy_contents( |
| 455 | &instance->value.RSAKeyValue, | |
| 456 | &src_obj->value.RSAKeyValue); | |
| 457 | 0 | if(result != GLOBUS_SUCCESS) |
| 458 | { | |
| 459 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 460 | result, NULL, &ds_KeyValueType_choice_qname); | |
| 461 | 0 | goto exit; |
| 462 | } | |
| 463 | ||
| 464 | 0 | break; |
| 465 | ||
| 466 | case ds_KeyValueType_any: | |
| 467 | 0 | instance->type = ds_KeyValueType_any; |
| 468 | 0 | result = xsd_any_copy_contents( |
| 469 | &instance->value.any, | |
| 470 | &src_obj->value.any); | |
| 471 | 0 | if(result != GLOBUS_SUCCESS) |
| 472 | { | |
| 473 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 474 | result, NULL, &ds_KeyValueType_choice_qname); | |
| 475 | goto exit; | |
| 476 | } | |
| 477 | ||
| 478 | 0 | break; |
| 479 | ||
| 480 | default: | |
| 481 | 0 | break; |
| 482 | } | |
| 483 | ||
| 484 | exit: | |
| 485 | ||
| 486 | 0 | GlobusSoapMessageDebugExit(); |
| 487 | 0 | return result; |
| 488 | } | |
| 489 | ||
| 490 | ||
| 491 | ||
| 492 | ||
| 493 | ||
| 494 | globus_result_t | |
| 495 | ds_KeyValueType_choice_serialize_contents( | |
| 496 | const xsd_QName * element_qname, /* ignored */ | |
| 497 | const ds_KeyValueType_choice * instance, | |
| 498 | globus_soap_message_handle_t message_handle, | |
| 499 | globus_xsd_element_options_t options) | |
| 500 | 0 | { |
| 501 | 0 | xsd_QName subelement; |
| 502 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 503 | 0 | GlobusFuncName(ds_KeyValueType_choice_serialize_contents); |
| 504 | 0 | GlobusSoapMessageDebugEnter(); |
| 505 | ||
| 506 | 0 | switch(instance->type) |
| 507 | { | |
| 508 | ||
| 509 | case ds_KeyValueType_DSAKeyValue: | |
| 510 | ||
| 511 | 0 | subelement.local = "DSAKeyValue"; |
| 512 | 0 | subelement.Namespace = "http://www.w3.org/2000/09/xmldsig#"; |
| 513 | 0 | result = ds_DSAKeyValueType_serialize( |
| 514 | &subelement, | |
| 515 | &instance->value.DSAKeyValue, | |
| 516 | message_handle, | |
| 517 | options); | |
| 518 | 0 | if(result != GLOBUS_SUCCESS) |
| 519 | { | |
| 520 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 521 | result, NULL, &ds_KeyValueType_choice_qname); | |
| 522 | 0 | goto exit; |
| 523 | } | |
| 524 | ||
| 525 | 0 | break; |
| 526 | ||
| 527 | case ds_KeyValueType_RSAKeyValue: | |
| 528 | ||
| 529 | 0 | subelement.local = "RSAKeyValue"; |
| 530 | 0 | subelement.Namespace = "http://www.w3.org/2000/09/xmldsig#"; |
| 531 | 0 | result = ds_RSAKeyValueType_serialize( |
| 532 | &subelement, | |
| 533 | &instance->value.RSAKeyValue, | |
| 534 | message_handle, | |
| 535 | options); | |
| 536 | 0 | if(result != GLOBUS_SUCCESS) |
| 537 | { | |
| 538 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 539 | result, NULL, &ds_KeyValueType_choice_qname); | |
| 540 | 0 | goto exit; |
| 541 | } | |
| 542 | ||
| 543 | 0 | break; |
| 544 | ||
| 545 | case ds_KeyValueType_any: | |
| 546 | ||
| 547 | 0 | subelement.local = "any"; |
| 548 | 0 | subelement.Namespace = "http://www.w3.org/2001/XMLSchema"; |
| 549 | 0 | result = xsd_any_serialize( |
| 550 | &subelement, | |
| 551 | &instance->value.any, | |
| 552 | message_handle, | |
| 553 | options); | |
| 554 | 0 | if(result != GLOBUS_SUCCESS) |
| 555 | { | |
| 556 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 557 | result, NULL, &ds_KeyValueType_choice_qname); | |
| 558 | goto exit; | |
| 559 | } | |
| 560 | ||
| 561 | 0 | break; |
| 562 | ||
| 563 | default: | |
| 564 | 0 | break; |
| 565 | } | |
| 566 | ||
| 567 | exit: | |
| 568 | ||
| 569 | 0 | GlobusSoapMessageDebugExit(); |
| 570 | 0 | return result; |
| 571 | } | |
| 572 | ||
| 573 | ||
| 574 | ||
| 575 | globus_result_t | |
| 576 | ds_KeyValueType_choice_serialize( | |
| 577 | const xsd_QName * element_qname, | |
| 578 | const ds_KeyValueType_choice * instance, | |
| 579 | globus_soap_message_handle_t message_handle, | |
| 580 | globus_xsd_element_options_t options) | |
| 581 | 0 | { |
| 582 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 583 | 0 | GlobusFuncName(ds_KeyValueType_choice_serialize); |
| 584 | 0 | GlobusSoapMessageDebugEnter(); |
| 585 | ||
| 586 | 0 | result = ds_KeyValueType_choice_serialize_contents( |
| 587 | element_qname, | |
| 588 | instance, | |
| 589 | message_handle, | |
| 590 | options); | |
| 591 | 0 | if(result != GLOBUS_SUCCESS) |
| 592 | { | |
| 593 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 594 | result, NULL, &ds_KeyValueType_choice_qname); | |
| 595 | goto exit; | |
| 596 | } | |
| 597 | ||
| 598 | exit: | |
| 599 | 0 | GlobusSoapMessageDebugExit(); |
| 600 | 0 | return result; |
| 601 | } | |
| 602 | ||
| 603 | ||
| 604 | ||
| 605 | ||
| 606 | ||
| 607 | globus_result_t | |
| 608 | ds_KeyValueType_choice_deserialize_contents( | |
| 609 | const xsd_QName * element_qname, /* ignored */ | |
| 610 | ds_KeyValueType_choice * instance, | |
| 611 | globus_soap_message_handle_t message_handle, | |
| 612 | globus_xsd_element_options_t options) | |
| 613 | 0 | { |
| 614 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 615 | 0 | GlobusFuncName(ds_KeyValueType_choice_deserialize_contents); |
| 616 | 0 | GlobusSoapMessageDebugEnter(); |
| 617 | ||
| 618 | 0 | result = ds_KeyValueType_choice_deserialize( |
| 619 | NULL, | |
| 620 | instance, | |
| 621 | message_handle, | |
| 622 | options | GLOBUS_XSD_ELEMENT_CONTENTS_ONLY); | |
| 623 | 0 | if(result != GLOBUS_SUCCESS) |
| 624 | { | |
| 625 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 626 | result, element_qname); | |
| 627 | goto exit; | |
| 628 | } | |
| 629 | ||
| 630 | exit: | |
| 631 | ||
| 632 | 0 | GlobusSoapMessageDebugExit(); |
| 633 | 0 | return result; |
| 634 | } | |
| 635 | ||
| 636 | ||
| 637 | ||
| 638 | globus_result_t | |
| 639 | ds_KeyValueType_choice_deserialize( | |
| 640 | const xsd_QName * element_qname, | |
| 641 | ds_KeyValueType_choice * instance, | |
| 642 | globus_soap_message_handle_t message_handle, | |
| 643 | globus_xsd_element_options_t options) | |
| 644 | 0 | { |
| 645 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 646 | 0 | xsd_QName subelement; |
| 647 | 0 | xsd_QName deselem_qname = { NULL, NULL } ; |
| 648 | 0 | GlobusFuncName(ds_KeyValueType_choice_deserialize); |
| 649 | 0 | GlobusSoapMessageDebugEnter(); |
| 650 | ||
| 651 | 0 | xsd_QName_init_contents(&deselem_qname); |
| 652 | ||
| 653 | 0 | do |
| 654 | { | |
| 655 | 0 | result = globus_soap_message_deserialize_element_unknown( |
| 656 | message_handle, &deselem_qname); | |
| 657 | 0 | if(result != GLOBUS_SUCCESS) |
| 658 | { | |
| 659 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 660 | result, &ds_KeyValueType_choice_qname); | |
| 661 | 0 | goto exit; |
| 662 | } | |
| 663 | ||
| 664 | 0 | if(globus_soap_message_deserialize_element_is_nil(message_handle)) |
| 665 | { | |
| 666 | 0 | xsd_QName_destroy_contents(&deselem_qname); |
| 667 | 0 | result = globus_soap_message_deserialize_element_end( |
| 668 | message_handle, | |
| 669 | element_qname); | |
| 670 | 0 | if(result != GLOBUS_SUCCESS) |
| 671 | { | |
| 672 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 673 | result, &ds_KeyValueType_choice_qname); | |
| 674 | 0 | goto exit; |
| 675 | } | |
| 676 | } | |
| 677 | else | |
| 678 | { | |
| 679 | 0 | break; |
| 680 | } | |
| 681 | 0 | } while(1); |
| 682 | ||
| 683 | 0 | globus_soap_message_deserialize_push_element(message_handle); |
| 684 | ||
| 685 | 0 | subelement.local = "DSAKeyValue"; |
| 686 | 0 | subelement.Namespace = "http://www.w3.org/2000/09/xmldsig#"; |
| 687 | 0 | if(xsd_QName_keyeq((void *)&subelement, (void *)&deselem_qname)) |
| 688 | { | |
| 689 | 0 | instance->type=ds_KeyValueType_DSAKeyValue; |
| 690 | 0 | result = ds_DSAKeyValueType_deserialize( |
| 691 | &subelement, | |
| 692 | &instance->value.DSAKeyValue, | |
| 693 | message_handle, | |
| 694 | options); | |
| 695 | 0 | if(result != GLOBUS_SUCCESS) |
| 696 | { | |
| 697 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 698 | result, &ds_KeyValueType_choice_qname); | |
| 699 | 0 | goto DSAKeyValue_destroy; |
| 700 | } | |
| 701 | ||
| 702 | 0 | goto exit; |
| 703 | } | |
| 704 | ||
| 705 | 0 | subelement.local = "RSAKeyValue"; |
| 706 | 0 | subelement.Namespace = "http://www.w3.org/2000/09/xmldsig#"; |
| 707 | 0 | if(xsd_QName_keyeq((void *)&subelement, (void *)&deselem_qname)) |
| 708 | { | |
| 709 | 0 | instance->type=ds_KeyValueType_RSAKeyValue; |
| 710 | 0 | result = ds_RSAKeyValueType_deserialize( |
| 711 | &subelement, | |
| 712 | &instance->value.RSAKeyValue, | |
| 713 | message_handle, | |
| 714 | options); | |
| 715 | 0 | if(result != GLOBUS_SUCCESS) |
| 716 | { | |
| 717 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 718 | result, &ds_KeyValueType_choice_qname); | |
| 719 | 0 | goto RSAKeyValue_destroy; |
| 720 | } | |
| 721 | ||
| 722 | 0 | goto exit; |
| 723 | } | |
| 724 | ||
| 725 | /* try to parse as any element */ | |
| 726 | 0 | result = xsd_any_deserialize( |
| 727 | &subelement, | |
| 728 | &instance->value.any, | |
| 729 | message_handle, | |
| 730 | options); | |
| 731 | 0 | if(result != GLOBUS_SUCCESS) |
| 732 | { | |
| 733 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 734 | result, &ds_KeyValueType_choice_qname); | |
| 735 | 0 | goto any_destroy; |
| 736 | } | |
| 737 | else | |
| 738 | { | |
| 739 | 0 | instance->type=ds_KeyValueType_any; |
| 740 | goto exit; | |
| 741 | } | |
| 742 | ||
| 743 | 0 | instance->type = ds_KeyValueType_undefined; |
| 744 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 745 | result, &ds_KeyValueType_choice_qname); | |
| 746 | ||
| 747 | 0 | goto exit; |
| 748 | ||
| 749 | deserialize_failed: | |
| 750 | ||
| 751 | any_destroy: | |
| 752 | ||
| 753 | RSAKeyValue_destroy: | |
| 754 | ||
| 755 | DSAKeyValue_destroy: | |
| 756 | ||
| 757 | exit: | |
| 758 | ||
| 759 | 0 | xsd_QName_destroy_contents(&deselem_qname); |
| 760 | ||
| 761 | 0 | if(result == GLOBUS_SUCCESS) |
| 762 | { | |
| 763 | 0 | do |
| 764 | { | |
| 765 | 0 | result = globus_soap_message_deserialize_element( |
| 766 | message_handle, NULL); | |
| 767 | 0 | if(result != GLOBUS_SUCCESS && |
| 768 | (GlobusSoapMessageStatusElementNotFoundCheck(result) || | |
| 769 | GlobusSoapMessageStatusFailedElementCheck(result) || | |
| 770 | GlobusSoapMessageStatusFailedWithTextCheck(result))) | |
| 771 | { | |
| 772 | 0 | result = GLOBUS_SUCCESS; |
| 773 | 0 | break; |
| 774 | } | |
| 775 | ||
| 776 | 0 | if(globus_soap_message_deserialize_element_is_nil( |
| 777 | message_handle)) | |
| 778 | { | |
| 779 | 0 | result = globus_soap_message_deserialize_element_end( |
| 780 | message_handle, | |
| 781 | element_qname); | |
| 782 | 0 | if(result != GLOBUS_SUCCESS) |
| 783 | { | |
| 784 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 785 | result, &ds_KeyValueType_choice_qname); | |
| 786 | break; | |
| 787 | } | |
| 788 | } | |
| 789 | else | |
| 790 | { | |
| 791 | 0 | break; |
| 792 | } | |
| 793 | ||
| 794 | 0 | } while(1); |
| 795 | } | |
| 796 | ||
| 797 | 0 | xsd_QName_destroy_contents(&deselem_qname); |
| 798 | ||
| 799 | 0 | GlobusSoapMessageDebugExit(); |
| 800 | 0 | return result; |
| 801 | } | |
| 802 | ||
| 803 | ||
| 804 | ||
| 805 | globus_result_t | |
| 806 | ds_KeyValueType_choice_deserialize_pointer( | |
| 807 | const xsd_QName * element_qname, | |
| 808 | ds_KeyValueType_choice ** ip, | |
| 809 | globus_soap_message_handle_t message_handle, | |
| 810 | globus_xsd_element_options_t options) | |
| 811 | 0 | { |
| 812 | 0 | ds_KeyValueType_choice * instance = NULL; |
| 813 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 814 | 0 | xsd_QName subelement; |
| 815 | 0 | GlobusFuncName(ds_KeyValueType_choice_deserialize_pointer); |
| 816 | 0 | GlobusSoapMessageDebugEnter(); |
| 817 | ||
| 818 | 0 | *ip = NULL; |
| 819 | ||
| 820 | 0 | result = ds_KeyValueType_choice_init(&instance); |
| 821 | 0 | if(result != GLOBUS_SUCCESS) |
| 822 | { | |
| 823 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 824 | result, element_qname); | |
| 825 | 0 | goto exit; |
| 826 | } | |
| 827 | ||
| 828 | 0 | result = ds_KeyValueType_choice_deserialize( |
| 829 | element_qname, | |
| 830 | instance, | |
| 831 | message_handle, | |
| 832 | options); | |
| 833 | 0 | if(result != GLOBUS_SUCCESS) |
| 834 | { | |
| 835 | 0 | goto exit; |
| 836 | } | |
| 837 | ||
| 838 | 0 | *ip = instance; |
| 839 | ||
| 840 | exit: | |
| 841 | ||
| 842 | 0 | GlobusSoapMessageDebugExit(); |
| 843 | 0 | return result; |
| 844 | } | |
| 845 | ||
| 846 | ||
| 847 | ||
| 848 | globus_result_t | |
| 849 | ds_KeyValueType_choice_array_init_contents( | |
| 850 | ds_KeyValueType_choice_array * array) | |
| 851 | 0 | { |
| 852 | 0 | return globus_xsd_generic_array_init_contents( |
| 853 | (globus_xsd_generic_array_t *) array, | |
| 854 | &ds_KeyValueType_choice_array_info); | |
| 855 | } | |
| 856 | /* ds_KeyValueType_choice_array_init_contents() */ | |
| 857 | ||
| 858 | globus_result_t | |
| 859 | ds_KeyValueType_choice_array_init( | |
| 860 | ds_KeyValueType_choice_array ** arr) | |
| 861 | 0 | { |
| 862 | 0 | return globus_xsd_generic_array_init( |
| 863 | (globus_xsd_generic_array_t **) arr, | |
| 864 | &ds_KeyValueType_choice_info); | |
| 865 | } | |
| 866 | /* ds_KeyValueType_choice_array_init() */ | |
| 867 | ||
| 868 | void | |
| 869 | ds_KeyValueType_choice_array_destroy_contents( | |
| 870 | ds_KeyValueType_choice_array * array) | |
| 871 | 0 | { |
| 872 | 0 | globus_xsd_generic_array_destroy_contents( |
| 873 | (globus_xsd_generic_array_t *) array); | |
| 874 | } | |
| 875 | /* ds_KeyValueType_choice_array_destroy_contents() */ | |
| 876 | ||
| 877 | void | |
| 878 | ds_KeyValueType_choice_array_destroy( | |
| 879 | ds_KeyValueType_choice_array * array) | |
| 880 | 0 | { |
| 881 | 0 | globus_xsd_generic_array_destroy( |
| 882 | (globus_xsd_generic_array_t *) array); | |
| 883 | } | |
| 884 | /* ds_KeyValueType_choice_array_destroy() */ | |
| 885 | ||
| 886 | globus_result_t | |
| 887 | ds_KeyValueType_choice_array_copy( | |
| 888 | ds_KeyValueType_choice_array ** dest_arr, | |
| 889 | const ds_KeyValueType_choice_array * src_arr) | |
| 890 | 0 | { |
| 891 | 0 | return globus_xsd_generic_array_copy( |
| 892 | (globus_xsd_generic_array_t **) dest_arr, | |
| 893 | (const globus_xsd_generic_array_t *) src_arr); | |
| 894 | } | |
| 895 | /* ds_KeyValueType_choice_array_copy() */ | |
| 896 | ||
| 897 | globus_result_t | |
| 898 | ds_KeyValueType_choice_array_copy_contents( | |
| 899 | ds_KeyValueType_choice_array * dest_arr, | |
| 900 | const ds_KeyValueType_choice_array * src_arr) | |
| 901 | 0 | { |
| 902 | 0 | return globus_xsd_generic_array_copy_contents( |
| 903 | (globus_xsd_generic_array_t *) dest_arr, | |
| 904 | (const globus_xsd_generic_array_t *) src_arr); | |
| 905 | } | |
| 906 | ||
| 907 | ds_KeyValueType_choice * | |
| 908 | ds_KeyValueType_choice_array_push( | |
| 909 | ds_KeyValueType_choice_array * array) | |
| 910 | 0 | { |
| 911 | /* Some contents initializers don't initialize subelments but to set their | |
| 912 | * values to be NULL | |
| 913 | */ | |
| 914 | 0 | if (array->type_info == NULL) |
| 915 | { | |
| 916 | 0 | array->type_info = &ds_KeyValueType_choice_info; |
| 917 | } | |
| 918 | 0 | return globus_xsd_generic_array_push( |
| 919 | (globus_xsd_generic_array_t *) array); | |
| 920 | } | |
| 921 | /* ds_KeyValueType_choice_array_push() */ | |
| 922 | ||
| 923 | void * | |
| 924 | ds_KeyValueType_choice_array_push_wrapper( | |
| 925 | void * array) | |
| 926 | 0 | { |
| 927 | 0 | return (void *) ds_KeyValueType_choice_array_push( |
| 928 | (ds_KeyValueType_choice_array *) array); | |
| 929 | } | |
| 930 | ||
| 931 | globus_result_t | |
| 932 | ds_KeyValueType_choice_array_serialize( | |
| 933 | const xsd_QName * element_qname, | |
| 934 | const ds_KeyValueType_choice_array * array, | |
| 935 | globus_soap_message_handle_t message, | |
| 936 | globus_xsd_element_options_t options) | |
| 937 | 0 | { |
| 938 | 0 | return globus_xsd_generic_array_serialize( |
| 939 | element_qname, | |
| 940 | (const globus_xsd_generic_array_t *) array, | |
| 941 | message, | |
| 942 | options); | |
| 943 | } | |
| 944 | /* ds_KeyValueType_choice_array_serialize() */ | |
| 945 | ||
| 946 | globus_result_t | |
| 947 | ds_KeyValueType_choice_array_deserialize( | |
| 948 | const xsd_QName * element_qname, | |
| 949 | ds_KeyValueType_choice_array * array, | |
| 950 | globus_soap_message_handle_t message, | |
| 951 | globus_xsd_element_options_t options) | |
| 952 | 0 | { |
| 953 | /* Some initializers set the array's contents to NULL */ | |
| 954 | 0 | if (array->type_info == NULL) |
| 955 | { | |
| 956 | 0 | array->type_info = &ds_KeyValueType_choice_info; |
| 957 | } | |
| 958 | 0 | return globus_xsd_generic_array_deserialize( |
| 959 | element_qname, | |
| 960 | (globus_xsd_generic_array_t *) array, | |
| 961 | message, | |
| 962 | options); | |
| 963 | } |