summaryrefslogtreecommitdiffstats
path: root/libcsoap/soap-addressing.h
blob: fb3128667ab74eb2d09614a2e269a2d8087a39d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
/******************************************************************
 *  $Id: soap-addressing.h,v 1.9 2006/11/29 11:04:24 m0gg Exp $
 *
 * CSOAP Project:  A SOAP client/server library in C
 * Copyright (C) 2006 Heiko Ronsdorf
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA  02111-1307, USA.
 * 
 * Email: hero@persua.de
 ******************************************************************/
#ifndef __csoap_addressing_h
#define __csoap_addressing_h

/** @file
 *
 * WS-Addressing
 *
 * WS-Addressing provides transport-neutral mechanisms to address Web services
 * and messages. Specifically, this specification defines XML [XML 1.0, XML
 * Namespaces] elements to identify Web service endpoints and to secure
 * end-to-end endpoint identification in messages. This specification enables
 * messaging systems to support message transmission through networks that
 * include processing nodes such as endpoint managers, firewalls, and gateways
 * in a transport-neutral manner.
 *
 * @author	H. Ronsdorf
 * @version	$Revision: 1.9 $
 *
 * @see http://www.w3.org/TR/ws-addr-core/,
 *      http://www.w3.org/TR/REC-xml-names/
 *
 */

/**
 *
 * Namespace used for the addressing elements.
 *
 */
#define WSA_NAMESPACE		"http://www.w3.org/2005/08/addressing"

/**
 *
 * Prefix for the WSA namespace used internally.
 *
 * @see WSA_NAMESPACE
 *
 */
#define WSA_NAMESPACE_PREFIX	"wsa"

/**
 *
 * Some endpoints cannot be located with a meaningful IRI; this URI is used to
 * allow such endpoints to send and receive messages. The precise meaning of
 * this URI is defined by the binding of Addressing to a specific protocol
 * and/or the context in which the EPR is used.
 *
 */
#define WSA_ANONYMOUS		WSA_NAMESPACE "/anonymous"

/**
 *
 * Messages sent to EPRs whose [address] is this value MUST be discarded (i.e.
 * not sent). This URI is typically used in EPRs that designate a reply or fault
 * endpoint (see section 3.1 Abstract Property Definitions) to indicate that no
 * reply or fault message should be sent.
 *
 */
#define WSA_NONE		WSA_NAMESPACE "/none"

/**
 *
 * Indicates that this is a reply to the message identified by the [message id]
 * IRI.
 *
 */
#define WSA_REPLY		WSA_NAMESPACE "/reply"

/**
 *
 * The wsa:EndpointReferenceType type is used wherever a Web service endpoint is
 * referenced.
 *
 */
#define WSA_ENDPOINT_REFERENCE_TYPE	"EndpointReferenceType"

/**
 *
 * This represents some element of type wsa:EndpointReferenceType. Any element
 * of type wsa:EndpointReferenceType may be used. There is an extensibility
 * mechanism to allow additional elements to be specified.
 *
 */
#define WSA_ENDPOINT_REFERENCE		"EndpointReference"

/**
 *
 * This OPTIONAL element contains the elements that convey the [reference
 * properties] of the reference. Each child element of ReferenceProperties
 * represents an individual [reference property].
 *
 */
#define WSA_REFERENCE_PROPERTIES	"ReferenceProperties"

/**
 *
 * This OPTIONAL element may contain elements from any namespace. Such elements
 * form the metadata that is relevant to the interaction with the endpoint.
 *
 */
#define WSA_METADATA			"Metadata"

/**
 *
 * This OPTIONAL element (of type xs:anyURI) conveys the [message id] property.
 * This element MUST be present if wsa:ReplyTo or wsa:FaultTo is present.
 *
 */
#define WSA_MESSAGE_ID			"MessageID"

/**
 *
 * This OPTIONAL (repeating) element information item contributes one abstract
 * [relationship] property value, in the form of a (URI, QName) pair. The
 * [children] property of this element (which is of type xs:anyURI) conveys the
 * [message id] of the related message. This element MUST be present if the
 * message is a reply.
 *
 */
#define WSA_RELATES_TO			"RelatesTo"

/**
 *
 * This OPTIONAL attribute of <wsa:RelatesTo> (of type xs:QName) conveys the
 * relationship type as a QName. When absent, the implied value of this attribute
 * is wsa:Reply.
 *
 */
#define WSA_RELATIONSHIP_TYPE		"RelationshipType"


/**
 *
 * This OPTIONAL element (of type wsa:EndpointReferenceType) provides the value
 * for the [reply endpoint] property. This element MUST be present if a reply is
 * expected. If this element is present, wsa:MessageID MUST be present.
 *
 */
#define WSA_REPLY_TO			"ReplyTo"

