10 martin 1.3 // Permission is hereby granted, free of charge, to any person obtaining a
11 // copy of this software and associated documentation files (the "Software"),
12 // to deal in the Software without restriction, including without limitation
13 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 // and/or sell copies of the Software, and to permit persons to whom the
15 // Software is furnished to do so, subject to the following conditions:
|
37 kumpf 1.2
38 PEGASUS_NAMESPACE_BEGIN
39
40 XmlNamespace WsmNamespaces::supportedNamespaces[] =
41 {
42 {
43 "SOAP-ENV",
44 "http://www.w3.org/2003/05/soap-envelope",
45 SOAP_ENVELOPE,
46 0
47 },
48 {
49 "SOAP-ENC",
50 "http://www.w3.org/2003/05/soap-encoding",
51 SOAP_ENCODING,
52 0
53 },
54 {
55 "xml",
56 "http://www.w3.org/XML/1998/namespace",
57 XML_NAMESPACE,
58 kumpf 1.2 0
59 },
60 {
61 "xsi",
62 "http://www.w3.org/2001/XMLSchema-instance",
63 XML_SCHEMA_INSTANCE,
64 0
65 },
66 {
67 "xsd",
68 "http://www.w3.org/2001/XMLSchema",
69 XML_SCHEMA,
70 0
71 },
72 {
73 "wsman",
74 "http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd",
75 WS_MAN,
76 0
77 },
78 {
79 kumpf 1.2 "wsmb",
80 "http://schemas.dmtf.org/wbem/wsman/1/cimbinding.xsd",
81 WS_CIM_BINDING,
82 0
83 },
84 {
85 "wsa",
86 "http://schemas.xmlsoap.org/ws/2004/08/addressing",
87 WS_ADDRESSING,
88 0
89 },
90 {
91 "wxf",
92 "http://schemas.xmlsoap.org/ws/2004/09/transfer",
93 WS_TRANSFER,
94 0
95 },
96 {
97 "wsen",
98 "http://schemas.xmlsoap.org/ws/2004/09/enumeration",
99 WS_ENUMERATION,
100 kumpf 1.2 0
101 },
102 {
103 "wse",
104 "http://schemas.xmlsoap.org/ws/2004/08/eventing",
105 WS_EVENTING,
106 0
107 },
108 {
109 "wsp",
110 "http://schemas.xmlsoap.org/ws/2004/09/policy",
111 WS_POLICY,
112 0
113 },
114 {
115 "wsdl",
116 "http://schemas.xmlsoap.org/wsdl",
117 WSDL,
118 0
119 },
120 {
121 kumpf 1.2 "wscim",
122 "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2",
123 WS_CIM_SCHEMA,
124 0
125 },
126 {0, 0, LAST, 0}
127 };
128
129
130 String WsmUtils::getMessageId()
131 {
132 // DSP0226 R5.4.4-1: The MessageID and RelatesTo URIs may be of any format,
133 // as long as they are valid URIs according to RFC 3986. Two URIs are
134 // considered different even if the characters in the URIs differ only by
135 // case.
136 //
137 // The following two formats are endorsed by this specification. The first
138 // is considered a best practice because it is backed by IETF RFC 4122:
139 // urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
140 // or
141 // uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
142 kumpf 1.2 //
143 // In these formats, each x is an uppercase or lowercase hexadecimal digit
144 // (lowercase is required by RFC 4122); there are no spaces or other
145 // tokens. The value may be a DCE-style universally unique identifier
146 // (UUID) with provable uniqueness properties in this format, however, it
147 // is not necessary to have provable uniqueness properties in the URIs
148 // used in the wsa:MessageID and wsa:RelatesTo headers.
149 //
150 // Regardless of format, the URI should not exceed the maximum defined in
151 // R13.1-6. [sic]
152
153 // DSP0226 R5.4.4-2: The MessageID should be generated according to any
154 // algorithm that ensures that no two MessageIDs are repeated. Because
155 // the value is treated as case-sensitive (R5.4.4-1), confusion can arise
156 // if the same value is reused differing only in case. As a result, the
157 // service shall not create or employ MessageID values that differ only in
158 // case. For any message transmitted by the service, the MessageID shall
159 // not be reused.
160
161 // Note: This algorithm could be improved, but provable uniqueness is not
162 // required (see above).
163 kumpf 1.2
164 char uuid[42];
165 sprintf(uuid, "uuid:%08X-%04X-%04X-%04X-%08X%04X",
166 rand(),
167 rand() & 0xFFFF,
168 rand() & 0xFFFF,
169 rand() & 0xFFFF,
170 rand(),
171 rand() & 0xFFFF);
172 return String(uuid, 41);
173 }
174
|