File: soap.h

package info (click to toggle)
virtuoso-opensource 6.1.6+dfsg2-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 260,992 kB
  • ctags: 125,220
  • sloc: ansic: 652,748; sql: 458,419; xml: 282,834; java: 61,031; sh: 40,031; cpp: 36,890; cs: 25,240; php: 12,692; yacc: 9,523; lex: 7,018; makefile: 6,157; jsp: 4,484; awk: 1,643; perl: 1,013; ruby: 1,003; python: 326
file content (140 lines) | stat: -rw-r--r-- 5,940 bytes parent folder | download | duplicates (2)
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
/*
 *  $Id$
 *
 *  This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
 *  project.
 *
 *  Copyright (C) 1998-2012 OpenLink Software
 *
 *  This project is free software; you can redistribute it and/or modify it
 *  under the terms of the GNU General Public License as published by the
 *  Free Software Foundation; only version 2 of the License, dated June 1991.
 *
 *  This program 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
 *  General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License along
 *  with this program; if not, write to the Free Software Foundation, Inc.,
 *  51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 *
 */

#ifndef SOAP_H
#define SOAP_H


#define SOAP_TYPE_SCHEMA10 "urn:schemas-xmlsoap-org:soap.v1"
#define SOAP_TYPE_SCHEMA11 "http://schemas.xmlsoap.org/soap/envelope/"
#define SOAP_ENC_SCHEMA11 "http://schemas.xmlsoap.org/soap/encoding/"
#define SOAP_WSDL_SCHEMA11 "http://schemas.xmlsoap.org/wsdl/"
#define SOAP_DIME_SCHEMA "http://schemas.xmlsoap.org/ws/2002/04/dime/"
#define W3C_TYPE_SCHEMA_XSI "http://www.w3.org/1999/XMLSchema-instance"
#define W3C_TYPE_SCHEMA_XSD "http://www.w3.org/1999/XMLSchema"
#define W3C_2001_TYPE_SCHEMA_XSI "http://www.w3.org/2001/XMLSchema-instance"
#define W3C_2001_TYPE_SCHEMA_XSD "http://www.w3.org/2001/XMLSchema"
#define SOAP_ACTOR_FIRST "http://schemas.xmlsoap.org/soap/actor/next"
#define SOAP_CONTENT_TYPE_200204 "http://schemas.xmlsoap.org/ws/2002/04/content-type/"
#define SOAP_REF_SCH_200204	 "http://schemas.xmlsoap.org/ws/2002/04/reference/"

/* WSDL 2.0 NS */

#define SOAP_WSDL_SCHEMA20_NS 		"http://www.w3.org/ns/wsdl"

#define SOAP_WSDL_SCHEMA20 		"http://www.w3.org/2006/01/wsdl" /* must be SOAP_WSDL_SCHEMA20_NS */
#define SOAP_BINDING_TYPE_SOAP 		SOAP_WSDL_SCHEMA20_NS "/soap"
#define SOAP_BINDING_TYPE_HTTP 		SOAP_WSDL_SCHEMA20_NS "/http"
#define SOAP_11_VERSION 		"1.1"
#define SOAP_BINDING_PROTOCOL_HTTP 	"http://www.w3.org/2006/01/soap%d/bindings/HTTP/"
#define SOAP_WSDL20_PATTERN_INOUT  	SOAP_WSDL_SCHEMA20_NS "/in-out"
#define SOAP_WSDL20_PATTERN_IN  	SOAP_WSDL_SCHEMA20_NS "/in"
#define SOAP_WSDL20_RPC		  	SOAP_WSDL_SCHEMA20_NS "/rpc"

/* SOAP 1.2 NS */
#define SOAP_TYPE_SCHEMA12 	"http://www.w3.org/2003/05/soap-envelope"
#define SOAP_ENC_SCHEMA12	"http://www.w3.org/2003/05/soap-encoding"
#define SOAP_RPC_SCHEMA12	"http://www.w3.org/2003/05/soap-rpc"
#define SOAP_ROLE_NEXT		SOAP_TYPE_SCHEMA12"/role/next"
#define SOAP_ROLE_NONE		SOAP_TYPE_SCHEMA12"/role/none"
#define SOAP_ROLE_ULTIMATE	SOAP_TYPE_SCHEMA12"/role/ultimateReceiver"

#define MS_TYPE_SCHEMA "urn:schemas-microsoft-com:datatypes"
/*#define VIRTUOSO_TYPE_SCHEMA "urn:openlinksw-com:virtuoso"*/
#define BPEL4WS_PL_URI	"http://schemas.xmlsoap.org/ws/2003/05/partner-link/"

