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 "interop_test.h"
13
14 #include "xsd_dateTime.h"
15 #include "xsd_string.h"
16
17 #define WSRL_NS "http://docs.oasis-open.org" \
18                 "/wsrf/2004/06/wsrf-WS-ResourceLifetime-1.2-draft-01.xsd"
19
20 xsd_QName
21 termination_time_rp_qname =
22 {
23     WSRL_NS,
24     "TerminationTime"
25 };
26 xsd_QName
27 current_time_rp_qname =
28 {
29     WSRL_NS,
30     "CurrentTime"
31 };
32
33 xsd_QName
34 foo_rp_qname =
35 {
36     "http://widgets.com",
37     "foo"
38 };
39
40 static
41 globus_xsd_type_info_t termination_time_element_info;
42
43 static
44 globus_xsd_type_info_t current_time_element_info;
45
46 static
47 globus_xsd_type_info_t foo_element_info;
48
49 globus_result_t
50 interop_test_init_registry(
51     globus_xsd_type_registry_t          registry)
52 4 {
53 4     globus_result_t                     result;
54
55 4     result = globus_xsd_type_info_init_from_template(
56         &termination_time_element_info,
57         &termination_time_rp_qname,
58         &xsd_dateTime_info);
59
60 4     if (result != GLOBUS_SUCCESS)
61     {
62 0         goto out;
63     }
64 4     result = globus_xsd_type_info_init_from_template(
65         &current_time_element_info,
66         &current_time_rp_qname,
67         &xsd_dateTime_info);
68
69 4     if (result != GLOBUS_SUCCESS)
70     {
71 0         goto destroy_termination_time_element_info;
72     }
73
74 4     result = globus_xsd_type_info_init_from_template(
75         &foo_element_info,
76         &foo_rp_qname,
77         &xsd_string_info);
78
79 4     if (result != GLOBUS_SUCCESS)
80     {
81 0         goto destroy_current_time_element_info;
82     }
83
84 4     result = globus_xsd_type_registry_insert(
85         registry,
86         foo_element_info,
87         NULL);
88
89 4     if (result != GLOBUS_SUCCESS)
90     {
91 0         goto destroy_foo_element_info;
92     }
93 4     result = globus_xsd_type_registry_insert(
94         registry,
95         current_time_element_info,
96         NULL);
97
98 4     if (result != GLOBUS_SUCCESS)
99     {
100 0         goto destroy_current_time_element_info;
101     }
102 4     result = globus_xsd_type_registry_insert(
103         registry,
104         termination_time_element_info,
105         NULL);
106 4     if (result != GLOBUS_SUCCESS)
107     {
108 0         goto destroy_termination_time_element_info;
109     }
110
111 4     return result;
112
113 destroy_foo_element_info:
114 0     globus_xsd_type_info_destroy(foo_element_info);
115 destroy_current_time_element_info:
116 0     globus_xsd_type_info_destroy(current_time_element_info);
117 destroy_termination_time_element_info:
118 0     globus_xsd_type_info_destroy(termination_time_element_info);
119
120 out:
121 0     return result;
122 }