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