2 * Copyright 2015 Nikolay Sivov for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #ifndef __WINE_WEBSERVICES_H
20 #define __WINE_WEBSERVICES_H
24 #endif /* __cplusplus */
26 typedef struct _WS_ERROR WS_ERROR
;
27 typedef struct _WS_HEAP WS_HEAP
;
28 typedef struct _WS_XML_BUFFER WS_XML_BUFFER
;
29 typedef struct _WS_XML_READER WS_XML_READER
;
30 typedef struct _WS_XML_WRITER WS_XML_WRITER
;
32 struct _WS_STRUCT_DESCRIPTION
;
33 struct _WS_XML_STRING
;
36 WS_ERROR_PROPERTY_STRING_COUNT
,
37 WS_ERROR_PROPERTY_ORIGINAL_ERROR_CODE
,
38 WS_ERROR_PROPERTY_LANGID
39 } WS_ERROR_PROPERTY_ID
;
41 typedef struct _WS_ERROR_PROPERTY
{
42 WS_ERROR_PROPERTY_ID id
;
48 WS_HEAP_PROPERTY_MAX_SIZE
,
49 WS_HEAP_PROPERTY_TRIM_SIZE
,
50 WS_HEAP_PROPERTY_REQUESTED_SIZE
,
51 WS_HEAP_PROPERTY_ACTUAL_SIZE
52 } WS_HEAP_PROPERTY_ID
;
54 typedef struct _WS_HEAP_PROPERTY
{
55 WS_HEAP_PROPERTY_ID id
;
61 WS_XML_READER_PROPERTY_MAX_DEPTH
,
62 WS_XML_READER_PROPERTY_ALLOW_FRAGMENT
,
63 WS_XML_READER_PROPERTY_MAX_ATTRIBUTES
,
64 WS_XML_READER_PROPERTY_READ_DECLARATION
,
65 WS_XML_READER_PROPERTY_CHARSET
,
66 WS_XML_READER_PROPERTY_ROW
,
67 WS_XML_READER_PROPERTY_COLUMN
,
68 WS_XML_READER_PROPERTY_UTF8_TRIM_SIZE
,
69 WS_XML_READER_PROPERTY_STREAM_BUFFER_SIZE
,
70 WS_XML_READER_PROPERTY_IN_ATTRIBUTE
,
71 WS_XML_READER_PROPERTY_STREAM_MAX_ROOT_MIME_PART_SIZE
,
72 WS_XML_READER_PROPERTY_STREAM_MAX_MIME_HEADERS_SIZE
,
73 WS_XML_READER_PROPERTY_MAX_MIME_PARTS
,
74 WS_XML_READER_PROPERTY_ALLOW_INVALID_CHARACTER_REFERENCES
,
75 WS_XML_READER_PROPERTY_MAX_NAMESPACES
76 } WS_XML_READER_PROPERTY_ID
;
78 typedef struct _WS_XML_READER_PROPERTY
{
79 WS_XML_READER_PROPERTY_ID id
;
82 } WS_XML_READER_PROPERTY
;
85 WS_XML_WRITER_PROPERTY_MAX_DEPTH
,
86 WS_XML_WRITER_PROPERTY_ALLOW_FRAGMENT
,
87 WS_XML_WRITER_PROPERTY_MAX_ATTRIBUTES
,
88 WS_XML_WRITER_PROPERTY_WRITE_DECLARATION
,
89 WS_XML_WRITER_PROPERTY_INDENT
,
90 WS_XML_WRITER_PROPERTY_BUFFER_TRIM_SIZE
,
91 WS_XML_WRITER_PROPERTY_CHARSET
,
92 WS_XML_WRITER_PROPERTY_BUFFERS
,
93 WS_XML_WRITER_PROPERTY_BUFFER_MAX_SIZE
,
94 WS_XML_WRITER_PROPERTY_BYTES
,
95 WS_XML_WRITER_PROPERTY_IN_ATTRIBUTE
,
96 WS_XML_WRITER_PROPERTY_MAX_MIME_PARTS_BUFFER_SIZE
,
97 WS_XML_WRITER_PROPERTY_INITIAL_BUFFER
,
98 WS_XML_WRITER_PROPERTY_ALLOW_INVALID_CHARACTER_REFERENCES
,
99 WS_XML_WRITER_PROPERTY_MAX_NAMESPACES
,
100 WS_XML_WRITER_PROPERTY_BYTES_WRITTEN
,
101 WS_XML_WRITER_PROPERTY_BYTES_TO_CLOSE
,
102 WS_XML_WRITER_PROPERTY_COMPRESS_EMPTY_ELEMENTS
,
103 WS_XML_WRITER_PROPERTY_EMIT_UNCOMPRESSED_EMPTY_ELEMENTS
104 } WS_XML_WRITER_PROPERTY_ID
;
106 typedef struct _WS_XML_WRITER_PROPERTY
{
107 WS_XML_WRITER_PROPERTY_ID id
;
110 } WS_XML_WRITER_PROPERTY
;
112 typedef struct _WS_BYTES
{
117 typedef struct _WS_BUFFERS
{
123 WS_XML_READER_ENCODING_TYPE_TEXT
= 1,
124 WS_XML_READER_ENCODING_TYPE_BINARY
= 2,
125 WS_XML_READER_ENCODING_TYPE_MTOM
= 3,
126 WS_XML_READER_ENCODING_TYPE_RAW
= 4
127 } WS_XML_READER_ENCODING_TYPE
;
129 typedef struct _WS_XML_READER_ENCODING
{
130 WS_XML_READER_ENCODING_TYPE encodingType
;
131 } WS_XML_READER_ENCODING
;
134 WS_XML_WRITER_ENCODING_TYPE_TEXT
= 1,
135 WS_XML_WRITER_ENCODING_TYPE_BINARY
= 2,
136 WS_XML_WRITER_ENCODING_TYPE_MTOM
= 3,
137 WS_XML_WRITER_ENCODING_TYPE_RAW
= 4
138 } WS_XML_WRITER_ENCODING_TYPE
;
140 typedef struct _WS_XML_WRITER_ENCODING
{
141 WS_XML_WRITER_ENCODING_TYPE encodingType
;
142 } WS_XML_WRITER_ENCODING
;
151 typedef struct _WS_XML_READER_TEXT_ENCODING
{
152 WS_XML_READER_ENCODING encoding
;
154 } WS_XML_READER_TEXT_ENCODING
;
156 typedef struct _WS_XML_WRITER_TEXT_ENCODING
{
157 WS_XML_WRITER_ENCODING encoding
;
159 } WS_XML_WRITER_TEXT_ENCODING
;
162 WS_XML_READER_INPUT_TYPE_BUFFER
= 1,
163 WS_XML_READER_INPUT_TYPE_STREAM
= 2
164 } WS_XML_READER_INPUT_TYPE
;
167 WS_XML_WRITER_OUTPUT_TYPE_BUFFER
= 1,
168 WS_XML_WRITER_OUTPUT_TYPE_STREAM
= 2
169 } WS_XML_WRITER_OUTPUT_TYPE
;
171 typedef struct _WS_XML_READER_INPUT
{
172 WS_XML_READER_INPUT_TYPE inputType
;
173 } WS_XML_READER_INPUT
;
175 typedef struct _WS_XML_WRITER_OUTPUT
{
176 WS_XML_WRITER_OUTPUT_TYPE outputType
;
177 } WS_XML_WRITER_OUTPUT
;
179 typedef struct _WS_XML_READER_BUFFER_INPUT
{
180 WS_XML_READER_INPUT input
;
182 ULONG encodedDataSize
;
183 } WS_XML_READER_BUFFER_INPUT
;
185 typedef struct _WS_XML_WRITER_BUFFER_OUTPUT
{
186 WS_XML_WRITER_OUTPUT output
;
187 } WS_XML_WRITER_BUFFER_OUTPUT
;
194 typedef void (CALLBACK
*WS_ASYNC_CALLBACK
)
195 (HRESULT
, WS_CALLBACK_MODEL
, void *);
197 typedef struct _WS_ASYNC_CONTEXT
{
198 WS_ASYNC_CALLBACK callback
;
202 typedef HRESULT (CALLBACK
*WS_READ_CALLBACK
)
203 (void*, void*, ULONG
, ULONG
*, const WS_ASYNC_CONTEXT
*, WS_ERROR
*);
205 typedef struct _WS_XML_READER_STREAM_INPUT
{
206 WS_XML_READER_INPUT input
;
207 WS_READ_CALLBACK readCallback
;
208 void *readCallbackState
;
209 } WS_XML_READER_STREAM_INPUT
;
211 typedef struct _WS_XML_DICTIONARY
{
213 struct _WS_XML_STRING
*strings
;
218 typedef struct _WS_XML_STRING
{
221 WS_XML_DICTIONARY
*dictionary
;
226 WS_ELEMENT_TYPE_MAPPING
= 1,
227 WS_ATTRIBUTE_TYPE_MAPPING
= 2,
228 WS_ELEMENT_CONTENT_TYPE_MAPPING
= 3,
229 WS_ANY_ELEMENT_TYPE_MAPPING
= 4
261 WS_ENDPOINT_ADDRESS_TYPE
,
267 WS_ANY_ATTRIBUTES_TYPE
271 WS_READ_REQUIRED_VALUE
= 1,
272 WS_READ_REQUIRED_POINTER
= 2,
273 WS_READ_OPTIONAL_POINTER
= 3,
274 WS_READ_NILLABLE_POINTER
= 4,
275 WS_READ_NILLABLE_VALUE
= 5
279 WS_WRITE_REQUIRED_VALUE
= 1,
280 WS_WRITE_REQUIRED_POINTER
= 2,
281 WS_WRITE_NILLABLE_VALUE
= 3,
282 WS_WRITE_NILLABLE_POINTER
= 4
286 WS_TYPE_ATTRIBUTE_FIELD_MAPPING
,
287 WS_ATTRIBUTE_FIELD_MAPPING
,
288 WS_ELEMENT_FIELD_MAPPING
,
289 WS_REPEATING_ELEMENT_FIELD_MAPPING
,
290 WS_TEXT_FIELD_MAPPING
,
292 WS_XML_ATTRIBUTE_FIELD_MAPPING
,
293 WS_ELEMENT_CHOICE_FIELD_MAPPING
,
294 WS_REPEATING_ELEMENT_CHOICE_FIELD_MAPPING
,
295 WS_ANY_ELEMENT_FIELD_MAPPING
,
296 WS_REPEATING_ANY_ELEMENT_FIELD_MAPPING
,
297 WS_ANY_CONTENT_FIELD_MAPPING
,
298 WS_ANY_ATTRIBUTES_FIELD_MAPPING
301 typedef struct _WS_DEFAULT_VALUE
{
306 typedef struct _WS_ITEM_RANGE
{
313 WS_FIELD_POINTER
= 0x1,
314 WS_FIELD_OPTIONAL
= 0x2,
315 WS_FIELD_NILLABLE
= 0x4,
316 WS_FIELD_NILLABLE_ITEM
= 0x8,
317 WS_FIELD_OTHER_NAMESPACE
= 0x10
320 typedef struct _WS_FIELD_DESCRIPTION
{
321 WS_FIELD_MAPPING mapping
;
322 WS_XML_STRING
*localName
;
325 void *typeDescription
;
328 WS_DEFAULT_VALUE
*defaultValue
;
330 WS_XML_STRING
*itemLocalName
;
331 WS_XML_STRING
*itemNs
;
332 WS_ITEM_RANGE
*itemRange
;
333 } WS_FIELD_DESCRIPTION
;
337 WS_STRUCT_ABSTRACT
= 0x1,
338 WS_STRUCT_IGNORE_TRAILING_ELEMENT_CONTENT
= 0x2,
339 WS_STRUCT_IGNORE_UNHANDLED_ATTRIBUTES
= 0x4
342 typedef struct _WS_STRUCT_DESCRIPTION
{
345 WS_FIELD_DESCRIPTION
**fields
;
347 WS_XML_STRING
*typeLocalName
;
348 WS_XML_STRING
*typeNs
;
349 struct _WS_STRUCT_DESCRIPTION
*parentType
;
350 struct _WS_STRUCT_DESCRIPTION
**subTypes
;
353 } WS_STRUCT_DESCRIPTION
;
355 typedef struct _WS_ATTRIBUTE_DESCRIPTION
{
356 WS_XML_STRING
*attributeLocalName
;
357 WS_XML_STRING
*attributeNs
;
359 void *typeDescription
;
360 } WS_ATTRIBUTE_DESCRIPTION
;
362 typedef struct _WS_STRING
{
368 WS_XML_NODE_TYPE_ELEMENT
= 1,
369 WS_XML_NODE_TYPE_TEXT
= 2,
370 WS_XML_NODE_TYPE_END_ELEMENT
= 3,
371 WS_XML_NODE_TYPE_COMMENT
= 4,
372 WS_XML_NODE_TYPE_CDATA
= 6,
373 WS_XML_NODE_TYPE_END_CDATA
= 7,
374 WS_XML_NODE_TYPE_EOF
= 8,
375 WS_XML_NODE_TYPE_BOF
= 9
378 typedef struct _WS_XML_NODE
{
379 WS_XML_NODE_TYPE nodeType
;
383 WS_XML_TEXT_TYPE_UTF8
= 1,
384 WS_XML_TEXT_TYPE_UTF16
= 2,
385 WS_XML_TEXT_TYPE_BASE64
= 3,
386 WS_XML_TEXT_TYPE_BOOL
= 4,
387 WS_XML_TEXT_TYPE_INT32
= 5,
388 WS_XML_TEXT_TYPE_INT64
= 6,
389 WS_XML_TEXT_TYPE_UINT64
= 7,
390 WS_XML_TEXT_TYPE_FLOAT
= 8,
391 WS_XML_TEXT_TYPE_DOUBLE
= 9,
392 WS_XML_TEXT_TYPE_DECIMAL
= 10,
393 WS_XML_TEXT_TYPE_GUID
= 11,
394 WS_XML_TEXT_TYPE_UNIQUE_ID
= 12,
395 WS_XML_TEXT_TYPE_DATETIME
= 13,
396 WS_XML_TEXT_TYPE_TIMESPAN
= 14,
397 WS_XML_TEXT_TYPE_QNAME
= 15,
398 WS_XML_TEXT_TYPE_LIST
= 16
401 typedef struct _WS_XML_TEXT
{
402 WS_XML_TEXT_TYPE textType
;
405 typedef struct _WS_XML_UTF8_TEXT
{
410 typedef struct _WS_XML_ATTRIBUTE
{
413 WS_XML_STRING
*prefix
;
414 WS_XML_STRING
*localName
;
419 typedef struct _WS_XML_ELEMENT_NODE
{
421 WS_XML_STRING
*prefix
;
422 WS_XML_STRING
*localName
;
424 ULONG attributeCount
;
425 WS_XML_ATTRIBUTE
**attributes
;
427 } WS_XML_ELEMENT_NODE
;
429 typedef struct _WS_XML_TEXT_NODE
{
434 typedef struct _WS_XML_COMMENT_NODE
{
437 } WS_XML_COMMENT_NODE
;
439 typedef struct _WS_XML_NODE_POSITION
{
440 WS_XML_BUFFER
*buffer
;
442 } WS_XML_NODE_POSITION
;
444 HRESULT WINAPI
WsCreateError(const WS_ERROR_PROPERTY
*, ULONG
, WS_ERROR
**);
445 HRESULT WINAPI
WsCreateHeap(SIZE_T
, SIZE_T
, const WS_HEAP_PROPERTY
*, ULONG
, WS_HEAP
**, WS_ERROR
*);
446 HRESULT WINAPI
WsCreateReader(const WS_XML_READER_PROPERTY
*, ULONG
, WS_XML_READER
**, WS_ERROR
*);
447 HRESULT WINAPI
WsCreateWriter(const WS_XML_WRITER_PROPERTY
*, ULONG
, WS_XML_WRITER
**, WS_ERROR
*);
448 HRESULT WINAPI
WsFillReader(WS_XML_READER
*, ULONG
, const WS_ASYNC_CONTEXT
*, WS_ERROR
*);
449 HRESULT WINAPI
WsFindAttribute(WS_XML_READER
*, const WS_XML_STRING
*, const WS_XML_STRING
*, BOOL
,
451 void WINAPI
WsFreeError(WS_ERROR
*);
452 void WINAPI
WsFreeHeap(WS_HEAP
*);
453 void WINAPI
WsFreeReader(WS_XML_READER
*);
454 void WINAPI
WsFreeWriter(WS_XML_WRITER
*);
455 HRESULT WINAPI
WsGetErrorProperty(WS_ERROR
*, WS_ERROR_PROPERTY_ID
, void*, ULONG
);
456 HRESULT WINAPI
WsGetErrorString(WS_ERROR
*, ULONG
, WS_STRING
*);
457 HRESULT WINAPI
WsGetHeapProperty(WS_HEAP
*, WS_HEAP_PROPERTY_ID
, void*, ULONG
, WS_ERROR
*);
458 HRESULT WINAPI
WsGetReaderNode(WS_XML_READER
*, const WS_XML_NODE
**, WS_ERROR
*);
459 HRESULT WINAPI
WsGetReaderPosition(WS_XML_READER
*, WS_XML_NODE_POSITION
*, WS_ERROR
*);
460 HRESULT WINAPI
WsGetReaderProperty(WS_XML_READER
*, WS_XML_READER_PROPERTY_ID
, void*, ULONG
, WS_ERROR
*);
461 HRESULT WINAPI
WsGetWriterProperty(WS_XML_WRITER
*, WS_XML_WRITER_PROPERTY_ID
, void*, ULONG
, WS_ERROR
*);
462 HRESULT WINAPI
WsGetXmlAttribute(WS_XML_READER
*, const WS_XML_STRING
*, WS_HEAP
*, WCHAR
**,
464 HRESULT WINAPI
WsReadAttribute(WS_XML_READER
*, const WS_ATTRIBUTE_DESCRIPTION
*, WS_READ_OPTION
,
465 WS_HEAP
*, void*, ULONG
, WS_ERROR
*);
466 HRESULT WINAPI
WsReadEndElement(WS_XML_READER
*, WS_ERROR
*);
467 HRESULT WINAPI
WsReadNode(WS_XML_READER
*, WS_ERROR
*);
468 HRESULT WINAPI
WsReadStartAttribute(WS_XML_READER
*, ULONG
, WS_ERROR
*);
469 HRESULT WINAPI
WsReadStartElement(WS_XML_READER
*, WS_ERROR
*);
470 HRESULT WINAPI
WsReadToStartElement(WS_XML_READER
*, const WS_XML_STRING
*, const WS_XML_STRING
*,
472 HRESULT WINAPI
WsReadType(WS_XML_READER
*, WS_TYPE_MAPPING
, WS_TYPE
, const void*, WS_READ_OPTION
,
473 WS_HEAP
*, void*, ULONG
, WS_ERROR
*);
474 HRESULT WINAPI
WsSetErrorProperty(WS_ERROR
*, WS_ERROR_PROPERTY_ID
, const void*, ULONG
);
475 HRESULT WINAPI
WsSetInput(WS_XML_READER
*, const WS_XML_READER_ENCODING
*, const WS_XML_READER_INPUT
*,
476 const WS_XML_READER_PROPERTY
*, ULONG
, WS_ERROR
*);
477 HRESULT WINAPI
WsSetOutput(WS_XML_WRITER
*, const WS_XML_WRITER_ENCODING
*, const WS_XML_WRITER_OUTPUT
*,
478 const WS_XML_WRITER_PROPERTY
*, ULONG
, WS_ERROR
*);
479 HRESULT WINAPI
WsWriteType(WS_XML_WRITER
*, WS_TYPE_MAPPING
, WS_TYPE
, const void*, WS_WRITE_OPTION
,
480 const void*, ULONG
, WS_ERROR
*);
482 #define WS_S_ASYNC 0x003d0000
483 #define WS_S_END 0x003d0001
484 #define WS_E_INVALID_FORMAT 0x803d0000
485 #define WS_E_OBJECT_FAULTED 0x803d0001
486 #define WS_E_NUMERIC_OVERFLOW 0x803d0002
487 #define WS_E_INVALID_OPERATION 0x803d0003
488 #define WS_E_OPERATION_ABORTED 0x803d0004
489 #define WS_E_ENDPOINT_ACCESS_DENIED 0x803d0005
490 #define WS_E_OPERATION_TIMED_OUT 0x803d0006
491 #define WS_E_OPERATION_ABANDONED 0x803d0007
492 #define WS_E_QUOTA_EXCEEDED 0x803d0008
493 #define WS_E_NO_TRANSLATION_AVAILABLE 0x803d0009
494 #define WS_E_SECURITY_VERIFICATION_FAILURE 0x803d000a
495 #define WS_E_ADDRESS_IN_USE 0x803d000b
496 #define WS_E_ADDRESS_NOT_AVAILABLE 0x803d000c
497 #define WS_E_ENDPOINT_NOT_FOUND 0x803d000d
498 #define WS_E_ENDPOINT_NOT_AVAILABLE 0x803d000e
499 #define WS_E_ENDPOINT_FAILURE 0x803d000f
500 #define WS_E_ENDPOINT_UNREACHABLE 0x803d0010
501 #define WS_E_ENDPOINT_ACTION_NOT_SUPPORTED 0x803d0011
502 #define WS_E_ENDPOINT_TOO_BUSY 0x803d0012
503 #define WS_E_ENDPOINT_FAULT_RECEIVED 0x803d0013
504 #define WS_E_ENDPOINT_DISCONNECTED 0x803d0014
505 #define WS_E_PROXY_FAILURE 0x803d0015
506 #define WS_E_PROXY_ACCESS_DENIED 0x803d0016
507 #define WS_E_NOT_SUPPORTED 0x803d0017
508 #define WS_E_PROXY_REQUIRES_BASIC_AUTH 0x803d0018
509 #define WS_E_PROXY_REQUIRES_DIGEST_AUTH 0x803d0019
510 #define WS_E_PROXY_REQUIRES_NTLM_AUTH 0x803d001a
511 #define WS_E_PROXY_REQUIRES_NEGOTIATE_AUTH 0x803d001b
512 #define WS_E_SERVER_REQUIRES_BASIC_AUTH 0x803d001c
513 #define WS_E_SERVER_REQUIRES_DIGEST_AUTH 0x803d001d
514 #define WS_E_SERVER_REQUIRES_NTLM_AUTH 0x803d001e
515 #define WS_E_SERVER_REQUIRES_NEGOTIATE_AUTH 0x803d001f
516 #define WS_E_INVALID_ENDPOINT_URL 0x803d0020
517 #define WS_E_OTHER 0x803d0021
518 #define WS_E_SECURITY_TOKEN_EXPIRED 0x803d0022
519 #define WS_E_SECURITY_SYSTEM_FAILURE 0x803d0023
523 #endif /* __cplusplus */
525 #endif /* __WINE_WEBSERVICES_H */