| 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 from source-type-builtin.tmpl | |
| 20 | */ | |
| 21 | ||
| 22 | #include "globus_common.h" | |
| 23 | #include "globus_xsd_types.h" | |
| 24 | #include "globus_soap_message.h" | |
| 25 | #include "globus_xsd_type_info.h" | |
| 26 | #include "xsd_string.h" | |
| 27 | #include "globus_xsd_generic.h" | |
| 28 | #include "globus_xsd_generic_array.h" | |
| 29 | #include "globus_i_soap_message.h" | |
| 30 | #include "xsd_QName.h" | |
| 31 | #include "libxml/schemasInternals.h" | |
| 32 | #include "libxml/xmlschemastypes.h" | |
| 33 | ||
| 34 | /** | |
| 35 | * QName of the xsd_string builtin type | |
| 36 | * @ingroup xsd_string | |
| 37 | */ | |
| 38 | xsd_QName xsd_string_qname = | |
| 39 | { | |
| 40 | "http://www.w3.org/2001/XMLSchema", | |
| 41 | "string" | |
| 42 | ||
| 43 | }; | |
| 44 | ||
| 45 | #ifndef GLOBUS_DONT_DOCUMENT_INTERNAL | |
| 46 | static | |
| 47 | globus_result_t | |
| 48 | xsd_string_serialize_wrapper( | |
| 49 | const xsd_QName * element_qname, | |
| 50 | const void * instance, | |
| 51 | globus_soap_message_handle_t message_handle, | |
| 52 | globus_xsd_element_options_t options) | |
| 53 | 10623 | { |
| 54 | 10623 | return xsd_string_serialize( |
| 55 | element_qname, | |
| 56 | (xsd_string *) instance, | |
| 57 | message_handle, options); | |
| 58 | } | |
| 59 | /* xsd_string_serialize_wrapper() */ | |
| 60 | ||
| 61 | static | |
| 62 | globus_result_t | |
| 63 | xsd_string_deserialize_pointer_wrapper( | |
| 64 | const xsd_QName * element_qname, | |
| 65 | void ** ip, | |
| 66 | globus_soap_message_handle_t message_handle, | |
| 67 | globus_xsd_element_options_t options) | |
| 68 | 2058 | { |
| 69 | 2058 | return xsd_string_deserialize_pointer( |
| 70 | element_qname, | |
| 71 | (xsd_string **) ip, | |
| 72 | message_handle, options); | |
| 73 | } | |
| 74 | /* xsd_string_deserialize_pointer_wrapper() */ | |
| 75 | ||
| 76 | static | |
| 77 | globus_result_t | |
| 78 | xsd_string_init_wrapper(void **object) | |
| 79 | 2527 | { |
| 80 | 2527 | return xsd_string_init( |
| 81 | (xsd_string **) object); | |
| 82 | } | |
| 83 | /* xsd_string_init_wrapper() */ | |
| 84 | ||
| 85 | static | |
| 86 | void | |
| 87 | xsd_string_destroy_wrapper( | |
| 88 | void * object) | |
| 89 | 27312 | { |
| 90 | 27312 | xsd_string_destroy( |
| 91 | (xsd_string *) object); | |
| 92 | 27312 | } |
| 93 | /* xsd_string_destroy_wrapper() */ | |
| 94 | ||
| 95 | static | |
| 96 | globus_result_t | |
| 97 | xsd_string_copy_wrapper( | |
| 98 | void ** dest_obj, | |
| 99 | const void * src_obj) | |
| 100 | 24613 | { |
| 101 | 24613 | return xsd_string_copy( |
| 102 | (xsd_string **) dest_obj, | |
| 103 | (const xsd_string *) src_obj); | |
| 104 | } | |
| 105 | /* xsd_string_copy_wrapper() */ | |
| 106 | ||
| 107 | static | |
| 108 | globus_result_t | |
| 109 | xsd_string_init_contents_wrapper(void *object) | |
| 110 | 0 | { |
| 111 | 0 | return xsd_string_init_contents( |
| 112 | (xsd_string *) object); | |
| 113 | } | |
| 114 | /* xsd_string_init_contents_wrapper() */ | |
| 115 | ||
| 116 | static | |
| 117 | void | |
| 118 | xsd_string_destroy_contents_wrapper( | |
| 119 | void * object) | |
| 120 | 22307867 | { |
| 121 | 22307867 | xsd_string_destroy_contents( |
| 122 | (xsd_string *) object); | |
| 123 | 22307867 | } |
| 124 | /* xsd_string_destroy_contents_wrapper() */ | |
| 125 | ||
| 126 | static | |
| 127 | globus_result_t | |
| 128 | xsd_string_copy_contents_wrapper( | |
| 129 | void * dest_obj, | |
| 130 | const void * src_obj) | |
| 131 | 11240063 | { |
| 132 | 11240063 | return xsd_string_copy_contents( |
| 133 | (xsd_string *) dest_obj, | |
| 134 | (const xsd_string *) src_obj); | |
| 135 | } | |
| 136 | /* xsd_string_copy_contents_wrapper() */ | |
| 137 | ||
| 138 | static | |
| 139 | globus_result_t | |
| 140 | xsd_string_serialize_contents_wrapper( | |
| 141 | const xsd_QName * element_qname, | |
| 142 | const void * instance, | |
| 143 | globus_soap_message_handle_t message_handle, | |
| 144 | globus_xsd_element_options_t options) | |
| 145 | 10710 | { |
| 146 | 10710 | return xsd_string_serialize_contents( |
| 147 | element_qname, | |
| 148 | (xsd_string *) instance, | |
| 149 | message_handle, options); | |
| 150 | } | |
| 151 | /* xsd_string_serialize_contents_wrapper() */ | |
| 152 | ||
| 153 | static | |
| 154 | globus_result_t | |
| 155 | xsd_string_deserialize_contents_wrapper( | |
| 156 | const xsd_QName * element_qname, | |
| 157 | void ** instance, | |
| 158 | globus_soap_message_handle_t message_handle, | |
| 159 | globus_xsd_element_options_t options) | |
| 160 | 11985 | { |
| 161 | globus_result_t result; | |
| 162 | 11985 | globus_bool_t allocated = GLOBUS_FALSE; |
| 163 | GlobusFuncName(xsd_string_deserialize_contents_wrapper); | |
| 164 | 11985 | GlobusSoapMessageDebugEnter(); |
| 165 | ||
| 166 | 11985 | if(!*instance) |
| 167 | { | |
| 168 | 0 | result = xsd_string_init( |
| 169 | (xsd_string **)instance); | |
| 170 | 0 | if(result != GLOBUS_SUCCESS) |
| 171 | { | |
| 172 | 0 | goto error; |
| 173 | } | |
| 174 | 0 | allocated = GLOBUS_TRUE; |
| 175 | } | |
| 176 | ||
| 177 | 11985 | result = xsd_string_deserialize_contents( |
| 178 | element_qname, | |
| 179 | *(xsd_string **)instance, | |
| 180 | message_handle, options); | |
| 181 | 11985 | error: |
| 182 | 11985 | if (result != GLOBUS_SUCCESS && allocated) |
| 183 | { | |
| 184 | 0 | xsd_string_destroy(*(xsd_string **)instance); |
| 185 | 0 | *instance = NULL; |
| 186 | } | |
| 187 | 11985 | GlobusSoapMessageDebugExit(); |
| 188 | 11985 | return result; |
| 189 | } | |
| 190 | /* xsd_string_deserialize_contents_wrapper() */ | |
| 191 | ||
| 192 | static | |
| 193 | globus_result_t | |
| 194 | xsd_string_array_serialize_wrapper( | |
| 195 | const xsd_QName * element, | |
| 196 | const void * instance, | |
| 197 | globus_soap_message_handle_t message, | |
| 198 | globus_xsd_element_options_t options) | |
| 199 | 80 | { |
| 200 | 80 | return xsd_string_array_serialize( |
| 201 | element, | |
| 202 | (xsd_string_array *) instance, | |
| 203 | message, options); | |
| 204 | } | |
| 205 | /* xsd_string_array_serialize_wrapper() */ | |
| 206 | ||
| 207 | static | |
| 208 | globus_result_t | |
| 209 | xsd_string_array_deserialize_wrapper( | |
| 210 | const xsd_QName * element_qname, | |
| 211 | void ** inst, | |
| 212 | globus_soap_message_handle_t message, | |
| 213 | globus_xsd_element_options_t options) | |
| 214 | 0 | { |
| 215 | 0 | globus_bool_t allocated = GLOBUS_FALSE; |
| 216 | ||
| 217 | globus_result_t result; | |
| 218 | 0 | if(!*inst) |
| 219 | { | |
| 220 | 0 | result = xsd_string_array_init( |
| 221 | (xsd_string_array **)inst); | |
| 222 | 0 | if(result != GLOBUS_SUCCESS) |
| 223 | { | |
| 224 | 0 | return result; |
| 225 | } | |
| 226 | 0 | allocated = GLOBUS_TRUE; |
| 227 | } | |
| 228 | ||
| 229 | 0 | result = xsd_string_array_deserialize( |
| 230 | element_qname, | |
| 231 | *(xsd_string_array **) inst, | |
| 232 | message, options); | |
| 233 | 0 | if (result != GLOBUS_SUCCESS && allocated) |
| 234 | { | |
| 235 | 0 | xsd_string_array_destroy(*(xsd_string_array **) inst); |
| 236 | 0 | *inst = NULL; |
| 237 | } | |
| 238 | 0 | return result; |
| 239 | } | |
| 240 | /* xsd_string_array_deserialize_wrapper() */ | |
| 241 | ||
| 242 | static | |
| 243 | globus_result_t | |
| 244 | xsd_string_array_init_wrapper( | |
| 245 | void ** arr) | |
| 246 | 68 | { |
| 247 | 68 | return xsd_string_array_init( |
| 248 | (xsd_string_array **) arr); | |
| 249 | } | |
| 250 | /* xsd_string_array_init_wrapper() */ | |
| 251 | ||
| 252 | static | |
| 253 | void | |
| 254 | xsd_string_array_destroy_wrapper( | |
| 255 | void * arr) | |
| 256 | 203 | { |
| 257 | 203 | xsd_string_array_destroy( |
| 258 | (xsd_string_array *) arr); | |
| 259 | 203 | } |
| 260 | /* xsd_string_array_destroy_wrapper() */ | |
| 261 | ||
| 262 | static | |
| 263 | globus_result_t | |
| 264 | xsd_string_array_copy_wrapper( | |
| 265 | void ** dest_arr, | |
| 266 | const void * src_arr) | |
| 267 | 78 | { |
| 268 | 78 | return xsd_string_array_copy( |
| 269 | (xsd_string_array **) dest_arr, | |
| 270 | (const xsd_string_array *) src_arr); | |
| 271 | } | |
| 272 | /* xsd_string_array_copy_wrapper() */ | |
| 273 | ||
| 274 | static | |
| 275 | globus_result_t | |
| 276 | xsd_string_array_init_contents_wrapper( | |
| 277 | void * arr) | |
| 278 | 0 | { |
| 279 | 0 | return xsd_string_array_init_contents( |
| 280 | (xsd_string_array *) arr); | |
| 281 | } | |
| 282 | /* xsd_string_array_init_contents_wrapper() */ | |
| 283 | ||
| 284 | static | |
| 285 | void | |
| 286 | xsd_string_array_destroy_contents_wrapper( | |
| 287 | void * arr) | |
| 288 | 203 | { |
| 289 | 203 | xsd_string_array_destroy_contents( |
| 290 | (xsd_string_array *) arr); | |
| 291 | 203 | } |
| 292 | /* xsd_string_array_destroy_contents_wrapper() */ | |
| 293 | ||
| 294 | static | |
| 295 | globus_result_t | |
| 296 | xsd_string_array_copy_contents_wrapper( | |
| 297 | void * dest_arr, | |
| 298 | const void * src_arr) | |
| 299 | 0 | { |
| 300 | 0 | return xsd_string_array_copy_contents( |
| 301 | (xsd_string_array *) dest_arr, | |
| 302 | (const xsd_string_array *) src_arr); | |
| 303 | } | |
| 304 | /* xsd_string_array_copy_contents_wrapper() */ | |
| 305 | ||
| 306 | static | |
| 307 | void * | |
| 308 | xsd_string_array_push_wrapper( | |
| 309 | void * array) | |
| 310 | 167 | { |
| 311 | 167 | return (void *) xsd_string_array_push((xsd_string_array *) array); |
| 312 | } | |
| 313 | /* xsd_string_array_push_wrapper() */ | |
| 314 | #endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */ | |
| 315 | ||
| 316 | /** | |
| 317 | * Type info for xsd_string | |
| 318 | * @ingroup xsd_string | |
| 319 | * This type info is used when serializing/deserializing an xsd:any | |
| 320 | * which contains array values of this type. | |
| 321 | */ | |
| 322 | struct globus_xsd_type_info_s xsd_string_array_info = | |
| 323 | { | |
| 324 | &xsd_string_qname, | |
| 325 | xsd_string_array_serialize_wrapper, | |
| 326 | xsd_string_array_deserialize_wrapper, | |
| 327 | xsd_string_array_init_wrapper, | |
| 328 | xsd_string_array_destroy_wrapper, | |
| 329 | xsd_string_array_copy_wrapper, | |
| 330 | xsd_string_array_init_contents_wrapper, | |
| 331 | xsd_string_array_destroy_contents_wrapper, | |
| 332 | xsd_string_array_copy_contents_wrapper, | |
| 333 | sizeof(xsd_string), | |
| 334 | xsd_string_array_push_wrapper, | |
| 335 | NULL, | |
| 336 | NULL | |
| 337 | }; | |
| 338 | ||
| 339 | /** | |
| 340 | * Type info for xsd_string | |
| 341 | * @ingroup xsd_string | |
| 342 | * This type info is used when serializing/deserializing an xsd:anyType | |
| 343 | * which contains values of this type. | |
| 344 | */ | |
| 345 | struct globus_xsd_type_info_s xsd_string_contents_info = | |
| 346 | { | |
| 347 | &xsd_string_qname, | |
| 348 | xsd_string_serialize_contents_wrapper, | |
| 349 | xsd_string_deserialize_contents_wrapper, | |
| 350 | xsd_string_init_wrapper, | |
| 351 | xsd_string_destroy_wrapper, | |
| 352 | xsd_string_copy_wrapper, | |
| 353 | xsd_string_init_contents_wrapper, | |
| 354 | xsd_string_destroy_contents_wrapper, | |
| 355 | xsd_string_copy_contents_wrapper, | |
| 356 | sizeof(xsd_string), | |
| 357 | NULL, | |
| 358 | NULL, | |
| 359 | NULL | |
| 360 | }; | |
| 361 | ||
| 362 | /** | |
| 363 | * Type info for xsd_string | |
| 364 | * @ingroup xsd_string | |
| 365 | * This type info is used when serializing/deserializing an xsd:any | |
| 366 | * which contains values of this type. | |
| 367 | */ | |
| 368 | struct globus_xsd_type_info_s xsd_string_info = | |
| 369 | { | |
| 370 | &xsd_string_qname, | |
| 371 | xsd_string_serialize_wrapper, | |
| 372 | xsd_string_deserialize_pointer_wrapper, | |
| 373 | xsd_string_init_wrapper, | |
| 374 | xsd_string_destroy_wrapper, | |
| 375 | xsd_string_copy_wrapper, | |
| 376 | xsd_string_init_contents_wrapper, | |
| 377 | xsd_string_destroy_contents_wrapper, | |
| 378 | xsd_string_copy_contents_wrapper, | |
| 379 | sizeof(xsd_string), | |
| 380 | NULL, | |
| 381 | &xsd_string_contents_info, | |
| 382 | &xsd_string_array_info | |
| 383 | }; | |
| 384 | ||
| 385 | ||
| 386 | /** | |
| 387 | * Initialize the contents of a xsd_string | |
| 388 | * @ingroup xsd_string | |
| 389 | * | |
| 390 | * Initialize the contents of a xsd_string. This should be used | |
| 391 | * when the structure is allocated on the stack or by a some allocator besides | |
| 392 | * xsd_string_init(). The contents may be freed | |
| 393 | * by calling xsd_string_destroy_contents(). | |
| 394 | * | |
| 395 | * @param instance | |
| 396 | * Pointer to an allocated but uninitialized xsd_string. | |
| 397 | */ | |
| 398 | globus_result_t | |
| 399 | xsd_string_init_contents( | |
| 400 | xsd_string * instance) | |
| 401 | 4293 | { |
| 402 | 4293 | globus_result_t result = GLOBUS_SUCCESS; |
| 403 | GlobusFuncName(xsd_string_init_contents); | |
| 404 | 4293 | GlobusSoapMessageDebugEnter(); |
| 405 | ||
| 406 | 4293 | memset(instance, 0, sizeof(xsd_string)); |
| 407 | ||
| 408 | 4293 | GlobusSoapMessageDebugExit(); |
| 409 | 4293 | return result; |
| 410 | } | |
| 411 | ||
| 412 | ||
| 413 | ||
| 414 | /** | |
| 415 | * Initialize a xsd_string | |
| 416 | * @ingroup xsd_string | |
| 417 | * | |
| 418 | * Allocates a new xsd_string and initializes its contents. When the | |
| 419 | * structure is no longer needed, it should be freed by calling | |
| 420 | * xsd_string_destroy(). | |
| 421 | * | |
| 422 | * @param object | |
| 423 | * Pointer to set to a newly allocated instance. | |
| 424 | */ | |
| 425 | globus_result_t | |
| 426 | xsd_string_init( | |
| 427 | xsd_string ** object) | |
| 428 | 4293 | { |
| 429 | 4293 | globus_result_t result = GLOBUS_SUCCESS; |
| 430 | GlobusFuncName(xsd_string_init); | |
| 431 | 4293 | GlobusSoapMessageDebugEnter(); |
| 432 | ||
| 433 | 4293 | *object = malloc(sizeof(xsd_string)); |
| 434 | 4293 | if (*object == NULL) |
| 435 | { | |
| 436 | 0 | result = GlobusSoapMessageErrorOutOfMemory; |
| 437 | ||
| 438 | 0 | goto exit; |
| 439 | } | |
| 440 | 4293 | result = xsd_string_init_contents(*object); |
| 441 | 4293 | if (result != GLOBUS_SUCCESS) |
| 442 | { | |
| 443 | 0 | free(*object); |
| 444 | 0 | *object = NULL; |
| 445 | } | |
| 446 | 4293 | exit: |
| 447 | 4293 | GlobusSoapMessageDebugExit(); |
| 448 | 4293 | return result; |
| 449 | } | |
| 450 | /* xsd_string_init() */ | |
| 451 | ||
| 452 | ||
| 453 | ||
| 454 | /** | |
| 455 | * Destroy a xsd_string | |
| 456 | * @ingroup xsd_string | |
| 457 | * | |
| 458 | * Frees a xsd_string. | |
| 459 | * | |
| 460 | * @param instance | |
| 461 | * Pointer to the instance to destroy. | |
| 462 | */ | |
| 463 | void | |
| 464 | xsd_string_destroy( | |
| 465 | xsd_string * instance) | |
| 466 | 29461 | { |
| 467 | GlobusFuncName(xsd_string_destroy); | |
| 468 | 29461 | GlobusSoapMessageDebugEnter(); |
| 469 | ||
| 470 | 29461 | if(!instance) |
| 471 | { | |
| 472 | 0 | goto exit; |
| 473 | } | |
| 474 | ||
| 475 | 29461 | xsd_string_destroy_contents(instance); |
| 476 | 29461 | free(instance); |
| 477 | ||
| 478 | 29461 | exit: |
| 479 | ||
| 480 | 29461 | GlobusSoapMessageDebugExit(); |
| 481 | 29461 | } |
| 482 | /* xsd_string_destroy() */ | |
| 483 | ||
| 484 | ||
| 485 | ||
| 486 | /** | |
| 487 | * Destroy the contents of a xsd_string | |
| 488 | * @ingroup xsd_string | |
| 489 | * | |
| 490 | * Destroy the the given xsd_string. | |
| 491 | * | |
| 492 | * @param instance | |
| 493 | * Pointer to a xsd_string instance to destroy. | |
| 494 | */ | |
| 495 | void | |
| 496 | xsd_string_destroy_contents( | |
| 497 | xsd_string * instance) | |
| 498 | 22340179 | { |
| 499 | GlobusFuncName(xsd_string_destroy_contents); | |
| 500 | 22340179 | GlobusSoapMessageDebugEnter(); |
| 501 | ||
| 502 | 22340179 | free(*instance); |
| 503 | 22340179 | *instance = NULL; |
| 504 | ||
| 505 | 22340179 | GlobusSoapMessageDebugExit(); |
| 506 | 22340179 | } |
| 507 | /* xsd_string_destroy_contents() */ | |
| 508 | ||
| 509 | ||
| 510 | ||
| 511 | ||
| 512 | /** | |
| 513 | * Copy a xsd_string | |
| 514 | * @ingroup xsd_string | |
| 515 | * | |
| 516 | * Perform a copy of a xsd_string. | |
| 517 | * The @a dest_obj will be allocated, and then a copy of the contents | |
| 518 | * of @a src to it. The caller is responsible for destroying @a dest_objb | |
| 519 | * | |
| 520 | * @param dest_obj | |
| 521 | * The xsd_string to be initialized with a copy of the | |
| 522 | * contents of the @a src_obj structure. | |
| 523 | * @param src_obj | |
| 524 | * Source xsd_string to be copied. | |
| 525 | */ | |
| 526 | globus_result_t | |
| 527 | xsd_string_copy( | |
| 528 | xsd_string ** dest_obj, | |
| 529 | const xsd_string * src_obj) | |
| 530 | 25816 | { |
| 531 | 25816 | globus_result_t result = GLOBUS_SUCCESS; |
| 532 | xsd_string * instance; | |
| 533 | GlobusFuncName(xsd_string_copy); | |
| 534 | ||
| 535 | 25816 | GlobusSoapMessageDebugEnter(); |
| 536 | ||
| 537 | 25816 | instance = malloc(sizeof(xsd_string)); |
| 538 | 25816 | if (instance == NULL) |
| 539 | { | |
| 540 | 0 | GlobusSoapMessageDebugExit(); |
| 541 | 0 | return GlobusSoapMessageErrorOutOfMemory; |
| 542 | } | |
| 543 | ||
| 544 | 25816 | result = xsd_string_copy_contents(instance, src_obj); |
| 545 | 25816 | if(result != GLOBUS_SUCCESS) |
| 546 | { | |
| 547 | 0 | free(instance); |
| 548 | 0 | instance = NULL; |
| 549 | 0 | result = GlobusSoapMessageErrorOutOfMemory; |
| 550 | } | |
| 551 | ||
| 552 | 25816 | *dest_obj = instance; |
| 553 | 25816 | GlobusSoapMessageDebugExit(); |
| 554 | 25816 | return result; |
| 555 | } | |
| 556 | /* xsd_string_copy() */ | |
| 557 | ||
| 558 | ||
| 559 | ||
| 560 | /** | |
| 561 | * Copy the contents of a xsd_string | |
| 562 | * @ingroup xsd_string | |
| 563 | * | |
| 564 | * Perform a copy of the contents of a xsd_string. | |
| 565 | * The @a dest_obj value must point to a previously-allocated xsd_string. | |
| 566 | * A copy of value @ src_obj will be made to | |
| 567 | * @a dest_obj. | |
| 568 | * | |
| 569 | * @param dest_obj | |
| 570 | * Structure to be initialized with copies of the contents of @a src_obj. | |
| 571 | * @param src_obj | |
| 572 | * Source xsd_string to be copied. | |
| 573 | */ | |
| 574 | globus_result_t | |
| 575 | xsd_string_copy_contents( | |
| 576 | xsd_string * dest_obj, | |
| 577 | const xsd_string * src_obj) | |
| 578 | 11267586 | { |
| 579 | 11267586 | globus_result_t result = GLOBUS_SUCCESS; |
| 580 | GlobusFuncName(xsd_string_copy_contents); | |
| 581 | ||
| 582 | 11267586 | GlobusSoapMessageDebugEnter(); |
| 583 | ||
| 584 | ||
| 585 | 11267586 | *dest_obj = globus_libc_strdup(*src_obj); |
| 586 | 11267586 | if (*dest_obj == NULL) |
| 587 | { | |
| 588 | 0 | result = GlobusSoapMessageErrorOutOfMemory; |
| 589 | } | |
| 590 | ||
| 591 | ||
| 592 | 11267586 | GlobusSoapMessageDebugExit(); |
| 593 | 11267586 | return result; |
| 594 | } | |
| 595 | /* xsd_string_copy_contents() */ | |
| 596 | ||
| 597 | ||
| 598 | /** | |
| 599 | * @fn globus_result_t xsd_string_serialize_contents(const xsd_QName *element_qname, const xsd_string * inst, globus_soap_message_handle_t message_handle, globus_xsd_element_options_t options) | |
| 600 | * Serialize the contents of a xsd_string | |
| 601 | * @ingroup xsd_string | |
| 602 | * Serialize a xsd_string without an enclosing element. | |
| 603 | * | |
| 604 | * @param element_qname | |
| 605 | * Ignored parameter. | |
| 606 | * @param inst | |
| 607 | * The xsd_string to serialize. | |
| 608 | * @param message_handle | |
| 609 | * The handle to serialize the contents on. | |
| 610 | * @param options | |
| 611 | * Serialization options. | |
| 612 | */ | |
| 613 | ||
| 614 | globus_result_t | |
| 615 | xsd_string_serialize_contents( | |
| 616 | const xsd_QName * element_qname, /* ignored */ | |
| 617 | const xsd_string * inst, | |
| 618 | globus_soap_message_handle_t message_handle, | |
| 619 | globus_xsd_element_options_t options) | |
| 620 | 10773 | { |
| 621 | 10773 | globus_result_t result = GLOBUS_SUCCESS; |
| 622 | GlobusFuncName(xsd_string_serialize_contents); | |
| 623 | 10773 | GlobusSoapMessageDebugEnter(); |
| 624 | ||
| 625 | ||
| 626 | 10773 | result = globus_soap_message_serialize_string( |
| 627 | message_handle, | |
| 628 | inst); | |
| 629 | 10773 | if(result != GLOBUS_SUCCESS) |
| 630 | { | |
| 631 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 632 | result, NULL, element_qname); | |
| 633 | } | |
| 634 | ||
| 635 | ||
| 636 | 10773 | GlobusSoapMessageDebugExit(); |
| 637 | 10773 | return result; |
| 638 | } | |
| 639 | /* xsd_string_serialize_contents() */ | |
| 640 | ||
| 641 | ||
| 642 | ||
| 643 | globus_result_t | |
| 644 | xsd_string_serialize( | |
| 645 | const xsd_QName * element_qname, | |
| 646 | const xsd_string * instance, | |
| 647 | globus_soap_message_handle_t message_handle, | |
| 648 | globus_xsd_element_options_t options) | |
| 649 | 10722 | { |
| 650 | 10722 | globus_result_t result = GLOBUS_SUCCESS; |
| 651 | GlobusFuncName(xsd_string_serialize); | |
| 652 | 10722 | GlobusSoapMessageDebugEnter(); |
| 653 | ||
| 654 | 10722 | result = globus_xsd_generic_serialize( |
| 655 | element_qname, | |
| 656 | &xsd_string_info, | |
| 657 | instance, | |
| 658 | message_handle, | |
| 659 | options); | |
| 660 | ||
| 661 | 10722 | return result; |
| 662 | } | |
| 663 | /* xsd_string_serialize() */ | |
| 664 | ||
| 665 | ||
| 666 | ||
| 667 | globus_result_t | |
| 668 | xsd_string_deserialize_contents( | |
| 669 | const xsd_QName * element_qname, /* ignored */ | |
| 670 | xsd_string * inst, | |
| 671 | globus_soap_message_handle_t message_handle, | |
| 672 | globus_xsd_element_options_t options) | |
| 673 | 12107 | { |
| 674 | 12107 | globus_result_t result = GLOBUS_SUCCESS; |
| 675 | GlobusFuncName(xsd_string_deserialize_contents); | |
| 676 | 12107 | GlobusSoapMessageDebugEnter(); |
| 677 | ||
| 678 | ||
| 679 | 12107 | if (options & GLOBUS_XSD_ELEMENT_ATTRIBUTE) |
| 680 | { | |
| 681 | 0 | result = globus_soap_message_deserialize_string_attribute( |
| 682 | message_handle, element_qname, inst); | |
| 683 | } | |
| 684 | else | |
| 685 | { | |
| 686 | 12107 | result = globus_soap_message_deserialize_string( |
| 687 | message_handle, inst); | |
| 688 | } | |
| 689 | ||
| 690 | ||
| 691 | 12107 | GlobusSoapMessageDebugExit(); |
| 692 | 12107 | return result; |
| 693 | } | |
| 694 | /* xsd_string_deserialize_contents() */ | |
| 695 | ||
| 696 | ||
| 697 | ||
| 698 | globus_result_t | |
| 699 | xsd_string_deserialize( | |
| 700 | const xsd_QName * element_qname, | |
| 701 | xsd_string * instance, | |
| 702 | globus_soap_message_handle_t message_handle, | |
| 703 | globus_xsd_element_options_t options) | |
| 704 | 9980 | { |
| 705 | 9980 | globus_result_t result = GLOBUS_SUCCESS; |
| 706 | GlobusFuncName(xsd_string_deserialize); | |
| 707 | 9980 | GlobusSoapMessageDebugEnter(); |
| 708 | ||
| 709 | 9980 | result = globus_xsd_generic_deserialize( |
| 710 | element_qname, | |
| 711 | &xsd_string_info, | |
| 712 | (void **) &instance, | |
| 713 | message_handle, | |
| 714 | options); | |
| 715 | ||
| 716 | 9980 | GlobusSoapMessageDebugExit(); |
| 717 | 9980 | return result; |
| 718 | } | |
| 719 | /* xsd_string_deserialize() */ | |
| 720 | ||
| 721 | globus_result_t | |
| 722 | xsd_string_deserialize_pointer( | |
| 723 | const xsd_QName * element_qname, | |
| 724 | xsd_string ** ip, | |
| 725 | globus_soap_message_handle_t message_handle, | |
| 726 | globus_xsd_element_options_t options) | |
| 727 | 2058 | { |
| 728 | 2058 | globus_result_t result = GLOBUS_SUCCESS; |
| 729 | GlobusFuncName(xsd_string_deserialize_pointer); | |
| 730 | 2058 | GlobusSoapMessageDebugEnter(); |
| 731 | ||
| 732 | 2058 | result = globus_xsd_generic_deserialize_pointer( |
| 733 | element_qname, | |
| 734 | &xsd_string_info, | |
| 735 | (void **)ip, | |
| 736 | message_handle, | |
| 737 | options); | |
| 738 | ||
| 739 | 2058 | return result; |
| 740 | } | |
| 741 | /* xsd_string_deserialize_pointer() */ | |
| 742 | ||
| 743 | ||
| 744 | ||
| 745 | globus_result_t | |
| 746 | xsd_string_array_init_contents( | |
| 747 | xsd_string_array * array) | |
| 748 | 5360126 | { |
| 749 | GlobusFuncName(xsd_string_array_init_contents); | |
| 750 | 5360126 | GlobusSoapMessageDebugEnter(); |
| 751 | ||
| 752 | 5360126 | array->elements = NULL; |
| 753 | 5360126 | array->length = 0; |
| 754 | 5360126 | array->type_info = &xsd_string_info; |
| 755 | ||
| 756 | 5360126 | GlobusSoapMessageDebugExit(); |
| 757 | 5360126 | return GLOBUS_SUCCESS; |
| 758 | } | |
| 759 | /* xsd_string_array_init_contents() */ | |
| 760 | ||
| 761 | ||
| 762 | ||
| 763 | globus_result_t | |
| 764 | xsd_string_array_init( | |
| 765 | xsd_string_array ** arr) | |
| 766 | 140 | { |
| 767 | 140 | return globus_xsd_generic_array_init( |
| 768 | (globus_xsd_generic_array_t **) arr, | |
| 769 | &xsd_string_info); | |
| 770 | } | |
| 771 | /* xsd_string_array_init() */ | |
| 772 | ||
| 773 | ||
| 774 | ||
| 775 | void | |
| 776 | xsd_string_array_destroy_contents( | |
| 777 | xsd_string_array * array) | |
| 778 | 7531212 | { |
| 779 | 7531212 | globus_xsd_generic_array_destroy_contents( |
| 780 | (globus_xsd_generic_array_t *) array); | |
| 781 | 7531212 | } |
| 782 | /* xsd_string_array_destroy_contents() */ | |
| 783 | ||
| 784 | ||
| 785 | ||
| 786 | void | |
| 787 | xsd_string_array_destroy( | |
| 788 | xsd_string_array * array) | |
| 789 | 203 | { |
| 790 | ||
| 791 | 203 | globus_xsd_generic_array_destroy( |
| 792 | (globus_xsd_generic_array_t *) array); | |
| 793 | 203 | } |
| 794 | /* xsd_string_array_destroy() */ | |
| 795 | ||
| 796 | ||
| 797 | ||
| 798 | ||
| 799 | globus_result_t | |
| 800 | xsd_string_array_copy( | |
| 801 | xsd_string_array ** dest_arr, | |
| 802 | const xsd_string_array * src_arr) | |
| 803 | 78 | { |
| 804 | 78 | return globus_xsd_generic_array_copy( |
| 805 | (globus_xsd_generic_array_t **) dest_arr, | |
| 806 | (const globus_xsd_generic_array_t *) src_arr); | |
| 807 | } | |
| 808 | /* xsd_string_array_copy() */ | |
| 809 | ||
| 810 | ||
| 811 | ||
| 812 | globus_result_t | |
| 813 | xsd_string_array_copy_contents( | |
| 814 | xsd_string_array * dest_arr, | |
| 815 | const xsd_string_array * src_arr) | |
| 816 | 2698389 | { |
| 817 | 2698389 | return globus_xsd_generic_array_copy_contents( |
| 818 | (globus_xsd_generic_array_t *) dest_arr, | |
| 819 | (const globus_xsd_generic_array_t *) src_arr); | |
| 820 | } | |
| 821 | /* xsd_string_array_copy_contents() */ | |
| 822 | ||
| 823 | ||
| 824 | ||
| 825 | xsd_string * | |
| 826 | xsd_string_array_push( | |
| 827 | xsd_string_array * array) | |
| 828 | 11103733 | { |
| 829 | /* Some contents initializers don't initialize subelments but to set their | |
| 830 | * values to be NULL | |
| 831 | */ | |
| 832 | 11103733 | if (array->type_info == NULL) |
| 833 | { | |
| 834 | 24 | array->type_info = &xsd_string_info; |
| 835 | } | |
| 836 | 11103733 | return globus_xsd_generic_array_push( |
| 837 | (globus_xsd_generic_array_t *) array); | |
| 838 | } | |
| 839 | /* xsd_string_array_push() */ | |
| 840 | ||
| 841 | ||
| 842 | ||
| 843 | globus_result_t | |
| 844 | xsd_string_array_serialize( | |
| 845 | const xsd_QName * element_qname, | |
| 846 | const xsd_string_array * array, | |
| 847 | globus_soap_message_handle_t message, | |
| 848 | globus_xsd_element_options_t options) | |
| 849 | 80 | { |
| 850 | 80 | return globus_xsd_generic_array_serialize( |
| 851 | element_qname, | |
| 852 | (const globus_xsd_generic_array_t *) array, | |
| 853 | message, | |
| 854 | options); | |
| 855 | } | |
| 856 | /* xsd_string_array_serialize() */ | |
| 857 | ||
| 858 | ||
| 859 | ||
| 860 | ||
| 861 | globus_result_t | |
| 862 | xsd_string_array_deserialize( | |
| 863 | const xsd_QName * element_qname, | |
| 864 | xsd_string_array * array, | |
| 865 | globus_soap_message_handle_t message, | |
| 866 | globus_xsd_element_options_t options) | |
| 867 | 29 | { |
| 868 | /* Some initializers set the array contents to NULL */ | |
| 869 | 29 | if (array->type_info == NULL) |
| 870 | { | |
| 871 | 29 | array->type_info = &xsd_string_info; |
| 872 | } | |
| 873 | ||
| 874 | 29 | return globus_xsd_generic_array_deserialize( |
| 875 | element_qname, | |
| 876 | (globus_xsd_generic_array_t *) array, | |
| 877 | message, | |
| 878 | options); | |
| 879 | } | |
| 880 | /* xsd_string_array_deserialize() */ | |
| 881 | ||
| 882 | ||
| 883 | ||
| 884 | globus_result_t | |
| 885 | xsd_string_serialize_attribute( | |
| 886 | const xsd_QName * attr_qname, | |
| 887 | const xsd_string * val, | |
| 888 | globus_soap_message_handle_t handle, | |
| 889 | globus_xsd_element_options_t options) | |
| 890 | 0 | { |
| 891 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 892 | GlobusFuncName(xsd_string_serialize_attribute); | |
| 893 | 0 | GlobusSoapMessageDebugEnter(); |
| 894 | ||
| 895 | 0 | result = globus_soap_message_serialize_string_attribute( |
| 896 | handle, attr_qname, val); | |
| 897 | 0 | if(result != GLOBUS_SUCCESS) |
| 898 | { | |
| 899 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 900 | result, NULL, attr_qname); | |
| 901 | 0 | goto exit; |
| 902 | } | |
| 903 | 0 | exit: |
| 904 | ||
| 905 | 0 | GlobusSoapMessageDebugExit(); |
| 906 | 0 | return result; |
| 907 | } | |
| 908 | /* xsd_string_serialize_attribute() */ | |
| 909 | ||
| 910 | ||
| 911 | ||
| 912 | ||
| 913 | globus_result_t | |
| 914 | xsd_string_deserialize_attribute( | |
| 915 | const xsd_QName * attr_qname, | |
| 916 | xsd_string * instance, | |
| 917 | globus_soap_message_handle_t message, | |
| 918 | globus_xsd_element_options_t options) | |
| 919 | 2719 | { |
| 920 | 2719 | globus_result_t result = GLOBUS_SUCCESS; |
| 921 | GlobusFuncName(xsd_string_deserialize_attribute); | |
| 922 | 2719 | GlobusSoapMessageDebugEnter(); |
| 923 | ||
| 924 | 2719 | result = globus_soap_message_deserialize_string_attribute( |
| 925 | message, attr_qname, instance); | |
| 926 | ||
| 927 | 2719 | if(result != GLOBUS_SUCCESS) |
| 928 | { | |
| 929 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 930 | result, attr_qname); | |
| 931 | } | |
| 932 | ||
| 933 | 2719 | GlobusSoapMessageDebugExit(); |
| 934 | 2719 | return result; |
| 935 | } | |
| 936 | /* xsd_string_deserialize_attribute() */ | |
| 937 | ||
| 938 | ||
| 939 | ||
| 940 | globus_result_t | |
| 941 | xsd_string_deserialize_attribute_pointer( | |
| 942 | const xsd_QName * attr_qname, | |
| 943 | xsd_string ** ip, | |
| 944 | globus_soap_message_handle_t message, | |
| 945 | globus_xsd_element_options_t options) | |
| 946 | 1203 | { |
| 947 | 1203 | xsd_string * instance = NULL; |
| 948 | 1203 | globus_result_t result = GLOBUS_SUCCESS; |
| 949 | GlobusFuncName(xsd_string_deserialize_attribute_pointer); | |
| 950 | 1203 | GlobusSoapMessageDebugEnter(); |
| 951 | ||
| 952 | ||
| 953 | 1203 | result = xsd_string_init(&instance); |
| 954 | ||
| 955 | 1203 | if (result != GLOBUS_SUCCESS) |
| 956 | { | |
| 957 | 0 | goto exit; |
| 958 | } | |
| 959 | ||
| 960 | 1203 | result = globus_soap_message_deserialize_string_attribute( |
| 961 | message, | |
| 962 | attr_qname, | |
| 963 | instance); | |
| 964 | ||
| 965 | 1203 | if(GlobusSoapMessageStatusAttributeNotFoundCheck(result)) |
| 966 | { | |
| 967 | 0 | result = GLOBUS_SUCCESS; |
| 968 | 0 | xsd_string_destroy(instance); |
| 969 | 0 | instance = NULL; |
| 970 | goto exit; | |
| 971 | } | |
| 972 | ||
| 973 | 1203 | exit: |
| 974 | 1203 | *ip = instance; |
| 975 | ||
| 976 | 1203 | GlobusSoapMessageDebugExit(); |
| 977 | 1203 | return result; |
| 978 | } | |
| 979 | /* xsd_string_deserialize_attribute_pointer() */ | |
| 980 | ||
| 981 | ||
| 982 | ||
| 983 | globus_result_t | |
| 984 | xsd_string_list_serialize( | |
| 985 | const xsd_QName * element_qname, | |
| 986 | const xsd_string_array * inst, | |
| 987 | globus_soap_message_handle_t message_handle, | |
| 988 | globus_xsd_element_options_t options) | |
| 989 | 0 | { |
| 990 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 991 | GlobusFuncName(xsd_string_list_serialize); | |
| 992 | 0 | GlobusSoapMessageDebugEnter(); |
| 993 | ||
| 994 | 0 | if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY)) |
| 995 | { | |
| 996 | /* add begin element */ | |
| 997 | 0 | result = globus_soap_message_element_ns_set( |
| 998 | message_handle, | |
| 999 | element_qname, | |
| 1000 | element_qname->Namespace, | |
| 1001 | &options); | |
| 1002 | 0 | if(result != GLOBUS_SUCCESS) |
| 1003 | { | |
| 1004 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 1005 | result, NULL, element_qname); | |
| 1006 | 0 | goto exit; |
| 1007 | } | |
| 1008 | ||
| 1009 | 0 | result = globus_soap_message_serialize_element( |
| 1010 | message_handle, | |
| 1011 | element_qname, | |
| 1012 | options, | |
| 1013 | &xsd_string_qname); | |
| 1014 | 0 | if(result != GLOBUS_SUCCESS) |
| 1015 | { | |
| 1016 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 1017 | result, NULL, element_qname); | |
| 1018 | 0 | goto exit; |
| 1019 | } | |
| 1020 | ||
| 1021 | 0 | if(options & GLOBUS_XSD_ELEMENT_TYPE_ATTR && |
| 1022 | !globus_soap_message_serialize_is_c14n_subset(message_handle)) | |
| 1023 | { | |
| 1024 | xsd_QName type_attr; | |
| 1025 | 0 | type_attr.local = "type"; |
| 1026 | 0 | type_attr.Namespace = |
| 1027 | "http://www.w3.org/2001/XMLSchema-instance"; | |
| 1028 | 0 | result = globus_soap_message_serialize_QName_attribute( |
| 1029 | message_handle, | |
| 1030 | &type_attr, | |
| 1031 | &xsd_string_qname); | |
| 1032 | 0 | if(result != GLOBUS_SUCCESS) |
| 1033 | { | |
| 1034 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 1035 | result, NULL, element_qname); | |
| 1036 | 0 | goto exit; |
| 1037 | } | |
| 1038 | } | |
| 1039 | ||
| 1040 | 0 | result = globus_soap_message_serialize_element_begin_close( |
| 1041 | message_handle, element_qname); | |
| 1042 | 0 | if(result != GLOBUS_SUCCESS) |
| 1043 | { | |
| 1044 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 1045 | result, NULL, element_qname); | |
| 1046 | 0 | goto exit; |
| 1047 | } | |
| 1048 | } | |
| 1049 | ||
| 1050 | 0 | result = xsd_string_list_serialize_contents( |
| 1051 | inst, | |
| 1052 | message_handle, | |
| 1053 | options); | |
| 1054 | 0 | if(result != GLOBUS_SUCCESS) |
| 1055 | { | |
| 1056 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 1057 | result, NULL, element_qname); | |
| 1058 | 0 | goto exit; |
| 1059 | } | |
| 1060 | ||
| 1061 | 0 | if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY)) |
| 1062 | { | |
| 1063 | /* add end element */ | |
| 1064 | 0 | result = globus_soap_message_serialize_element_end( |
| 1065 | message_handle, | |
| 1066 | element_qname, | |
| 1067 | options, | |
| 1068 | &xsd_string_qname); | |
| 1069 | 0 | if(result != GLOBUS_SUCCESS) |
| 1070 | { | |
| 1071 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 1072 | result, NULL, element_qname); | |
| 1073 | 0 | goto exit; |
| 1074 | } | |
| 1075 | ||
| 1076 | 0 | globus_soap_message_element_ns_remove( |
| 1077 | message_handle, | |
| 1078 | element_qname->Namespace, | |
| 1079 | &options); | |
| 1080 | } | |
| 1081 | ||
| 1082 | 0 | exit: |
| 1083 | ||
| 1084 | 0 | GlobusSoapMessageDebugExit(); |
| 1085 | 0 | return result; |
| 1086 | } | |
| 1087 | ||
| 1088 | ||
| 1089 | ||
| 1090 | ||
| 1091 | globus_result_t | |
| 1092 | xsd_string_list_serialize_contents( | |
| 1093 | const xsd_string_array * inst, | |
| 1094 | globus_soap_message_handle_t message_handle, | |
| 1095 | globus_xsd_element_options_t options) | |
| 1096 | 0 | { |
| 1097 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 1098 | GlobusFuncName(xsd_string_list_serialize_contents); | |
| 1099 | 0 | GlobusSoapMessageDebugEnter(); |
| 1100 | ||
| 1101 | 0 | result = globus_soap_message_serialize_string_list( |
| 1102 | message_handle, | |
| 1103 | inst); | |
| 1104 | 0 | if(result != GLOBUS_SUCCESS) |
| 1105 | { | |
| 1106 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 1107 | result, "could not serialize as list", &xsd_string_qname); | |
| 1108 | 0 | goto exit; |
| 1109 | } | |
| 1110 | ||
| 1111 | 0 | exit: |
| 1112 | ||
| 1113 | 0 | GlobusSoapMessageDebugExit(); |
| 1114 | 0 | return result; |
| 1115 | } | |
| 1116 | /* xsd_string_list_serialize_contents() */ | |
| 1117 | ||
| 1118 | ||
| 1119 | ||
| 1120 | globus_result_t | |
| 1121 | xsd_string_list_serialize_attribute( | |
| 1122 | const xsd_QName * attr_qname, | |
| 1123 | const xsd_string_array * inst, | |
| 1124 | globus_soap_message_handle_t message_handle, | |
| 1125 | globus_xsd_element_options_t options) | |
| 1126 | 0 | { |
| 1127 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 1128 | GlobusFuncName(xsd_string_list_serialize_attribute); | |
| 1129 | 0 | GlobusSoapMessageDebugEnter(); |
| 1130 | ||
| 1131 | 0 | result = globus_soap_message_serialize_string_attribute_list( |
| 1132 | message_handle, | |
| 1133 | attr_qname, | |
| 1134 | inst); | |
| 1135 | 0 | if(result != GLOBUS_SUCCESS) |
| 1136 | { | |
| 1137 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 1138 | result, NULL, attr_qname); | |
| 1139 | 0 | goto exit; |
| 1140 | } | |
| 1141 | ||
| 1142 | 0 | exit: |
| 1143 | ||
| 1144 | 0 | GlobusSoapMessageDebugExit(); |
| 1145 | 0 | return result; |
| 1146 | } | |
| 1147 | /* xsd_string_list_serialize_attribute() */ | |
| 1148 | ||
| 1149 | ||
| 1150 | ||
| 1151 | globus_result_t | |
| 1152 | xsd_string_list_deserialize_attribute( | |
| 1153 | const xsd_QName * attr_qname, | |
| 1154 | xsd_string_array * ip, | |
| 1155 | globus_soap_message_handle_t message_handle, | |
| 1156 | globus_xsd_element_options_t options) | |
| 1157 | 0 | { |
| 1158 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 1159 | GlobusFuncName(xsd_string_list_deserialize_attribute); | |
| 1160 | 0 | GlobusSoapMessageDebugEnter(); |
| 1161 | ||
| 1162 | 0 | result = |
| 1163 | globus_soap_message_deserialize_string_attribute_list( | |
| 1164 | message_handle, attr_qname, ip); | |
| 1165 | 0 | if(result != GLOBUS_SUCCESS) |
| 1166 | { | |
| 1167 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 1168 | result, attr_qname); | |
| 1169 | } | |
| 1170 | ||
| 1171 | 0 | return result; |
| 1172 | } | |
| 1173 | /* xsd_string_list_deserialize_attribute() */ | |
| 1174 | ||
| 1175 | ||
| 1176 | ||
| 1177 | globus_result_t | |
| 1178 | xsd_string_list_deserialize( | |
| 1179 | const xsd_QName * element_qname, | |
| 1180 | xsd_string_array * ip, | |
| 1181 | globus_soap_message_handle_t message_handle, | |
| 1182 | globus_xsd_element_options_t options) | |
| 1183 | 0 | { |
| 1184 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 1185 | GlobusFuncName(xsd_string_list_deserialize); | |
| 1186 | 0 | GlobusSoapMessageDebugEnter(); |
| 1187 | ||
| 1188 | 0 | if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY)) |
| 1189 | { | |
| 1190 | 0 | result = globus_soap_message_deserialize_element( |
| 1191 | message_handle, element_qname); | |
| 1192 | 0 | if(result != GLOBUS_SUCCESS) |
| 1193 | { | |
| 1194 | 0 | goto error_exit; |
| 1195 | } | |
| 1196 | ||
| 1197 | 0 | result = |
| 1198 | globus_soap_message_deserialize_element_begin_close( | |
| 1199 | message_handle); | |
| 1200 | 0 | if(result != GLOBUS_SUCCESS) |
| 1201 | { | |
| 1202 | 0 | goto error_exit; |
| 1203 | } | |
| 1204 | } | |
| 1205 | ||
| 1206 | 0 | result = |
| 1207 | xsd_string_list_deserialize_contents( | |
| 1208 | ip, message_handle, options); | |
| 1209 | 0 | if(result != GLOBUS_SUCCESS) |
| 1210 | { | |
| 1211 | 0 | goto error_exit; |
| 1212 | } | |
| 1213 | ||
| 1214 | 0 | if(!(options & GLOBUS_XSD_ELEMENT_CONTENTS_ONLY)) |
| 1215 | { | |
| 1216 | 0 | result = |
| 1217 | globus_soap_message_deserialize_element_end( | |
| 1218 | message_handle, | |
| 1219 | element_qname); | |
| 1220 | 0 | if(result != GLOBUS_SUCCESS) |
| 1221 | { | |
| 1222 | 0 | goto error_exit; |
| 1223 | } | |
| 1224 | } | |
| 1225 | ||
| 1226 | 0 | goto exit; |
| 1227 | ||
| 1228 | 0 | error_exit: |
| 1229 | ||
| 1230 | 0 | if(!GlobusSoapMessageStatusCheck(result)) |
| 1231 | { | |
| 1232 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 1233 | result, element_qname); | |
| 1234 | } | |
| 1235 | ||
| 1236 | 0 | exit: |
| 1237 | ||
| 1238 | 0 | GlobusSoapMessageDebugExit(); |
| 1239 | 0 | return result; |
| 1240 | } | |
| 1241 | /* xsd_string_list_deserialize() */ | |
| 1242 | ||
| 1243 | ||
| 1244 | ||
| 1245 | globus_result_t | |
| 1246 | xsd_string_list_deserialize_contents( | |
| 1247 | xsd_string_array * ip, | |
| 1248 | globus_soap_message_handle_t message_handle, | |
| 1249 | globus_xsd_element_options_t options) | |
| 1250 | 0 | { |
| 1251 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 1252 | GlobusFuncName(xsd_string_list_deserialize_contents); | |
| 1253 | 0 | GlobusSoapMessageDebugEnter(); |
| 1254 | ||
| 1255 | 0 | result = |
| 1256 | globus_soap_message_deserialize_string_list( | |
| 1257 | message_handle, ip); | |
| 1258 | if(result != GLOBUS_SUCCESS) | |
| 1259 | { | |
| 1260 | 0 | goto exit; |
| 1261 | } | |
| 1262 | ||
| 1263 | 0 | exit: |
| 1264 | ||
| 1265 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 1266 | result, &xsd_string_qname); | |
| 1267 | 0 | return result; |
| 1268 | } | |
| 1269 | /* xsd_string_list_deserialize_contents() */ | |
| 1270 | ||
| 1271 | ||
| 1272 | ||
| 1273 | globus_result_t | |
| 1274 | globus_soap_message_serialize_string( | |
| 1275 | globus_soap_message_handle_t handle, | |
| 1276 | const xsd_string * val) | |
| 1277 | 11365 | { |
| 1278 | 11365 | int res = 0; |
| 1279 | 11365 | globus_result_t result = GLOBUS_SUCCESS; |
| 1280 | GlobusFuncName(globus_soap_message_serialize_string); | |
| 1281 | 11365 | GlobusSoapMessageDebugEnter(); |
| 1282 | ||
| 1283 | ||
| 1284 | 11365 | res = xmlTextWriterWriteString( |
| 1285 | handle->writer, | |
| 1286 | (xmlChar *) *val); | |
| 1287 | 11365 | if(res < 0) |
| 1288 | { | |
| 1289 | 0 | xmlErrorPtr err = xmlGetLastError(); |
| 1290 | 0 | GlobusSoapMessageErrorSerializeFailed( |
| 1291 | GLOBUS_SUCCESS, (err ? err->message : ""), | |
| 1292 | &xsd_string_qname); | |
| 1293 | 0 | goto exit; |
| 1294 | } | |
| 1295 | ||
| 1296 | ||
| 1297 | 11365 | exit: |
| 1298 | ||
| 1299 | 11365 | GlobusSoapMessageDebugExit(); |
| 1300 | 11365 | return result; |
| 1301 | } | |
| 1302 | /* globus_soap_message_serialize_string() */ | |
| 1303 | ||
| 1304 | globus_result_t | |
| 1305 | globus_soap_message_deserialize_string( | |
| 1306 | globus_soap_message_handle_t handle, | |
| 1307 | xsd_string * val) | |
| 1308 | 12230 | { |
| 1309 | 12230 | globus_result_t result = GLOBUS_SUCCESS; |
| 1310 | const xmlChar * content; | |
| 1311 | const xmlChar * content_save; | |
| 1312 | GlobusFuncName(globus_soap_message_deserialize_string); | |
| 1313 | 12230 | GlobusSoapMessageDebugEnter(); |
| 1314 | ||
| 1315 | 12230 | result = globus_i_soap_message_deserialize_next_content(handle); |
| 1316 | 12230 | if(result != GLOBUS_SUCCESS) |
| 1317 | { | |
| 1318 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 1319 | result, &xsd_string_qname); | |
| 1320 | 0 | goto exit; |
| 1321 | } | |
| 1322 | ||
| 1323 | 12230 | content = xmlTextReaderConstValue(handle->reader); |
| 1324 | 12230 | if (!content) |
| 1325 | { | |
| 1326 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 1327 | GLOBUS_SUCCESS, &xsd_string_qname); | |
| 1328 | } | |
| 1329 | 12230 | content_save = content; |
| 1330 | { | |
| 1331 | ||
| 1332 | 12230 | *val = (xsd_string) globus_libc_strdup((char *) content); |
| 1333 | ||
| 1334 | } | |
| 1335 | ||
| 1336 | 12230 | exit: |
| 1337 | 12230 | GlobusSoapMessageDebugExit(); |
| 1338 | 12230 | return result; |
| 1339 | } | |
| 1340 | /* globus_soap_message_deserialize_string() */ | |
| 1341 | ||
| 1342 | globus_result_t | |
| 1343 | globus_soap_message_serialize_string_list( | |
| 1344 | globus_soap_message_handle_t handle, | |
| 1345 | const xsd_string_array * inst) | |
| 1346 | 0 | { |
| 1347 | 0 | int i = 0; |
| 1348 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 1349 | int res; | |
| 1350 | GlobusFuncName(globus_soap_message_serialize_string_list); | |
| 1351 | 0 | GlobusSoapMessageDebugEnter(); |
| 1352 | ||
| 1353 | 0 | for(i = 0; i < inst->length; ++i) |
| 1354 | { | |
| 1355 | 0 | result = globus_soap_message_serialize_string( |
| 1356 | handle, | |
| 1357 | &inst->elements[i]); | |
| 1358 | ||
| 1359 | 0 | if (result != GLOBUS_SUCCESS) |
| 1360 | { | |
| 1361 | 0 | goto exit; |
| 1362 | } | |
| 1363 | ||
| 1364 | 0 | if (i != (inst->length-1)) |
| 1365 | { | |
| 1366 | 0 | res = xmlTextWriterWriteString(handle->writer, (xmlChar *) " "); |
| 1367 | 0 | if(res < 0) |
| 1368 | { | |
| 1369 | 0 | xmlErrorPtr err = xmlGetLastError(); |
| 1370 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 1371 | (handle->result ? handle->result : GLOBUS_SUCCESS), | |
| 1372 | (err ? err->message : ""), | |
| 1373 | &xsd_string_qname); | |
| 1374 | 0 | goto exit; |
| 1375 | } | |
| 1376 | } | |
| 1377 | } | |
| 1378 | ||
| 1379 | 0 | exit: |
| 1380 | ||
| 1381 | 0 | GlobusSoapMessageDebugExit(); |
| 1382 | 0 | return result; |
| 1383 | } | |
| 1384 | /* globus_soap_message_serialize_string_list() */ | |
| 1385 | ||
| 1386 | globus_result_t | |
| 1387 | globus_soap_message_deserialize_string_list( | |
| 1388 | globus_soap_message_handle_t handle, | |
| 1389 | xsd_string_array * array_val) | |
| 1390 | 0 | { |
| 1391 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 1392 | 0 | xmlChar * content_value = NULL; |
| 1393 | 0 | xmlChar * content = NULL; |
| 1394 | char * saveptr; | |
| 1395 | xsd_string * val; | |
| 1396 | GlobusFuncName(globus_soap_message_deserialize_string_list); | |
| 1397 | 0 | GlobusSoapMessageDebugEnter(); |
| 1398 | ||
| 1399 | 0 | result = globus_i_soap_message_deserialize_next_content(handle); |
| 1400 | 0 | if(result != GLOBUS_SUCCESS) |
| 1401 | { | |
| 1402 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 1403 | result, &xsd_string_qname); | |
| 1404 | 0 | goto exit; |
| 1405 | } | |
| 1406 | ||
| 1407 | 0 | content_value = xmlTextReaderValue(handle->reader); |
| 1408 | 0 | if (!content_value) |
| 1409 | { | |
| 1410 | 0 | result = GlobusSoapMessageErrorDeserializeFailed( |
| 1411 | GLOBUS_SUCCESS, &xsd_string_qname); | |
| 1412 | 0 | goto exit; |
| 1413 | } | |
| 1414 | ||
| 1415 | 0 | for (content = (xmlChar *) strtok_r((char *) content_value, " \t\r\n", &saveptr); |
| 1416 | 0 | content != NULL; |
| 1417 | 0 | content = (xmlChar *) strtok_r(NULL, " \t\r\n", &saveptr)) |
| 1418 | { | |
| 1419 | 0 | val = xsd_string_array_push(array_val); |
| 1420 | { | |
| 1421 | ||
| 1422 | 0 | *val = (xsd_string) globus_libc_strdup((char *) content); |
| 1423 | ||
| 1424 | } | |
| 1425 | } | |
| 1426 | ||
| 1427 | 0 | exit: |
| 1428 | 0 | if (content_value != NULL) |
| 1429 | { | |
| 1430 | 0 | xmlFree(content_value); |
| 1431 | } | |
| 1432 | 0 | if (result != GLOBUS_SUCCESS) |
| 1433 | { | |
| 1434 | 0 | xsd_string_array_destroy_contents(array_val); |
| 1435 | } | |
| 1436 | 0 | GlobusSoapMessageDebugExit(); |
| 1437 | 0 | return result; |
| 1438 | } | |
| 1439 | /* globus_soap_message_deserialize_string_list() */ | |
| 1440 | ||
| 1441 | globus_result_t | |
| 1442 | globus_soap_message_serialize_string_attribute( | |
| 1443 | globus_soap_message_handle_t handle, | |
| 1444 | const xsd_QName * attr_name, | |
| 1445 | const xsd_string * val) | |
| 1446 | 29 | { |
| 1447 | 29 | globus_result_t result = GLOBUS_SUCCESS; |
| 1448 | GlobusFuncName(globus_soap_message_serialize_string_attribute); | |
| 1449 | 29 | GlobusSoapMessageDebugEnter(); |
| 1450 | ||
| 1451 | 29 | if (val == NULL) |
| 1452 | { | |
| 1453 | 0 | result = GlobusSoapMessageErrorNullParam; |
| 1454 | ||
| 1455 | 0 | goto exit; |
| 1456 | } | |
| 1457 | ||
| 1458 | 29 | result = globus_soap_message_serialize_attribute( |
| 1459 | handle, | |
| 1460 | attr_name); | |
| 1461 | 29 | if (result != GLOBUS_SUCCESS) |
| 1462 | { | |
| 1463 | 0 | goto exit; |
| 1464 | } | |
| 1465 | ||
| 1466 | 29 | result = globus_soap_message_serialize_string( |
| 1467 | handle, | |
| 1468 | val); | |
| 1469 | 29 | if(result != GLOBUS_SUCCESS) |
| 1470 | { | |
| 1471 | 0 | goto exit; |
| 1472 | } | |
| 1473 | ||
| 1474 | 29 | result = globus_soap_message_serialize_attribute_end( |
| 1475 | handle, | |
| 1476 | attr_name); | |
| 1477 | ||
| 1478 | 29 | exit: |
| 1479 | ||
| 1480 | 29 | GlobusSoapMessageDebugExit(); |
| 1481 | 29 | return result; |
| 1482 | } | |
| 1483 | /* globus_soap_message_serialize_string_attribute() */ | |
| 1484 | ||
| 1485 | globus_result_t | |
| 1486 | globus_soap_message_deserialize_string_attribute( | |
| 1487 | globus_soap_message_handle_t handle, | |
| 1488 | const xsd_QName * attr_qname, | |
| 1489 | xsd_string * val) | |
| 1490 | 4572 | { |
| 1491 | 4572 | globus_result_t result = GLOBUS_SUCCESS; |
| 1492 | 4572 | xmlChar * content = NULL; |
| 1493 | 4572 | xmlChar * content_save = NULL; |
| 1494 | GlobusFuncName(globus_soap_message_deserialize_string_attribute); | |
| 1495 | 4572 | GlobusSoapMessageDebugEnter(); |
| 1496 | ||
| 1497 | 4572 | if (val == NULL || attr_qname == NULL || attr_qname->local == NULL) |
| 1498 | { | |
| 1499 | 0 | result = GlobusSoapMessageErrorNullParam; |
| 1500 | ||
| 1501 | 0 | goto exit; |
| 1502 | } | |
| 1503 | ||
| 1504 | 4572 | result = globus_soap_message_deserialize_attribute( |
| 1505 | handle, | |
| 1506 | attr_qname, | |
| 1507 | &content); | |
| 1508 | 4572 | if (result != GLOBUS_SUCCESS) |
| 1509 | { | |
| 1510 | 485 | goto exit; |
| 1511 | } | |
| 1512 | 4087 | content_save = content; |
| 1513 | ||
| 1514 | { | |
| 1515 | ||
| 1516 | 4087 | *val = (xsd_string) globus_libc_strdup((char *) content); |
| 1517 | ||
| 1518 | } | |
| 1519 | 4572 | exit: |
| 1520 | 4572 | if (content_save != NULL) |
| 1521 | { | |
| 1522 | 4087 | xmlFree(content_save); |
| 1523 | } | |
| 1524 | ||
| 1525 | 4572 | GlobusSoapMessageDebugExit(); |
| 1526 | 4572 | return result; |
| 1527 | } | |
| 1528 | /* globus_soap_message_deserialize_string_attribute() */ | |
| 1529 | ||
| 1530 | globus_result_t | |
| 1531 | globus_soap_message_serialize_string_attribute_list( | |
| 1532 | globus_soap_message_handle_t handle, | |
| 1533 | const xsd_QName * attr_name, | |
| 1534 | const xsd_string_array * val) | |
| 1535 | 0 | { |
| 1536 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 1537 | GlobusFuncName(globus_soap_message_serialize_string_attribute_list); | |
| 1538 | 0 | GlobusSoapMessageDebugEnter(); |
| 1539 | ||
| 1540 | 0 | if (val == NULL) |
| 1541 | { | |
| 1542 | 0 | result = GlobusSoapMessageErrorNullParam; |
| 1543 | ||
| 1544 | 0 | goto exit; |
| 1545 | } | |
| 1546 | ||
| 1547 | 0 | result = globus_soap_message_serialize_attribute( |
| 1548 | handle, | |
| 1549 | attr_name); | |
| 1550 | 0 | if (result != GLOBUS_SUCCESS) |
| 1551 | { | |
| 1552 | 0 | goto exit; |
| 1553 | } | |
| 1554 | ||
| 1555 | 0 | result = globus_soap_message_serialize_string_list( |
| 1556 | handle, | |
| 1557 | val); | |
| 1558 | ||
| 1559 | 0 | if(result != GLOBUS_SUCCESS) |
| 1560 | { | |
| 1561 | 0 | goto exit; |
| 1562 | } | |
| 1563 | ||
| 1564 | 0 | result = globus_soap_message_serialize_attribute_end( |
| 1565 | handle, | |
| 1566 | attr_name); | |
| 1567 | ||
| 1568 | 0 | exit: |
| 1569 | ||
| 1570 | 0 | GlobusSoapMessageDebugExit(); |
| 1571 | 0 | return result; |
| 1572 | } | |
| 1573 | /* globus_soap_message_serialize_string_attribute_list() */ | |
| 1574 | ||
| 1575 | globus_result_t | |
| 1576 | globus_soap_message_deserialize_string_attribute_list( | |
| 1577 | globus_soap_message_handle_t handle, | |
| 1578 | const xsd_QName * attr_qname, | |
| 1579 | xsd_string_array * list_val) | |
| 1580 | 0 | { |
| 1581 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 1582 | 0 | xmlChar * content_value = NULL; |
| 1583 | 0 | xmlChar * content = NULL; |
| 1584 | char * saveptr; | |
| 1585 | xsd_string * val; | |
| 1586 | GlobusFuncName(globus_soap_message_deserialize_string_attribute_list); | |
| 1587 | 0 | GlobusSoapMessageDebugEnter(); |
| 1588 | ||
| 1589 | 0 | if (list_val == NULL || attr_qname == NULL || attr_qname->local == NULL) |
| 1590 | { | |
| 1591 | 0 | result = GlobusSoapMessageErrorNullParam; |
| 1592 | ||
| 1593 | 0 | goto exit; |
| 1594 | } | |
| 1595 | ||
| 1596 | 0 | result = globus_soap_message_deserialize_attribute( |
| 1597 | handle, | |
| 1598 | attr_qname, | |
| 1599 | &content_value); | |
| 1600 | 0 | if (result != GLOBUS_SUCCESS) |
| 1601 | { | |
| 1602 | 0 | goto exit; |
| 1603 | } | |
| 1604 | ||
| 1605 | for (content = (xmlChar *) strtok_r((char *) content_value, " \t\r\n", | |
| 1606 | 0 | &saveptr); |
| 1607 | 0 | content != NULL; |
| 1608 | 0 | content = (xmlChar *) strtok_r(NULL, " \t\r\n", &saveptr)) |
| 1609 | { | |
| 1610 | 0 | val = xsd_string_array_push(list_val); |
| 1611 | { | |
| 1612 | ||
| 1613 | 0 | *val = (xsd_string) globus_libc_strdup((char *) content); |
| 1614 | ||
| 1615 | } | |
| 1616 | } | |
| 1617 | 0 | exit: |
| 1618 | 0 | if (content_value != NULL) |
| 1619 | { | |
| 1620 | 0 | xmlFree(content_value); |
| 1621 | } | |
| 1622 | 0 | if (result != GLOBUS_SUCCESS) |
| 1623 | { | |
| 1624 | 0 | xsd_string_array_destroy_contents(list_val); |
| 1625 | } | |
| 1626 | ||
| 1627 | 0 | GlobusSoapMessageDebugExit(); |
| 1628 | 0 | return result; |
| 1629 | } |