/**
 *
 * This OPTIONAL element (of type wsa:EndpointReferenceType) provides the value
 * for the [source endpoint] property.
 *
 */
#define WSA_FROM			"From"

/**
 *
 * This OPTIONAL element (of type wsa:EndpointReferenceType) provides the value
 * for the [fault endpoint] property. If this element is present, wsa:MessageID
 * MUST be present.
 *
 */
#define WSA_FAULT_TO			"FaultTo"

/**
 *
 * This REQUIRED element (of type xs:anyURI) provides the value for the
 * [destination] property.
 *
 */
#define WSA_TO				"To"

/**
 *
 * This REQUIRED element of type xs:anyURI conveys the [action] property. The
 * [children] of this element convey the value of this property.
 *
 */
#define WSA_ACTION			"Action"

/**
 *
 * An address URI that identifies the endpoint. This may be a network address or
 * a logical address.
 *
 */
#define WSA_ADDRESS			"Address"

#ifdef __cplusplus
extern "C" {
#endif

xmlURI *soap_addressing_get_address(xmlNodePtr endpoint_reference);
xmlNodePtr soap_addressing_set_address(xmlNodePtr endpoint_reference, xmlURI *address);

xmlNodePtr soap_addressing_get_reference_properties(xmlNodePtr endpoint_reference);
xmlNodePtr soap_addressing_set_reference_properties(xmlNodePtr endpoint_reference, xmlNodePtr property);

xmlNodePtr soap_addressing_get_metadata(xmlNodePtr endpoint_reference);
xmlNodePtr soap_addressing_set_metadata(xmlNodePtr endpoint_reference, xmlNodePtr parameter);

xmlURI *soap_addressing_get_message_id(struct SoapEnv *envelope);
xmlChar *soap_addressing_get_message_id_string(struct SoapEnv *envelope);
xmlNodePtr soap_addressing_set_message_id(struct SoapEnv *envelope, xmlURI *id);
xmlNodePtr soap_addressing_set_message_id_string(struct SoapEnv *envelope, xmlChar *id);

xmlNodePtr soap_addressing_get_relates_to(struct SoapEnv *envelope);
xmlNodePtr soap_addressing_add_relates_to(struct SoapEnv *envelope, xmlURI *id, xmlURI *type);

xmlNodePtr soap_addressing_get_reply_to(struct SoapEnv *envelope);
xmlNodePtr soap_addressing_set_reply_to(struct SoapEnv *envelope, xmlNodePtr address);

xmlURI *soap_addressing_get_reply_to_address(struct SoapEnv *envelope);
xmlNodePtr soap_addressing_set_reply_to_address(struct SoapEnv *envelope, xmlURI *address);

xmlNodePtr soap_addressing_get_from(struct SoapEnv *envelope);
xmlURI *soap_addressing_get_from_address(struct SoapEnv *envelope);
xmlChar *soap_addressing_get_from_address_string(struct SoapEnv *envelope);

xmlNodePtr soap_addressing_set_from(struct SoapEnv *envelope, xmlNodePtr address);
xmlNodePtr soap_addressing_set_from_address(struct SoapEnv *envelope, xmlURI *address);
xmlNodePtr soap_addressing_set_from_address_string(struct SoapEnv *envelope, const char *from);

xmlNodePtr soap_addressing_get_fault_to(struct SoapEnv *envelope);
xmlURI *soap_addressing_get_fault_to_address(struct SoapEnv *envelope);

xmlNodePtr soap_addressing_set_fault_to(struct SoapEnv *envelope, xmlNodePtr address);
xmlNodePtr soap_addressing_set_fault_to_address(struct SoapEnv *envelope, xmlURI *address);
xmlNodePtr soap_addressing_set_fault_to_string(struct SoapEnv *envelope, const char *fault_to);

xmlNodePtr soap_addressing_get_to(struct SoapEnv *envelope);
xmlURI *soap_addressing_get_to_address(struct SoapEnv *envelope);
xmlChar *soap_addressing_get_to_address_string(struct SoapEnv *envelope);

xmlNodePtr soap_addressing_set_to(struct SoapEnv *envelope, xmlNodePtr address);
xmlNodePtr soap_addressing_set_to_address(struct SoapEnv *envelope, xmlURI *address);
xmlNodePtr soap_addressing_set_to_address_string(struct SoapEnv *envelope, const char *to);

xmlURI *soap_addressing_get_action(struct SoapEnv *envelope);
xmlChar *soap_addressing_get_action_string(struct SoapEnv *envelope);

xmlNodePtr soap_addressing_set_action(struct SoapEnv *envelope, xmlURI *action);
xmlNodePtr soap_addressing_set_action_string(struct SoapEnv *envelope, const char *action);

#ifdef __cplusplus
}
#endif

#endif