php-src/ext/soap/php_sdl.h

270 lines
7.8 KiB
C
Raw Normal View History

2004-01-29 09:27:06 +00:00
/*
+----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
2004-01-29 09:27:06 +00:00
+----------------------------------------------------------------------+
2006-01-01 12:51:34 +00:00
| This source file is subject to version 3.01 of the PHP license, |
2004-01-29 09:27:06 +00:00
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| https://www.php.net/license/3_01.txt |
2004-01-29 09:27:06 +00:00
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
2004-01-29 11:51:11 +00:00
| Authors: Brad Lafountain <rodif_bl@yahoo.com> |
| Shane Caraveo <shane@caraveo.com> |
2018-11-01 16:30:28 +00:00
| Dmitry Stogov <dmitry@php.net> |
2004-01-29 09:27:06 +00:00
+----------------------------------------------------------------------+
*/
#ifndef PHP_SDL_H
#define PHP_SDL_H
#define XSD_WHITESPACE_COLLAPSE 1
#define XSD_WHITESPACE_PRESERVE 1
#define XSD_WHITESPACE_REPLACE 1
2004-02-10 13:41:21 +00:00
typedef enum _sdlBindingType {
BINDING_SOAP = 1,
BINDING_HTTP = 2
} sdlBindingType;
2002-08-07 03:03:09 +00:00
2004-02-10 13:41:21 +00:00
typedef enum _sdlEncodingStyle {
SOAP_RPC = 1,
2004-02-10 13:41:21 +00:00
SOAP_DOCUMENT = 2
} sdlEncodingStyle;
2002-08-07 03:03:09 +00:00
typedef enum _sdlRpcEncodingStyle {
SOAP_ENCODING_DEFAULT = 0,
SOAP_ENCODING_1_1 = 1,
SOAP_ENCODING_1_2 = 2
} sdlRpcEncodingStyle;
2004-02-10 13:41:21 +00:00
typedef enum _sdlEncodingUse {
SOAP_ENCODED = 1,
SOAP_LITERAL = 2
} sdlEncodingUse;
2002-08-07 03:03:09 +00:00
typedef enum _sdlTransport {
SOAP_TRANSPORT_HTTP = 1
} sdlTransport;
2004-01-09 18:22:03 +00:00
struct _sdl {
HashTable functions; /* array of sdlFunction */
HashTable *types; /* array of sdlTypesPtr */
HashTable *elements; /* array of sdlTypesPtr */
HashTable *encoders; /* array of encodePtr */
HashTable *bindings; /* array of sdlBindings (key'd by name) */
HashTable *requests; /* array of sdlFunction (references) */
HashTable *groups; /* array of sdlTypesPtr */
char *target_ns;
char *source;
bool is_persistent;
};
typedef struct sdlCtx {
sdlPtr sdl;
HashTable docs; /* array of xmlDocPtr */
HashTable messages; /* array of xmlNodePtr */
HashTable bindings; /* array of xmlNodePtr */
HashTable portTypes; /* array of xmlNodePtr */
HashTable services; /* array of xmlNodePtr */
HashTable *attributes; /* array of sdlAttributePtr */
HashTable *attributeGroups; /* array of sdlTypesPtr */
php_stream_context *context;
zval old_header;
} sdlCtx;
2004-01-09 18:22:03 +00:00
struct _sdlBinding {
2004-02-10 13:41:21 +00:00
char *name;
char *location;
sdlBindingType bindingType;
void *bindingAttributes; /* sdlSoapBindingPtr */
2002-08-07 03:03:09 +00:00
};
/* Soap Binding Specific stuff */
2004-01-09 18:22:03 +00:00
struct _sdlSoapBinding {
2004-02-10 13:41:21 +00:00
sdlEncodingStyle style;
sdlTransport transport; /* not implemented yet */
2002-08-07 03:03:09 +00:00
};
typedef struct _sdlSoapBindingFunctionHeader {
char *name;
char *ns;
sdlEncodingUse use;
sdlTypePtr element;
encodePtr encode;
sdlRpcEncodingStyle encodingStyle; /* not implemented yet */
HashTable *headerfaults; /* array of sdlSoapBindingFunctionHeaderPtr */
} sdlSoapBindingFunctionHeader, *sdlSoapBindingFunctionHeaderPtr;
typedef struct _sdlSoapBindingFunctionFault {
char *ns;
sdlEncodingUse use;
sdlRpcEncodingStyle encodingStyle; /* not implemented yet */
} sdlSoapBindingFunctionFault, *sdlSoapBindingFunctionFaultPtr;
2004-01-09 18:22:03 +00:00
struct _sdlSoapBindingFunctionBody {
char *ns;
sdlEncodingUse use;
sdlRpcEncodingStyle encodingStyle; /* not implemented yet */
HashTable *headers; /* array of sdlSoapBindingFunctionHeaderPtr */
2002-08-07 03:03:09 +00:00
};
2004-01-09 18:22:03 +00:00
struct _sdlSoapBindingFunction {
2004-02-10 13:41:21 +00:00
char *soapAction;
sdlEncodingStyle style;
2002-08-07 03:03:09 +00:00
2004-02-10 13:41:21 +00:00
sdlSoapBindingFunctionBody input;
sdlSoapBindingFunctionBody output;
2002-08-07 03:03:09 +00:00
};
2004-01-09 18:22:03 +00:00
struct _sdlRestrictionInt {
int value;
char fixed;
};
2004-01-09 18:22:03 +00:00
struct _sdlRestrictionChar {
char *value;
char fixed;
};
2004-01-09 18:22:03 +00:00
struct _sdlRestrictions {
HashTable *enumeration; /* array of sdlRestrictionCharPtr */
sdlRestrictionIntPtr minExclusive;
sdlRestrictionIntPtr minInclusive;
sdlRestrictionIntPtr maxExclusive;
sdlRestrictionIntPtr maxInclusive;
sdlRestrictionIntPtr totalDigits;
sdlRestrictionIntPtr fractionDigits;
sdlRestrictionIntPtr length;
sdlRestrictionIntPtr minLength;
sdlRestrictionIntPtr maxLength;
sdlRestrictionCharPtr whiteSpace;
sdlRestrictionCharPtr pattern;
};
typedef enum _sdlContentKind {
XSD_CONTENT_ELEMENT,
XSD_CONTENT_SEQUENCE,
XSD_CONTENT_ALL,
XSD_CONTENT_CHOICE,
XSD_CONTENT_GROUP_REF,
XSD_CONTENT_GROUP,
XSD_CONTENT_ANY
} sdlContentKind;
typedef struct _sdlContentModel sdlContentModel, *sdlContentModelPtr;
struct _sdlContentModel {
sdlContentKind kind;
int min_occurs;
int max_occurs;
union {
sdlTypePtr element; /* pointer to element */
2004-02-10 13:41:21 +00:00
sdlTypePtr group; /* pointer to group */
HashTable *content; /* array of sdlContentModel for sequnce,all,choice*/
char *group_ref; /* reference to group */
} u;
};
typedef enum _sdlTypeKind {
XSD_TYPEKIND_SIMPLE,
XSD_TYPEKIND_LIST,
XSD_TYPEKIND_UNION,
XSD_TYPEKIND_COMPLEX,
XSD_TYPEKIND_RESTRICTION,
XSD_TYPEKIND_EXTENSION
} sdlTypeKind;
typedef enum _sdlUse {
XSD_USE_DEFAULT,
XSD_USE_OPTIONAL,
XSD_USE_PROHIBITED,
XSD_USE_REQUIRED
} sdlUse;
typedef enum _sdlForm {
XSD_FORM_DEFAULT,
XSD_FORM_QUALIFIED,
XSD_FORM_UNQUALIFIED
} sdlForm;
2004-01-09 18:22:03 +00:00
struct _sdlType {
sdlTypeKind kind;
char *name;
char *namens;
2004-02-10 13:41:21 +00:00
char nillable;
HashTable *elements; /* array of sdlTypePtr */
HashTable *attributes; /* array of sdlAttributePtr */
sdlRestrictionsPtr restrictions;
encodePtr encode;
sdlContentModelPtr model;
char *def;
char *fixed;
char *ref;
sdlForm form;
};
2004-01-09 18:22:03 +00:00
struct _sdlParam {
int order;
sdlTypePtr element;
encodePtr encode;
char *paramName;
};
typedef struct _sdlFault {
char *name;
HashTable *details; /* array of sdlParamPtr */
void *bindingAttributes; /* sdlSoapBindingFunctionFaultPtr */
} sdlFault, *sdlFaultPtr;
2004-01-09 18:22:03 +00:00
struct _sdlFunction {
char *functionName;
char *requestName;
char *responseName;
HashTable *requestParameters; /* array of sdlParamPtr */
HashTable *responseParameters; /* array of sdlParamPtr (this should only be one) */
struct _sdlBinding *binding;
void *bindingAttributes; /* sdlSoapBindingFunctionPtr */
HashTable *faults; /* array of sdlFaultPtr */
};
typedef struct _sdlExtraAttribute {
char *ns;
char *val;
} sdlExtraAttribute, *sdlExtraAttributePtr;
2004-01-09 18:22:03 +00:00
struct _sdlAttribute {
char *name;
char *namens;
char *ref;
char *def;
char *fixed;
sdlForm form;
sdlUse use;
HashTable *extraAttributes; /* array of sdlExtraAttribute */
encodePtr encode;
};
2014-12-13 22:06:14 +00:00
sdlPtr get_sdl(zval *this_ptr, char *uri, zend_long cache_wsdl);
2006-07-11 14:24:18 +00:00
encodePtr get_encoder_from_prefix(sdlPtr sdl, xmlNodePtr data, const xmlChar *type);
encodePtr get_encoder(sdlPtr sdl, const char *ns, const char *type);
2004-02-13 15:19:09 +00:00
encodePtr get_encoder_ex(sdlPtr sdl, const char *nscat, int len);
2016-06-23 09:47:06 +00:00
sdlBindingPtr get_binding_from_type(sdlPtr sdl, sdlBindingType type);
2002-08-07 03:03:09 +00:00
sdlBindingPtr get_binding_from_name(sdlPtr sdl, char *name, char *ns);
void delete_sdl(void *handle);
void delete_sdl_impl(void *handle);
2004-01-13 15:58:01 +00:00
2014-12-13 22:06:14 +00:00
void sdl_set_uri_credentials(sdlCtx *ctx, char *uri);
void sdl_restore_uri_credentials(sdlCtx *ctx);
#endif