2004-01-29 17:27:06 +08:00
|
|
|
/*
|
|
|
|
+----------------------------------------------------------------------+
|
2014-09-20 00:33:14 +08:00
|
|
|
| PHP Version 7 |
|
2004-01-29 17:27:06 +08:00
|
|
|
+----------------------------------------------------------------------+
|
2018-01-02 12:53:31 +08:00
|
|
|
| Copyright (c) 1997-2018 The PHP Group |
|
2004-01-29 17:27:06 +08:00
|
|
|
+----------------------------------------------------------------------+
|
2006-01-01 20:51:34 +08:00
|
|
|
| This source file is subject to version 3.01 of the PHP license, |
|
2004-01-29 17:27:06 +08:00
|
|
|
| that is bundled with this package in the file LICENSE, and is |
|
|
|
|
| available through the world-wide-web at the following url: |
|
2006-01-01 20:51:34 +08:00
|
|
|
| http://www.php.net/license/3_01.txt |
|
2004-01-29 17:27:06 +08: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 19:51:11 +08:00
|
|
|
| Authors: Brad Lafountain <rodif_bl@yahoo.com> |
|
|
|
|
| Shane Caraveo <shane@caraveo.com> |
|
|
|
|
| Dmitry Stogov <dmitry@zend.com> |
|
2004-01-29 17:27:06 +08:00
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
*/
|
|
|
|
/* $Id$ */
|
|
|
|
|
2002-07-08 07:03:43 +08:00
|
|
|
#ifndef PHP_SDL_H
|
|
|
|
#define PHP_SDL_H
|
|
|
|
|
|
|
|
#define XSD_WHITESPACE_COLLAPSE 1
|
|
|
|
#define XSD_WHITESPACE_PRESERVE 1
|
2004-02-06 22:22:33 +08:00
|
|
|
#define XSD_WHITESPACE_REPLACE 1
|
2002-07-08 07:03:43 +08:00
|
|
|
|
2004-02-10 21:41:21 +08:00
|
|
|
typedef enum _sdlBindingType {
|
|
|
|
BINDING_SOAP = 1,
|
|
|
|
BINDING_HTTP = 2
|
|
|
|
} sdlBindingType;
|
2002-08-07 11:03:09 +08:00
|
|
|
|
2004-02-10 21:41:21 +08:00
|
|
|
typedef enum _sdlEncodingStyle {
|
2004-02-19 16:21:13 +08:00
|
|
|
SOAP_RPC = 1,
|
2004-02-10 21:41:21 +08:00
|
|
|
SOAP_DOCUMENT = 2
|
|
|
|
} sdlEncodingStyle;
|
2002-08-07 11:03:09 +08:00
|
|
|
|
2004-02-19 16:21:13 +08:00
|
|
|
typedef enum _sdlRpcEncodingStyle {
|
|
|
|
SOAP_ENCODING_DEFAULT = 0,
|
|
|
|
SOAP_ENCODING_1_1 = 1,
|
|
|
|
SOAP_ENCODING_1_2 = 2
|
|
|
|
} sdlRpcEncodingStyle;
|
|
|
|
|
2004-02-10 21:41:21 +08:00
|
|
|
typedef enum _sdlEncodingUse {
|
|
|
|
SOAP_ENCODED = 1,
|
|
|
|
SOAP_LITERAL = 2
|
|
|
|
} sdlEncodingUse;
|
2002-08-07 11:03:09 +08:00
|
|
|
|
2004-02-19 16:21:13 +08:00
|
|
|
typedef enum _sdlTransport {
|
|
|
|
SOAP_TRANSPORT_HTTP = 1
|
|
|
|
} sdlTransport;
|
|
|
|
|
2004-01-10 02:22:03 +08:00
|
|
|
struct _sdl {
|
2004-01-26 17:51:07 +08:00
|
|
|
HashTable functions; /* array of sdlFunction */
|
2004-01-21 22:00:55 +08:00
|
|
|
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) */
|
2004-01-22 23:58:03 +08:00
|
|
|
HashTable *groups; /* array of sdlTypesPtr */
|
2004-01-26 17:51:07 +08:00
|
|
|
char *target_ns;
|
|
|
|
char *source;
|
2006-04-10 07:35:51 +08:00
|
|
|
zend_bool is_persistent;
|
2002-07-08 07:03:43 +08:00
|
|
|
};
|
|
|
|
|
2004-02-06 19:56:03 +08:00
|
|
|
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 */
|
2009-08-18 02:23:48 +08:00
|
|
|
php_stream_context *context;
|
2014-05-15 06:44:47 +08:00
|
|
|
zval old_header;
|
2004-02-06 19:56:03 +08:00
|
|
|
} sdlCtx;
|
|
|
|
|
2004-01-10 02:22:03 +08:00
|
|
|
struct _sdlBinding {
|
2004-02-10 21:41:21 +08:00
|
|
|
char *name;
|
|
|
|
char *location;
|
|
|
|
sdlBindingType bindingType;
|
|
|
|
void *bindingAttributes; /* sdlSoapBindingPtr */
|
2002-08-07 11:03:09 +08:00
|
|
|
};
|
|
|
|
|
2014-11-21 04:00:07 +08:00
|
|
|
/* Soap Binding Specific stuff */
|
2004-01-10 02:22:03 +08:00
|
|
|
struct _sdlSoapBinding {
|
2004-02-10 21:41:21 +08:00
|
|
|
sdlEncodingStyle style;
|
2004-02-19 16:21:13 +08:00
|
|
|
sdlTransport transport; /* not implemented yet */
|
2002-08-07 11:03:09 +08:00
|
|
|
};
|
|
|
|
|
2004-02-04 22:46:12 +08:00
|
|
|
typedef struct _sdlSoapBindingFunctionHeader {
|
2004-02-19 16:21:13 +08:00
|
|
|
char *name;
|
|
|
|
char *ns;
|
|
|
|
sdlEncodingUse use;
|
|
|
|
sdlTypePtr element;
|
|
|
|
encodePtr encode;
|
|
|
|
sdlRpcEncodingStyle encodingStyle; /* not implemented yet */
|
2004-02-24 23:06:42 +08:00
|
|
|
HashTable *headerfaults; /* array of sdlSoapBindingFunctionHeaderPtr */
|
2004-02-04 22:46:12 +08:00
|
|
|
} sdlSoapBindingFunctionHeader, *sdlSoapBindingFunctionHeaderPtr;
|
|
|
|
|
2004-02-19 16:21:13 +08:00
|
|
|
typedef struct _sdlSoapBindingFunctionFault {
|
|
|
|
char *ns;
|
|
|
|
sdlEncodingUse use;
|
|
|
|
sdlRpcEncodingStyle encodingStyle; /* not implemented yet */
|
|
|
|
} sdlSoapBindingFunctionFault, *sdlSoapBindingFunctionFaultPtr;
|
|
|
|
|
2004-01-10 02:22:03 +08:00
|
|
|
struct _sdlSoapBindingFunctionBody {
|
2004-02-19 16:21:13 +08:00
|
|
|
char *ns;
|
|
|
|
sdlEncodingUse use;
|
|
|
|
sdlRpcEncodingStyle encodingStyle; /* not implemented yet */
|
|
|
|
HashTable *headers; /* array of sdlSoapBindingFunctionHeaderPtr */
|
2002-08-07 11:03:09 +08:00
|
|
|
};
|
|
|
|
|
2004-01-10 02:22:03 +08:00
|
|
|
struct _sdlSoapBindingFunction {
|
2004-02-10 21:41:21 +08:00
|
|
|
char *soapAction;
|
|
|
|
sdlEncodingStyle style;
|
2002-08-07 11:03:09 +08:00
|
|
|
|
2004-02-10 21:41:21 +08:00
|
|
|
sdlSoapBindingFunctionBody input;
|
|
|
|
sdlSoapBindingFunctionBody output;
|
2002-08-07 11:03:09 +08:00
|
|
|
};
|
|
|
|
|
2004-01-10 02:22:03 +08:00
|
|
|
struct _sdlRestrictionInt {
|
2004-01-26 17:51:07 +08:00
|
|
|
int value;
|
|
|
|
char fixed;
|
2002-07-08 07:03:43 +08:00
|
|
|
};
|
|
|
|
|
2004-01-10 02:22:03 +08:00
|
|
|
struct _sdlRestrictionChar {
|
2002-07-08 07:03:43 +08:00
|
|
|
char *value;
|
2004-01-26 17:51:07 +08:00
|
|
|
char fixed;
|
2002-07-08 07:03:43 +08:00
|
|
|
};
|
|
|
|
|
2004-01-10 02:22:03 +08:00
|
|
|
struct _sdlRestrictions {
|
2004-01-22 23:58:03 +08:00
|
|
|
HashTable *enumeration; /* array of sdlRestrictionCharPtr */
|
2002-07-08 07:03:43 +08:00
|
|
|
sdlRestrictionIntPtr minExclusive;
|
|
|
|
sdlRestrictionIntPtr minInclusive;
|
|
|
|
sdlRestrictionIntPtr maxExclusive;
|
|
|
|
sdlRestrictionIntPtr maxInclusive;
|
|
|
|
sdlRestrictionIntPtr totalDigits;
|
|
|
|
sdlRestrictionIntPtr fractionDigits;
|
|
|
|
sdlRestrictionIntPtr length;
|
|
|
|
sdlRestrictionIntPtr minLength;
|
|
|
|
sdlRestrictionIntPtr maxLength;
|
|
|
|
sdlRestrictionCharPtr whiteSpace;
|
|
|
|
sdlRestrictionCharPtr pattern;
|
|
|
|
};
|
|
|
|
|
2004-01-22 23:58:03 +08:00
|
|
|
typedef enum _sdlContentKind {
|
|
|
|
XSD_CONTENT_ELEMENT,
|
|
|
|
XSD_CONTENT_SEQUENCE,
|
|
|
|
XSD_CONTENT_ALL,
|
|
|
|
XSD_CONTENT_CHOICE,
|
|
|
|
XSD_CONTENT_GROUP_REF,
|
2005-03-22 18:19:08 +08:00
|
|
|
XSD_CONTENT_GROUP,
|
|
|
|
XSD_CONTENT_ANY
|
2004-01-22 23:58:03 +08:00
|
|
|
} 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 21:41:21 +08:00
|
|
|
sdlTypePtr group; /* pointer to group */
|
2004-01-22 23:58:03 +08:00
|
|
|
HashTable *content; /* array of sdlContentModel for sequnce,all,choice*/
|
|
|
|
char *group_ref; /* reference to group */
|
|
|
|
} u;
|
|
|
|
};
|
|
|
|
|
2004-01-21 00:30:38 +08:00
|
|
|
typedef enum _sdlTypeKind {
|
|
|
|
XSD_TYPEKIND_SIMPLE,
|
|
|
|
XSD_TYPEKIND_LIST,
|
|
|
|
XSD_TYPEKIND_UNION,
|
2004-01-23 17:15:58 +08:00
|
|
|
XSD_TYPEKIND_COMPLEX,
|
2004-01-23 22:43:15 +08:00
|
|
|
XSD_TYPEKIND_RESTRICTION,
|
|
|
|
XSD_TYPEKIND_EXTENSION
|
2004-01-21 00:30:38 +08:00
|
|
|
} sdlTypeKind;
|
|
|
|
|
2005-04-20 16:30:43 +08:00
|
|
|
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-10 02:22:03 +08:00
|
|
|
struct _sdlType {
|
2004-01-26 17:51:07 +08:00
|
|
|
sdlTypeKind kind;
|
|
|
|
char *name;
|
|
|
|
char *namens;
|
2004-02-10 21:41:21 +08:00
|
|
|
char nillable;
|
2004-01-26 17:51:07 +08:00
|
|
|
HashTable *elements; /* array of sdlTypePtr */
|
|
|
|
HashTable *attributes; /* array of sdlAttributePtr */
|
|
|
|
sdlRestrictionsPtr restrictions;
|
|
|
|
encodePtr encode;
|
|
|
|
sdlContentModelPtr model;
|
|
|
|
char *def;
|
|
|
|
char *fixed;
|
|
|
|
char *ref;
|
2005-04-20 16:30:43 +08:00
|
|
|
sdlForm form;
|
2002-07-08 07:03:43 +08:00
|
|
|
};
|
|
|
|
|
2004-01-10 02:22:03 +08:00
|
|
|
struct _sdlParam {
|
2004-01-26 17:51:07 +08:00
|
|
|
int order;
|
2004-01-28 21:30:21 +08:00
|
|
|
sdlTypePtr element;
|
2004-01-26 17:51:07 +08:00
|
|
|
encodePtr encode;
|
|
|
|
char *paramName;
|
2002-07-08 07:03:43 +08:00
|
|
|
};
|
|
|
|
|
2004-02-19 16:21:13 +08:00
|
|
|
typedef struct _sdlFault {
|
|
|
|
char *name;
|
|
|
|
HashTable *details; /* array of sdlParamPtr */
|
|
|
|
void *bindingAttributes; /* sdlSoapBindingFunctionFaultPtr */
|
|
|
|
} sdlFault, *sdlFaultPtr;
|
|
|
|
|
2004-01-10 02:22:03 +08:00
|
|
|
struct _sdlFunction {
|
2004-01-26 17:51:07 +08:00
|
|
|
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 */
|
2004-02-19 16:21:13 +08:00
|
|
|
HashTable *faults; /* array of sdlFaultPtr */
|
2002-07-08 07:03:43 +08:00
|
|
|
};
|
|
|
|
|
2004-02-06 19:56:03 +08:00
|
|
|
typedef struct _sdlExtraAttribute {
|
|
|
|
char *ns;
|
|
|
|
char *val;
|
|
|
|
} sdlExtraAttribute, *sdlExtraAttributePtr;
|
2004-01-26 17:51:07 +08:00
|
|
|
|
2004-01-10 02:22:03 +08:00
|
|
|
struct _sdlAttribute {
|
2004-01-26 17:51:07 +08:00
|
|
|
char *name;
|
2004-08-27 02:43:06 +08:00
|
|
|
char *namens;
|
2004-01-26 17:51:07 +08:00
|
|
|
char *ref;
|
|
|
|
char *def;
|
|
|
|
char *fixed;
|
|
|
|
sdlForm form;
|
|
|
|
sdlUse use;
|
2004-02-06 19:56:03 +08:00
|
|
|
HashTable *extraAttributes; /* array of sdlExtraAttribute */
|
2004-01-26 17:51:07 +08:00
|
|
|
encodePtr encode;
|
2002-07-08 07:03:43 +08:00
|
|
|
};
|
|
|
|
|
2006-04-10 07:35:51 +08:00
|
|
|
|
2014-12-14 06:06:14 +08:00
|
|
|
sdlPtr get_sdl(zval *this_ptr, char *uri, zend_long cache_wsdl);
|
2002-07-08 07:03:43 +08:00
|
|
|
|
2006-07-11 22:24:18 +08:00
|
|
|
encodePtr get_encoder_from_prefix(sdlPtr sdl, xmlNodePtr data, const xmlChar *type);
|
2004-01-06 00:44:01 +08:00
|
|
|
encodePtr get_encoder(sdlPtr sdl, const char *ns, const char *type);
|
2004-02-13 23:19:09 +08:00
|
|
|
encodePtr get_encoder_ex(sdlPtr sdl, const char *nscat, int len);
|
2002-07-08 07:03:43 +08:00
|
|
|
|
2016-06-23 17:47:06 +08:00
|
|
|
sdlBindingPtr get_binding_from_type(sdlPtr sdl, sdlBindingType type);
|
2002-08-07 11:03:09 +08:00
|
|
|
sdlBindingPtr get_binding_from_name(sdlPtr sdl, char *name, char *ns);
|
|
|
|
|
2004-01-13 21:50:09 +08:00
|
|
|
void delete_sdl(void *handle);
|
2006-04-10 07:35:51 +08:00
|
|
|
void delete_sdl_impl(void *handle);
|
2004-01-13 23:58:01 +08:00
|
|
|
|
2014-12-14 06:06:14 +08:00
|
|
|
void sdl_set_uri_credentials(sdlCtx *ctx, char *uri);
|
|
|
|
void sdl_restore_uri_credentials(sdlCtx *ctx);
|
2009-08-18 02:23:48 +08:00
|
|
|
|
2002-07-08 07:03:43 +08:00
|
|
|
#endif
|