| 1 | ||
| 2 | #include "SecureCounterService_skeleton.h" | |
| 3 | #include "SecureCounterService_internal_skeleton.h" | |
| 4 | ||
| 5 | #include "globus_wsrf_resource.h" | |
| 6 | #include "globus_wsrf_core_tools.h" | |
| 7 | #include "globus_soap_message_handle.h" | |
| 8 | ||
| 9 | #include "globus_ws_addressing.h" | |
| 10 | #include "globus_ws_security.h" | |
| 11 | ||
| 12 | extern globus_service_descriptor_t SecureCounterService_descriptor; | |
| 13 | ||
| 14 | ||
| 15 | globus_result_t | |
| 16 | SecureCounterService_init( | |
| 17 | globus_service_descriptor_t * service_desc) | |
| 18 | 0 | { |
| 19 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 20 | 0 | GlobusFuncName(SecureCounterService_init); |
| 21 | 0 | SecureCounterServiceDebugEnter(); |
| 22 | ||
| 23 | 0 | result = (globus_result_t) |
| 24 | globus_module_activate(GLOBUS_WSRF_RESOURCE_MODULE); | |
| 25 | 0 | if(result != GLOBUS_SUCCESS) |
| 26 | { | |
| 27 | 0 | goto exit; |
| 28 | } | |
| 29 | ||
| 30 | 0 | if(!service_desc->handlers) |
| 31 | { | |
| 32 | 0 | globus_handler_chain_init(&service_desc->handlers); |
| 33 | } | |
| 34 | ||
| 35 | 0 | result = globus_extension_activate( |
| 36 | GLOBUS_HANDLER_WS_SECMESS_LIB); | |
| 37 | 0 | if(result != GLOBUS_SUCCESS) |
| 38 | { | |
| 39 | 0 | goto exit; |
| 40 | } | |
| 41 | ||
| 42 | 0 | result = globus_extension_activate( |
| 43 | GLOBUS_HANDLER_WS_ADDRESSING_LIB); | |
| 44 | 0 | if(result != GLOBUS_SUCCESS) |
| 45 | { | |
| 46 | 0 | goto exit; |
| 47 | } | |
| 48 | ||
| 49 | 0 | result = globus_handler_chain_push( |
| 50 | service_desc->handlers, | |
| 51 | GLOBUS_HANDLER_TYPE_ALL, | |
| 52 | GLOBUS_HANDLER_WS_ADDRESSING_SERVER); | |
| 53 | 0 | if(result != GLOBUS_SUCCESS) |
| 54 | { | |
| 55 | 0 | goto exit; |
| 56 | } | |
| 57 | ||
| 58 | 0 | result = globus_handler_chain_push( |
| 59 | service_desc->handlers, | |
| 60 | GLOBUS_HANDLER_TYPE_ALL, | |
| 61 | GLOBUS_HANDLER_WS_SECMESS_SERVER); | |
| 62 | 0 | if(result != GLOBUS_SUCCESS) |
| 63 | { | |
| 64 | 0 | goto exit; |
| 65 | } | |
| 66 | ||
| 67 | exit: | |
| 68 | 0 | SecureCounterServiceDebugExit(); |
| 69 | 0 | return result; |
| 70 | } | |
| 71 | ||
| 72 | globus_result_t | |
| 73 | SecureCounterService_finalize( | |
| 74 | globus_service_descriptor_t * service_desc) | |
| 75 | 0 | { |
| 76 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 77 | 0 | GlobusFuncName(SecureCounterService_finalize); |
| 78 | ||
| 79 | 0 | SecureCounterServiceDebugEnter(); |
| 80 | ||
| 81 | /* do any service specific finalize stuff here, | |
| 82 | * opposite of CounterService_init | |
| 83 | */ | |
| 84 | ||
| 85 | 0 | if(service_desc->handlers) |
| 86 | { | |
| 87 | 0 | globus_handler_chain_destroy( |
| 88 | service_desc->handlers); | |
| 89 | 0 | service_desc->handlers = NULL; |
| 90 | } | |
| 91 | ||
| 92 | 0 | result = globus_extension_deactivate( |
| 93 | GLOBUS_HANDLER_WS_SECMESS_LIB); | |
| 94 | 0 | if(result != GLOBUS_SUCCESS) |
| 95 | { | |
| 96 | 0 | goto exit; |
| 97 | } | |
| 98 | ||
| 99 | 0 | result = globus_extension_deactivate( |
| 100 | GLOBUS_HANDLER_WS_ADDRESSING_LIB); | |
| 101 | 0 | if(result != GLOBUS_SUCCESS) |
| 102 | { | |
| 103 | 0 | goto exit; |
| 104 | } | |
| 105 | ||
| 106 | 0 | result = globus_module_deactivate(GLOBUS_WSRF_RESOURCE_MODULE); |
| 107 | ||
| 108 | exit: | |
| 109 | 0 | SecureCounterServiceDebugExit(); |
| 110 | 0 | return result; |
| 111 | } | |
| 112 | ||
| 113 | /* these functions are the service implementation and | |
| 114 | * must be implemented by the service implementer | |
| 115 | */ | |
| 116 | ||
| 117 | globus_result_t | |
| 118 | CounterPortType_GetCurrentMessage_init( | |
| 119 | globus_service_engine_t engine, | |
| 120 | globus_soap_message_handle_t message, | |
| 121 | wsnt_GetCurrentMessageType * GetCurrentMessage) | |
| 122 | 0 | { |
| 123 | /* add function local variable declarations here */ | |
| 124 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 125 | ||
| 126 | /* initialize trace debugging info */ | |
| 127 | 0 | GlobusFuncName(CounterPortType_GetCurrentMessage_init); |
| 128 | 0 | SecureCounterServiceDebugEnter(); |
| 129 | ||
| 130 | /* Service implementer may implmenent this function. Since this | |
| 131 | * function gets called before deserialization of the request | |
| 132 | * message, the input variable GetCurrentMessage can be initialized | |
| 133 | * however the implementer wants, as well as making any configuration | |
| 134 | * changes to the service engine or soap message handles. | |
| 135 | * | |
| 136 | * If no configuration or initialization needs to be done, this | |
| 137 | * call can remain empty. | |
| 138 | */ | |
| 139 | ||
| 140 | 0 | SecureCounterServiceDebugExit(); |
| 141 | 0 | return GLOBUS_SUCCESS; |
| 142 | } | |
| 143 | ||
| 144 | globus_result_t | |
| 145 | CounterPortType_GetCurrentMessage_impl( | |
| 146 | globus_service_engine_t engine, | |
| 147 | globus_soap_message_handle_t message, | |
| 148 | globus_service_descriptor_t * service, | |
| 149 | wsnt_GetCurrentMessageType * GetCurrentMessage, | |
| 150 | wsnt_GetCurrentMessageResponseType * GetCurrentMessageResponse, | |
| 151 | const char ** fault_name, | |
| 152 | void ** fault) | |
| 153 | 0 | { |
| 154 | /* add function local variable declarations here */ | |
| 155 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 156 | ||
| 157 | /* initialize trace debugging info */ | |
| 158 | 0 | GlobusFuncName(CounterPortType_GetCurrentMessage_impl); |
| 159 | 0 | SecureCounterServiceDebugEnter(); |
| 160 | ||
| 161 | /* This is where it all happens. Service implementer must | |
| 162 | * implmenent this function. Asume that GetCurrentMessage has | |
| 163 | * been initialized and filled with request values. | |
| 164 | * GetCurrentMessageResponse must be set by the implementer. | |
| 165 | */ | |
| 166 | ||
| 167 | 0 | result = SecureCounterServiceErrorNotImplemented( |
| 168 | "CounterPorType_GetCurrentMessage_impl"); | |
| 169 | ||
| 170 | 0 | SecureCounterServiceDebugExit(); |
| 171 | 0 | return result; |
| 172 | } | |
| 173 | ||
| 174 | ||
| 175 | ||
| 176 | /* these functions are the service implementation and | |
| 177 | * must be implemented by the service implementer | |
| 178 | */ | |
| 179 | ||
| 180 | globus_result_t | |
| 181 | CounterPortType_Subscribe_init( | |
| 182 | globus_service_engine_t engine, | |
| 183 | globus_soap_message_handle_t message, | |
| 184 | wsnt_SubscribeType * Subscribe) | |
| 185 | 0 | { |
| 186 | /* add function local variable declarations here */ | |
| 187 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 188 | ||
| 189 | /* initialize trace debugging info */ | |
| 190 | 0 | GlobusFuncName(CounterPortType_Subscribe_init); |
| 191 | 0 | SecureCounterServiceDebugEnter(); |
| 192 | ||
| 193 | /* Service implementer may implmenent this function. Since this | |
| 194 | * function gets called before deserialization of the request | |
| 195 | * message, the input variable Subscribe can be initialized | |
| 196 | * however the implementer wants, as well as making any configuration | |
| 197 | * changes to the service engine or soap message handles. | |
| 198 | * | |
| 199 | * If no configuration or initialization needs to be done, this | |
| 200 | * call can remain empty. | |
| 201 | */ | |
| 202 | ||
| 203 | 0 | SecureCounterServiceDebugExit(); |
| 204 | 0 | return GLOBUS_SUCCESS; |
| 205 | } | |
| 206 | ||
| 207 | globus_result_t | |
| 208 | CounterPortType_Subscribe_impl( | |
| 209 | globus_service_engine_t engine, | |
| 210 | globus_soap_message_handle_t message, | |
| 211 | globus_service_descriptor_t * service, | |
| 212 | wsnt_SubscribeType * Subscribe, | |
| 213 | wsnt_SubscribeResponseType * SubscribeResponse, | |
| 214 | const char ** fault_name, | |
| 215 | void ** fault) | |
| 216 | 0 | { |
| 217 | /* add function local variable declarations here */ | |
| 218 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 219 | ||
| 220 | /* initialize trace debugging info */ | |
| 221 | 0 | GlobusFuncName(CounterPortType_Subscribe_impl); |
| 222 | 0 | SecureCounterServiceDebugEnter(); |
| 223 | ||
| 224 | /* This is where it all happens. Service implementer must | |
| 225 | * implmenent this function. Asume that Subscribe has | |
| 226 | * been initialized and filled with request values. | |
| 227 | * SubscribeResponse must be set by the implementer. | |
| 228 | */ | |
| 229 | ||
| 230 | 0 | result = SecureCounterServiceErrorNotImplemented( |
| 231 | "CounterPortType_Subscribe_impl"); | |
| 232 | ||
| 233 | 0 | SecureCounterServiceDebugExit(); |
| 234 | 0 | return result; |
| 235 | } | |
| 236 | ||
| 237 | /* these functions are the service implementation and | |
| 238 | * must be implemented by the service implementer | |
| 239 | */ | |
| 240 | ||
| 241 | globus_result_t | |
| 242 | CounterPortType_GetMultipleResourceProperties_init( | |
| 243 | globus_service_engine_t engine, | |
| 244 | globus_soap_message_handle_t message, | |
| 245 | wsrp_GetMultipleResourcePropertiesType * GetMultipleResourceProperties) | |
| 246 | 0 | { |
| 247 | /* add function local variable declarations here */ | |
| 248 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 249 | ||
| 250 | /* initialize trace debugging info */ | |
| 251 | 0 | GlobusFuncName(CounterPortType_GetResourceProperties_init); |
| 252 | 0 | SecureCounterServiceDebugEnter(); |
| 253 | ||
| 254 | /* Service implementer may implmenent this function. Since this | |
| 255 | * function gets called before deserialization of the request | |
| 256 | * message, the input variable GetResourceProperty can be initialized | |
| 257 | * however the implementer wants, as well as making any configuration | |
| 258 | * changes to the service engine or soap message handles. | |
| 259 | * | |
| 260 | * If no configuration or initialization needs to be done, this | |
| 261 | * call can remain empty. | |
| 262 | */ | |
| 263 | ||
| 264 | 0 | SecureCounterServiceDebugExit(); |
| 265 | 0 | return GLOBUS_SUCCESS; |
| 266 | } | |
| 267 | ||
| 268 | globus_result_t | |
| 269 | CounterPortType_GetMultipleResourceProperties_impl( | |
| 270 | globus_service_engine_t engine, | |
| 271 | globus_soap_message_handle_t message, | |
| 272 | globus_service_descriptor_t * service, | |
| 273 | wsrp_GetMultipleResourcePropertiesType * GetResourceProperty, | |
| 274 | wsrp_GetMultipleResourcePropertiesResponseType * GetMultipleResourcePropertiesResponse, | |
| 275 | const char ** fault_name, | |
| 276 | void ** fault) | |
| 277 | 0 | { |
| 278 | /* add function local variable declarations here */ | |
| 279 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 280 | ||
| 281 | /* initialize trace debugging info */ | |
| 282 | 0 | GlobusFuncName(CounterPortType_GetMultipleResourceProperties_impl); |
| 283 | 0 | SecureCounterServiceDebugEnter(); |
| 284 | ||
| 285 | /* This is where it all happens. Service implementer must | |
| 286 | * implmenent this function. Asume that GetResourceProperty has | |
| 287 | * been initialized and filled with request values. | |
| 288 | * GetResourcePropertyResponse must be set by the implementer. | |
| 289 | */ | |
| 290 | ||
| 291 | 0 | result = SecureCounterServiceErrorNotImplemented( |
| 292 | "CounterPortType_GetMultipleResourceProperties_impl"); | |
| 293 | ||
| 294 | 0 | SecureCounterServiceDebugExit(); |
| 295 | 0 | return result; |
| 296 | } | |
| 297 | ||
| 298 | ||
| 299 | /* these functions are the service implementation and | |
| 300 | * must be implemented by the service implementer | |
| 301 | */ | |
| 302 | ||
| 303 | globus_result_t | |
| 304 | CounterPortType_GetResourceProperty_init( | |
| 305 | globus_service_engine_t engine, | |
| 306 | globus_soap_message_handle_t message, | |
| 307 | xsd_QName * GetResourceProperty) | |
| 308 | 0 | { |
| 309 | /* add function local variable declarations here */ | |
| 310 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 311 | ||
| 312 | /* initialize trace debugging info */ | |
| 313 | 0 | GlobusFuncName(CounterPortType_GetResourceProperty_init); |
| 314 | 0 | SecureCounterServiceDebugEnter(); |
| 315 | ||
| 316 | /* Service implementer may implmenent this function. Since this | |
| 317 | * function gets called before deserialization of the request | |
| 318 | * message, the input variable GetResourceProperty can be initialized | |
| 319 | * however the implementer wants, as well as making any configuration | |
| 320 | * changes to the service engine or soap message handles. | |
| 321 | * | |
| 322 | * If no configuration or initialization needs to be done, this | |
| 323 | * call can remain empty. | |
| 324 | */ | |
| 325 | ||
| 326 | 0 | SecureCounterServiceDebugExit(); |
| 327 | 0 | return GLOBUS_SUCCESS; |
| 328 | } | |
| 329 | ||
| 330 | globus_result_t | |
| 331 | CounterPortType_GetResourceProperty_impl( | |
| 332 | globus_service_engine_t engine, | |
| 333 | globus_soap_message_handle_t message, | |
| 334 | globus_service_descriptor_t * service, | |
| 335 | xsd_QName * GetResourceProperty, | |
| 336 | wsrp_GetResourcePropertyResponseType * GetResourcePropertyResponse, | |
| 337 | const char ** fault_name, | |
| 338 | void ** fault) | |
| 339 | 0 | { |
| 340 | /* add function local variable declarations here */ | |
| 341 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 342 | ||
| 343 | /* initialize trace debugging info */ | |
| 344 | 0 | GlobusFuncName(CounterPortType_GetResourceProperty_impl); |
| 345 | 0 | SecureCounterServiceDebugEnter(); |
| 346 | ||
| 347 | /* This is where it all happens. Service implementer must | |
| 348 | * implmenent this function. Asume that GetResourceProperty has | |
| 349 | * been initialized and filled with request values. | |
| 350 | * GetResourcePropertyResponse must be set by the implementer. | |
| 351 | */ | |
| 352 | ||
| 353 | 0 | result = SecureCounterServiceErrorNotImplemented( |
| 354 | "CounterPortType_GetResourceProperty_impl"); | |
| 355 | ||
| 356 | 0 | SecureCounterServiceDebugExit(); |
| 357 | 0 | return result; |
| 358 | } | |
| 359 | ||
| 360 | /* these functions are the service implementation and | |
| 361 | * must be implemented by the service implementer | |
| 362 | */ | |
| 363 | ||
| 364 | globus_result_t | |
| 365 | CounterPortType_QueryResourceProperties_init( | |
| 366 | globus_service_engine_t engine, | |
| 367 | globus_soap_message_handle_t message, | |
| 368 | wsrp_QueryResourcePropertiesType * QueryResourceProperties) | |
| 369 | 0 | { |
| 370 | /* add function local variable declarations here */ | |
| 371 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 372 | ||
| 373 | /* initialize trace debugging info */ | |
| 374 | 0 | GlobusFuncName(CounterPortType_QueryResourceProperties_init); |
| 375 | 0 | SecureCounterServiceDebugEnter(); |
| 376 | ||
| 377 | /* Service implementer may implmenent this function. Since this | |
| 378 | * function gets called before deserialization of the request | |
| 379 | * message, the input variable QueryResourceProperties can be initialized | |
| 380 | * however the implementer wants, as well as making any configuration | |
| 381 | * changes to the service engine or soap message handles. | |
| 382 | * | |
| 383 | * If no configuration or initialization needs to be done, this | |
| 384 | * call can remain empty. | |
| 385 | */ | |
| 386 | ||
| 387 | 0 | SecureCounterServiceDebugExit(); |
| 388 | 0 | return GLOBUS_SUCCESS; |
| 389 | } | |
| 390 | ||
| 391 | globus_result_t | |
| 392 | CounterPortType_QueryResourceProperties_impl( | |
| 393 | globus_service_engine_t engine, | |
| 394 | globus_soap_message_handle_t message, | |
| 395 | globus_service_descriptor_t * descriptor, | |
| 396 | wsrp_QueryResourcePropertiesType * QueryResourceProperties, | |
| 397 | wsrp_QueryResourcePropertiesResponseType * QueryResourcePropertiesResponse, | |
| 398 | const char ** fault_name, | |
| 399 | void ** fault) | |
| 400 | 0 | { |
| 401 | /* add function local variable declarations here */ | |
| 402 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 403 | ||
| 404 | /* initialize trace debugging info */ | |
| 405 | 0 | GlobusFuncName(CounterPortType_QueryResourceProperties_impl); |
| 406 | 0 | SecureCounterServiceDebugEnter(); |
| 407 | ||
| 408 | /* This is where it all happens. Service implementer must | |
| 409 | * implmenent this function. Asume that QueryResourceProperties has | |
| 410 | * been initialized and filled with request values. | |
| 411 | * QueryResourcePropertiesResponse must be set by the implementer. | |
| 412 | */ | |
| 413 | ||
| 414 | 0 | result = SecureCounterServiceErrorNotImplemented( |
| 415 | "CounterPortType_QueryResourceProperties_impl"); | |
| 416 | ||
| 417 | 0 | SecureCounterServiceDebugExit(); |
| 418 | 0 | return result; |
| 419 | } | |
| 420 | ||
| 421 | ||
| 422 | ||
| 423 | /* these functions are the service implementation and | |
| 424 | * must be implemented by the service implementer | |
| 425 | */ | |
| 426 | ||
| 427 | globus_result_t | |
| 428 | CounterPortType_Destroy_init( | |
| 429 | globus_service_engine_t engine, | |
| 430 | globus_soap_message_handle_t message, | |
| 431 | wsrl_DestroyType * Destroy) | |
| 432 | 0 | { |
| 433 | /* add function local variable declarations here */ | |
| 434 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 435 | ||
| 436 | /* initialize trace debugging info */ | |
| 437 | 0 | GlobusFuncName(CounterPortType_Destroy_init); |
| 438 | 0 | SecureCounterServiceDebugEnter(); |
| 439 | ||
| 440 | /* Service implementer may implmenent this function. Since this | |
| 441 | * function gets called before deserialization of the request | |
| 442 | * message, the input variable Destroy can be initialized | |
| 443 | * however the implementer wants, as well as making any configuration | |
| 444 | * changes to the service engine or soap message handles. | |
| 445 | * | |
| 446 | * If no configuration or initialization needs to be done, this | |
| 447 | * call can remain empty. | |
| 448 | */ | |
| 449 | ||
| 450 | 0 | SecureCounterServiceDebugExit(); |
| 451 | 0 | return GLOBUS_SUCCESS; |
| 452 | } | |
| 453 | ||
| 454 | globus_result_t | |
| 455 | CounterPortType_Destroy_impl( | |
| 456 | globus_service_engine_t engine, | |
| 457 | globus_soap_message_handle_t message, | |
| 458 | globus_service_descriptor_t * service, | |
| 459 | wsrl_DestroyType * Destroy, | |
| 460 | wsrl_DestroyResponseType * DestroyResponse, | |
| 461 | const char ** fault_name, | |
| 462 | void ** fault) | |
| 463 | 0 | { |
| 464 | /* add function local variable declarations here */ | |
| 465 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 466 | ||
| 467 | /* initialize trace debugging info */ | |
| 468 | 0 | GlobusFuncName(CounterPortType_Destroy_impl); |
| 469 | 0 | SecureCounterServiceDebugEnter(); |
| 470 | ||
| 471 | /* This is where it all happens. Service implementer must | |
| 472 | * implmenent this function. Asume that Destroy has | |
| 473 | * been initialized and filled with request values. | |
| 474 | * DestroyResponse must be set by the implementer. | |
| 475 | */ | |
| 476 | ||
| 477 | 0 | result = SecureCounterServiceErrorNotImplemented( |
| 478 | "CounterPortType_Destroy_impl"); | |
| 479 | ||
| 480 | 0 | SecureCounterServiceDebugExit(); |
| 481 | 0 | return result; |
| 482 | } | |
| 483 | ||
| 484 | ||
| 485 | ||
| 486 | /* these functions are the service implementation and | |
| 487 | * must be implemented by the service implementer | |
| 488 | */ | |
| 489 | ||
| 490 | globus_result_t | |
| 491 | CounterPortType_SetTerminationTime_init( | |
| 492 | globus_service_engine_t engine, | |
| 493 | globus_soap_message_handle_t message, | |
| 494 | wsrl_SetTerminationTimeType * SetTerminationTime) | |
| 495 | 0 | { |
| 496 | /* add function local variable declarations here */ | |
| 497 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 498 | ||
| 499 | /* initialize trace debugging info */ | |
| 500 | 0 | GlobusFuncName(CounterPortType_SetTerminationTime_init); |
| 501 | 0 | SecureCounterServiceDebugEnter(); |
| 502 | ||
| 503 | /* Service implementer may implmenent this function. Since this | |
| 504 | * function gets called before deserialization of the request | |
| 505 | * message, the input variable SetTerminationTime can be initialized | |
| 506 | * however the implementer wants, as well as making any configuration | |
| 507 | * changes to the service engine or soap message handles. | |
| 508 | * | |
| 509 | * If no configuration or initialization needs to be done, this | |
| 510 | * call can remain empty. | |
| 511 | */ | |
| 512 | ||
| 513 | 0 | SecureCounterServiceDebugExit(); |
| 514 | 0 | return GLOBUS_SUCCESS; |
| 515 | } | |
| 516 | ||
| 517 | globus_result_t | |
| 518 | CounterPortType_SetTerminationTime_impl( | |
| 519 | globus_service_engine_t engine, | |
| 520 | globus_soap_message_handle_t message, | |
| 521 | globus_service_descriptor_t * service, | |
| 522 | wsrl_SetTerminationTimeType * SetTerminationTime, | |
| 523 | wsrl_SetTerminationTimeResponseType * SetTerminationTimeResponse, | |
| 524 | const char ** fault_name, | |
| 525 | void ** fault) | |
| 526 | 0 | { |
| 527 | /* add function local variable declarations here */ | |
| 528 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 529 | ||
| 530 | /* initialize trace debugging info */ | |
| 531 | 0 | GlobusFuncName(CounterPortType_SetTerminationTime_impl); |
| 532 | 0 | SecureCounterServiceDebugEnter(); |
| 533 | ||
| 534 | /* This is where it all happens. Service implementer must | |
| 535 | * implmenent this function. Asume that SetTerminationTime has | |
| 536 | * been initialized and filled with request values. | |
| 537 | * SetTerminationTimeResponse must be set by the implementer. | |
| 538 | */ | |
| 539 | ||
| 540 | 0 | result = SecureCounterServiceErrorNotImplemented( |
| 541 | "CounterPortType_SetTerminationTime_impl"); | |
| 542 | ||
| 543 | 0 | SecureCounterServiceDebugExit(); |
| 544 | 0 | return result; |
| 545 | } | |
| 546 | ||
| 547 | ||
| 548 | ||
| 549 | /* these functions are the service implementation and | |
| 550 | * must be implemented by the service implementer | |
| 551 | */ | |
| 552 | ||
| 553 | globus_result_t | |
| 554 | CounterPortType_add_init( | |
| 555 | globus_service_engine_t engine, | |
| 556 | globus_soap_message_handle_t message, | |
| 557 | xsd_int * add) | |
| 558 | 0 | { |
| 559 | /* add function local variable declarations here */ | |
| 560 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 561 | ||
| 562 | /* initialize trace debugging info */ | |
| 563 | 0 | GlobusFuncName(CounterPortType_add_init); |
| 564 | 0 | SecureCounterServiceDebugEnter(); |
| 565 | ||
| 566 | /* Service implementer may implmenent this function. Since this | |
| 567 | * function gets called before deserialization of the request | |
| 568 | * message, the input variable add can be initialized | |
| 569 | * however the implementer wants, as well as making any configuration | |
| 570 | * changes to the service engine or soap message handles. | |
| 571 | * | |
| 572 | * If no configuration or initialization needs to be done, this | |
| 573 | * call can remain empty. | |
| 574 | */ | |
| 575 | ||
| 576 | 0 | SecureCounterServiceDebugExit(); |
| 577 | 0 | return GLOBUS_SUCCESS; |
| 578 | } | |
| 579 | ||
| 580 | globus_result_t | |
| 581 | CounterPortType_add_impl( | |
| 582 | globus_service_engine_t engine, | |
| 583 | globus_soap_message_handle_t message, | |
| 584 | globus_service_descriptor_t * service, | |
| 585 | xsd_int * add, | |
| 586 | xsd_int * addResponse, | |
| 587 | const char ** fault_name, | |
| 588 | void ** fault) | |
| 589 | 0 | { |
| 590 | /* add function local variable declarations here */ | |
| 591 | 0 | xsd_int * counter_value = NULL; |
| 592 | 0 | globus_soap_message_handle_t memory_message = NULL; |
| 593 | 0 | globus_resource_t resource = NULL; |
| 594 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 595 | ||
| 596 | /* initialize trace debugging info */ | |
| 597 | 0 | GlobusFuncName(CounterPortType_add_init); |
| 598 | 0 | SecureCounterServiceDebugEnter(); |
| 599 | ||
| 600 | 0 | result = globus_wsrf_core_get_resource( |
| 601 | message, | |
| 602 | service, | |
| 603 | &resource); | |
| 604 | 0 | if(result != GLOBUS_SUCCESS) |
| 605 | { | |
| 606 | 0 | result = CounterPortType_add_chain_error( |
| 607 | result, | |
| 608 | "Failed to get resource from EPR"); | |
| 609 | 0 | goto exit; |
| 610 | } | |
| 611 | ||
| 612 | 0 | result = globus_resource_get_property(resource, |
| 613 | &CounterPortType_Value_rp_qname, (void **)&counter_value, NULL); | |
| 614 | 0 | if(result != GLOBUS_SUCCESS) |
| 615 | { | |
| 616 | 0 | result = CounterPortType_add_chain_error( |
| 617 | result, | |
| 618 | "Failed to get CounterRP resource property from resource"); | |
| 619 | 0 | goto finish_exit; |
| 620 | } | |
| 621 | ||
| 622 | 0 | *counter_value += *add; |
| 623 | 0 | *addResponse = *counter_value; |
| 624 | ||
| 625 | finish_exit: | |
| 626 | 0 | globus_resource_finish(resource); |
| 627 | exit: | |
| 628 | ||
| 629 | 0 | if(memory_message) |
| 630 | { | |
| 631 | 0 | globus_soap_message_handle_destroy(memory_message); |
| 632 | } | |
| 633 | ||
| 634 | 0 | SecureCounterServiceDebugExit(); |
| 635 | 0 | return result; |
| 636 | } | |
| 637 | ||
| 638 | ||
| 639 | ||
| 640 | /* these functions are the service implementation and | |
| 641 | * must be implemented by the service implementer | |
| 642 | */ | |
| 643 | ||
| 644 | globus_result_t | |
| 645 | CounterPortType_createCounter_init( | |
| 646 | globus_service_engine_t engine, | |
| 647 | globus_soap_message_handle_t message, | |
| 648 | createCounterType * createCounter) | |
| 649 | 0 | { |
| 650 | /* add function local variable declarations here */ | |
| 651 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 652 | ||
| 653 | /* initialize trace debugging info */ | |
| 654 | 0 | GlobusFuncName(CounterPortType_createCounter_init); |
| 655 | 0 | SecureCounterServiceDebugEnter(); |
| 656 | ||
| 657 | /* Service implementer may implmenent this function. Since this | |
| 658 | * function gets called before deserialization of the request | |
| 659 | * message, the input variable createCounter can be initialized | |
| 660 | * however the implementer wants, as well as making any configuration | |
| 661 | * changes to the service engine or soap message handles. | |
| 662 | * | |
| 663 | * If no configuration or initialization needs to be done, this | |
| 664 | * call can remain empty. | |
| 665 | */ | |
| 666 | ||
| 667 | 0 | SecureCounterServiceDebugExit(); |
| 668 | 0 | return GLOBUS_SUCCESS; |
| 669 | } | |
| 670 | ||
| 671 | globus_result_t | |
| 672 | CounterPortType_createCounter_impl( | |
| 673 | globus_service_engine_t engine, | |
| 674 | globus_soap_message_handle_t message, | |
| 675 | globus_service_descriptor_t * service, | |
| 676 | createCounterType * createCounter, | |
| 677 | createCounterResponseType * createCounterResponse, | |
| 678 | const char ** fault_name, | |
| 679 | void ** fault) | |
| 680 | 0 | { |
| 681 | /* add function local variable declarations here */ | |
| 682 | 0 | xsd_any * counter_key; |
| 683 | 0 | char * resource_id; |
| 684 | 0 | xsd_int * counter_value; |
| 685 | 0 | globus_resource_t resource; |
| 686 | 0 | char * endpoint; |
| 687 | 0 | globus_result_t result = GLOBUS_SUCCESS; |
| 688 | ||
| 689 | /* initialize trace debugging info */ | |
| 690 | 0 | GlobusFuncName(CounterPortType_createCounter_init); |
| 691 | 0 | SecureCounterServiceDebugEnter(); |
| 692 | ||
| 693 | 0 | resource_id = globus_common_create_string("%d", random()); |
| 694 | ||
| 695 | 0 | globus_resource_create( |
| 696 | resource_id, &resource); | |
| 697 | ||
| 698 | 0 | memset(createCounterResponse, 0, sizeof(createCounterResponseType)); |
| 699 | ||
| 700 | 0 | wsa_ReferencePropertiesType_init( |
| 701 | &createCounterResponse->EndpointReference.ReferenceProperties); | |
| 702 | ||
| 703 | 0 | counter_key = xsd_any_array_push( |
| 704 | &createCounterResponse->EndpointReference.ReferenceProperties->any); | |
| 705 | ||
| 706 | 0 | counter_key->any_info = &xsd_string_info; |
| 707 | 0 | xsd_QName_init(&counter_key->element); |
| 708 | 0 | counter_key->element->local = globus_libc_strdup("CounterKey"); |
| 709 | 0 | counter_key->element->Namespace = globus_libc_strdup( |
| 710 | SecureCounterService_service_qname.Namespace); | |
| 711 | 0 | xsd_string_init_cstr((xsd_string **)&counter_key->value, resource_id); |
| 712 | ||
| 713 | 0 | globus_service_engine_get_contact(engine, &endpoint); |
| 714 | ||
| 715 | 0 | createCounterResponse->EndpointReference.Address.base_value = |
| 716 | globus_common_create_string("%s/%s", endpoint, | |
| 717 | SECURECOUNTERSERVICE_BASE_PATH); | |
| 718 | ||
| 719 | 0 | result = SecureCounterServiceInitResource( |
| 720 | &createCounterResponse->EndpointReference); | |
| 721 | 0 | if(result != GLOBUS_SUCCESS) |
| 722 | { | |
| 723 | 0 | result = CounterPortType_add_chain_error( |
| 724 | result, "Failed to initialize resource with service"); | |
| 725 | 0 | goto exit; |
| 726 | } | |
| 727 | ||
| 728 | 0 | xsd_int_init(&counter_value); |
| 729 | 0 | *counter_value = 0; |
| 730 | ||
| 731 | 0 | result = globus_resource_create_property( |
| 732 | resource, | |
| 733 | &CounterPortType_Value_rp_qname, | |
| 734 | &CounterPortType_Value_rp_info, counter_value); | |
| 735 | 0 | if(result != GLOBUS_SUCCESS) |
| 736 | { | |
| 737 | 0 | result = CounterPortType_add_chain_error( |
| 738 | result, "Failed to create resource property for CounterRP"); | |
| 739 | goto exit; | |
| 740 | } | |
| 741 | ||
| 742 | exit: | |
| 743 | 0 | if (result != GLOBUS_SUCCESS) |
| 744 | { | |
| 745 | 0 | globus_resource_destroy(resource); |
| 746 | } | |
| 747 | else | |
| 748 | { | |
| 749 | 0 | globus_resource_finish(resource); |
| 750 | } | |
| 751 | ||
| 752 | 0 | SecureCounterServiceDebugExit(); |
| 753 | 0 | return result; |