| 1 | /* | |
| 2 | * Portions of this file Copyright 1999-2005 University of Chicago | |
| 3 | * Portions of this file Copyright 1999-2005 The University of Southern California. | |
| 4 | * | |
| 5 | * This file or a portion of this file is licensed under the | |
| 6 | * terms of the Globus Toolkit Public License, found at | |
| 7 | * http://www.globus.org/toolkit/download/license.html. | |
| 8 | * If you redistribute this file, with or without | |
| 9 | * modifications, you must include this notice in the file. | |
| 10 | */ | |
| 11 | ||
| 12 | #include "globus_i_xsd.h" | |
| 13 | #include "globus_i_xsd_type_info.h" | |
| 14 | #include "globus_soap_message.h" | |
| 15 | #include "xsd_language.h" | |
| 16 | ||
| 17 | GLOBUS_I_XSD_DEFINE_QNAME(xsd, language); | |
| 18 | GLOBUS_I_XSD_DEFINE_TYPE_INFO(xsd_language); | |
| 19 | 0 | GLOBUS_I_XSD_DEFINE_TYPE_FUNCTIONS(xsd_language); |
| 20 | 0 | GLOBUS_I_XSD_DEFINE_INIT_CONTENTS_GENERIC(xsd_language); |
| 21 | ||
| 22 | globus_result_t | |
| 23 | xsd_language_copy_contents( | |
| 24 | xsd_language * dest, | |
| 25 | const xsd_language * src) | |
| 26 | 0 | { |
| 27 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 28 | GlobusFuncName(xsd_language_copy_contents); | |
| 29 | 0 | GlobusSoapMessageDebugEnter(); |
| 30 | ||
| 31 | 0 | if(dest) |
| 32 | { | |
| 33 | 0 | if(!src || !*src) |
| 34 | { | |
| 35 | 0 | *dest = NULL; |
| 36 | } | |
| 37 | else | |
| 38 | { | |
| 39 | 0 | *dest = globus_libc_strdup(*src); |
| 40 | 0 | if(!*dest) |
| 41 | { | |
| 42 | 0 | result = GlobusSoapMessageErrorOutOfMemory; |
| 43 | } | |
| 44 | } | |
| 45 | } | |
| 46 | ||
| 47 | 0 | GlobusSoapMessageDebugExit(); |
| 48 | 0 | return result; |
| 49 | } | |
| 50 | void | |
| 51 | xsd_language_destroy_contents( | |
| 52 | xsd_language * instance) | |
| 53 | 0 | { |
| 54 | GlobusFuncName(xsd_language_destroy_contents); | |
| 55 | 0 | GlobusSoapMessageDebugEnter(); |
| 56 | ||
| 57 | 0 | if(*instance) |
| 58 | { | |
| 59 | 0 | free(*instance); |
| 60 | 0 | *instance = NULL; |
| 61 | } | |
| 62 | ||
| 63 | 0 | GlobusSoapMessageDebugExit(); |
| 64 | } | |
| 65 | ||
| 66 | globus_result_t | |
| 67 | xsd_language_serialize_contents( | |
| 68 | xsd_QName * element, | |
| 69 | xsd_language * instance, | |
| 70 | globus_soap_message_handle_t soap_message_handle, | |
| 71 | globus_xsd_element_options_t options) | |
| 72 | 0 | { |
| 73 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 74 | GlobusFuncName(xsd_language_serialize_contents); | |
| 75 | 0 | GlobusSoapMessageDebugEnter(); |
| 76 | ||
| 77 | /* serialize contents of type */ | |
| 78 | 0 | result = globus_soap_message_serialize_string( |
| 79 | soap_message_handle, instance); | |
| 80 | ||
| 81 | 0 | GlobusSoapMessageDebugExit(); |
| 82 | 0 | return result; |
| 83 | } | |
| 84 | ||
| 85 | globus_result_t | |
| 86 | xsd_language_deserialize_contents( | |
| 87 | xsd_QName * eqn, | |
| 88 | xsd_language * instance, | |
| 89 | globus_soap_message_handle_t soap_message_handle, | |
| 90 | globus_xsd_element_options_t options) | |
| 91 | 0 | { |
| 92 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 93 | GlobusFuncName(xsd_language_deserialize_contents); | |
| 94 | 0 | GlobusSoapMessageDebugEnter(); |
| 95 | ||
| 96 | 0 | result = globus_soap_message_deserialize_string( |
| 97 | soap_message_handle, instance); | |
| 98 | ||
| 99 | 0 | GlobusSoapMessageDebugExit(); |
| 100 | 0 | return result; |
| 101 | } | |
| 102 | ||
| 103 | globus_result_t | |
| 104 | xsd_language_serialize_attribute( | |
| 105 | xsd_QName * element_qname, | |
| 106 | xsd_language * instance, | |
| 107 | globus_soap_message_handle_t message_handle, | |
| 108 | globus_xsd_element_options_t options) | |
| 109 | 0 | { |
| 110 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 111 | GlobusFuncName(xsd_language_serialize_attribute); | |
| 112 | 0 | GlobusSoapMessageDebugEnter(); |
| 113 | ||
| 114 | 0 | result = globus_soap_message_serialize_string_attribute( |
| 115 | message_handle, element_qname, instance); | |
| 116 | 0 | if(result != GLOBUS_SUCCESS) |
| 117 | { | |
| 118 | 0 | result = GlobusSoapMessageErrorSerializeFailed( |
| 119 | result, NULL, element_qname); | |
| 120 | goto exit; | |
| 121 | } | |
| 122 | ||
| 123 | 0 | exit: |
| 124 | ||
| 125 | 0 | GlobusSoapMessageDebugExit(); |
| 126 | 0 | return result; |
| 127 | } | |
| 128 | ||
| 129 | globus_result_t | |
| 130 | xsd_language_deserialize_attribute( | |
| 131 | xsd_QName * element_qname, | |
| 132 | xsd_language * ip, | |
| 133 | globus_soap_message_handle_t message_handle, | |
| 134 | globus_xsd_element_options_t options) | |
| 135 | 0 | { |
| 136 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 137 | GlobusFuncName(xsd_language_deserialize_attribute); | |
| 138 | 0 | GlobusSoapMessageDebugEnter(); |
| 139 | ||
| 140 | 0 | result = globus_soap_message_deserialize_string_attribute( |
| 141 | message_handle, element_qname, ip); | |
| 142 | 0 | if(GlobusSoapMessageStatusAttributeNotFoundCheck(result)) |
| 143 | { | |
| 144 | 0 | result = GLOBUS_SUCCESS; |
| 145 | 0 | goto exit; |
| 146 | } | |
| 147 | ||
| 148 | 0 | if(result != GLOBUS_SUCCESS) |
| 149 | { | |
| 150 | goto error_exit; | |
| 151 | } | |
| 152 | ||
| 153 | goto exit; | |
| 154 | ||
| 155 | 0 | error_exit: |
| 156 | ||
| 157 | 0 | GlobusSoapMessageErrorDeserializeFailed(result, element_qname); |
| 158 | ||
| 159 | 0 | exit: |
| 160 | ||
| 161 | 0 | GlobusSoapMessageDebugExit(); |
| 162 | 0 | return result; |
| 163 | } | |
| 164 | ||
| 165 | globus_result_t | |
| 166 | xsd_language_deserialize_attribute_pointer( | |
| 167 | xsd_QName * element_qname, | |
| 168 | xsd_language ** ip, | |
| 169 | globus_soap_message_handle_t message_handle, | |
| 170 | globus_xsd_element_options_t options) | |
| 171 | 0 | { |
| 172 | 0 | xsd_language * instance = NULL; |
| 173 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 174 | GlobusFuncName(xsd_language_deserialize_attribute_pointer); | |
| 175 | 0 | GlobusSoapMessageDebugEnter(); |
| 176 | ||
| 177 | 0 | *ip = NULL; |
| 178 | ||
| 179 | 0 | result = xsd_language_init(&instance); |
| 180 | ||
| 181 | 0 | if(result != GLOBUS_SUCCESS) |
| 182 | { | |
| 183 | 0 | goto error_exit; |
| 184 | } | |
| 185 | ||
| 186 | 0 | result = globus_soap_message_deserialize_string_attribute( |
| 187 | message_handle, element_qname, instance); | |
| 188 | 0 | if(GlobusSoapMessageStatusAttributeNotFoundCheck(result)) |
| 189 | { | |
| 190 | 0 | result = GLOBUS_SUCCESS; |
| 191 | 0 | goto exit; |
| 192 | } | |
| 193 | ||
| 194 | 0 | if(result != GLOBUS_SUCCESS) |
| 195 | { | |
| 196 | 0 | goto error_exit; |
| 197 | } | |
| 198 | ||
| 199 | 0 | *ip = instance; |
| 200 | ||
| 201 | 0 | goto exit; |
| 202 | ||
| 203 | 0 | error_exit: |
| 204 | ||
| 205 | 0 | GlobusSoapMessageErrorDeserializeFailed(result, element_qname); |
| 206 | ||
| 207 | 0 | exit: |
| 208 | ||
| 209 | 0 | if(result != GLOBUS_SUCCESS && instance) |
| 210 | { | |
| 211 | 0 | xsd_language_destroy(instance); |
| 212 | 0 | *ip = NULL; |
| 213 | } | |
| 214 | ||
| 215 | 0 | GlobusSoapMessageDebugExit(); |
| 216 | 0 | return result; |