#define SOAP_URI(x) ((x) == 1  ? SOAP_TYPE_SCHEMA10 : \
    		     (x) == 11 ? SOAP_TYPE_SCHEMA11 : \
		     (x) == 12 ? SOAP_TYPE_SCHEMA12 : NULL)

#define SOAP_ENC(x) ((x) == 1  ? SOAP_TYPE_SCHEMA10 : \
    		     (x) == 11 ? SOAP_ENC_SCHEMA11 : \
		     (x) == 12 ? SOAP_ENC_SCHEMA12 : NULL)

caddr_t * xml_find_child (caddr_t *entity, const char *szSearchName, const char *szURI, int nth, int *start_inx);
caddr_t * xml_find_one_child (caddr_t *entity, char *szSearchName, char **szURIs, int nth, int *start_inx);
int is_in_urls (char **szURIs, const char *uri, int *idx);

#define WS_ENC_NONE 0
#define WS_ENC_DIME 1
#define WS_ENC_MIME 2

#define ARRAY_MAX 0x7fffffff

/* DIME encapsulation */
#define SOAP_MSG_IN	(long)0x400
#define SOAP_MSG_OUT	(long)0x800
#define SOAP_MSG_INOUT	(long)0xC00

/* MIME encapsulation */
#define SOAP_MMSG_IN	(long)0x100
#define SOAP_MMSG_OUT	(long)0x200
#define SOAP_MMSG_INOUT	(long)0x300

#define SOAP_MSG_HEADER  	0x01   /* an parameter is in a SOAP:Header  */
#define SOAP_MSG_LITERAL 	0x02   /* the method is document/literal encoded */
#define SOAP_MSG_XML     	0x04   /* the parameter is RAW XML passed to the procedure */
#define SOAP_MSG_LITERALW 	0x08   /* the method is document/literal encoded, like RPC one */
#define SOAP_MSG_HTTP		0x10   /* the method have HTTP/GET/POST disposition */
#define SOAP_MSG_FAULT		0x20   /* an parameter is exposed to soap:fault */
#define SOAP_MSG_DOC		(SOAP_MSG_LITERAL|SOAP_MSG_LITERALW) /* document */

#define IS_SOAP_RPCLIT(f)	((f)&SOAP_MSG_LITERALW)
#define IS_SOAP_LIT(f)		((f)&SOAP_MSG_LITERAL && !((f)&SOAP_MSG_LITERALW))

#define IS_SOAP_MSG_HEADER(x) ((unbox(x) & 0xFF) & SOAP_MSG_HEADER)
#define IS_SOAP_MSG_FAULT(x) ((unbox(x) & 0xFF) & SOAP_MSG_FAULT)
#define IS_SOAP_MSG_SPECIAL(x) (SOAP_MSG_HEADER == (unbox(x) & SOAP_MSG_HEADER) \
    || SOAP_MSG_FAULT == (unbox(x) & SOAP_MSG_FAULT))
#define IS_SOAP_MSG_SET(x,m) ((m) == (unbox(x) & 0xFF))

/* supported SOAP options to the procedure */
#define SOAP_OPT_MSG_NAME 	"MessageName"
#define SOAP_OPT_PART_NAME 	"PartName"
#define SOAP_OPT_REQ_NS   	"RequestNamespace"
#define SOAP_OPT_RESP_NS  	"ResponseNamespace"
#define SOAP_OPT_ACTION		"soapAction"
#define SOAP_OPT_PARAM_STYLE	"ParameterStyle"
#define SOAP_OPT_REQ_ELEM_NAME	"RequestElementName"
#define SOAP_OPT_RESP_ELEM_NAME	"ResponseElementName"
#define SOAP_OPT_USE		"Use"
#define SOAP_OPT_BINDING    	"Binding"
#define SOAP_OPT_ONEWAY		"OneWay"
#define SOAP_OPT_OPERATION	"Operation"
#define SOAP_OPT_DEFAULT_OPER	"DefaultOperation"
/* to be extended */

#define SOAP_USE(enc, flag, deflt) flag = deflt; \
    				   if (enc) { \
                                     if (!strcmp (enc, "literal")) \
				       flag = 1; \
				     else if (!strcmp (enc, "encoded")) \
				       flag = 0; \
				   }

#define SOAP_CTYPE_12 "application/soap+xml"
#define SOAP_CTYPE_11 "text/xml"

#define IS_QNAME(tp) (NULL != (tp) && 0 == strcmp ((tp), W3C_2001_TYPE_SCHEMA_XSD":QName"))

#endif