Back to index

php5  5.3.10
php_sdl.h
Go to the documentation of this file.
00001 /*
00002   +----------------------------------------------------------------------+
00003   | PHP Version 5                                                        |
00004   +----------------------------------------------------------------------+
00005   | Copyright (c) 1997-2012 The PHP Group                                |
00006   +----------------------------------------------------------------------+
00007   | This source file is subject to version 3.01 of the PHP license,      |
00008   | that is bundled with this package in the file LICENSE, and is        |
00009   | available through the world-wide-web at the following url:           |
00010   | http://www.php.net/license/3_01.txt                                  |
00011   | If you did not receive a copy of the PHP license and are unable to   |
00012   | obtain it through the world-wide-web, please send a note to          |
00013   | license@php.net so we can mail you a copy immediately.               |
00014   +----------------------------------------------------------------------+
00015   | Authors: Brad Lafountain <rodif_bl@yahoo.com>                        |
00016   |          Shane Caraveo <shane@caraveo.com>                           |
00017   |          Dmitry Stogov <dmitry@zend.com>                             |
00018   +----------------------------------------------------------------------+
00019 */
00020 /* $Id: php_sdl.h 321634 2012-01-01 13:15:04Z felipe $ */
00021 
00022 #ifndef PHP_SDL_H
00023 #define PHP_SDL_H
00024 
00025 #define XSD_WHITESPACE_COLLAPSE 1
00026 #define XSD_WHITESPACE_PRESERVE 1
00027 #define XSD_WHITESPACE_REPLACE  1
00028 
00029 typedef enum _sdlBindingType {
00030        BINDING_SOAP = 1,
00031        BINDING_HTTP = 2
00032 } sdlBindingType;
00033 
00034 typedef enum _sdlEncodingStyle {
00035        SOAP_RPC      = 1,
00036        SOAP_DOCUMENT = 2
00037 } sdlEncodingStyle;
00038 
00039 typedef enum _sdlRpcEncodingStyle {
00040        SOAP_ENCODING_DEFAULT = 0,
00041        SOAP_ENCODING_1_1     = 1,
00042        SOAP_ENCODING_1_2     = 2
00043 } sdlRpcEncodingStyle;
00044 
00045 typedef enum _sdlEncodingUse {
00046        SOAP_ENCODED = 1,
00047        SOAP_LITERAL = 2
00048 } sdlEncodingUse;
00049 
00050 typedef enum _sdlTransport {
00051        SOAP_TRANSPORT_HTTP = 1
00052 } sdlTransport;
00053 
00054 struct _sdl {
00055        HashTable  functions;        /* array of sdlFunction */
00056        HashTable *types;            /* array of sdlTypesPtr */
00057        HashTable *elements;         /* array of sdlTypesPtr */
00058        HashTable *encoders;         /* array of encodePtr */
00059        HashTable *bindings;         /* array of sdlBindings (key'd by name) */
00060        HashTable *requests;         /* array of sdlFunction (references) */
00061        HashTable *groups;           /* array of sdlTypesPtr */
00062        char      *target_ns;
00063        char      *source;
00064        zend_bool  is_persistent;
00065 };
00066 
00067 typedef struct sdlCtx {
00068        sdlPtr     sdl;
00069 
00070        HashTable  docs;             /* array of xmlDocPtr */
00071 
00072        HashTable  messages;         /* array of xmlNodePtr */
00073        HashTable  bindings;         /* array of xmlNodePtr */
00074        HashTable  portTypes;        /* array of xmlNodePtr */
00075        HashTable  services;         /* array of xmlNodePtr */
00076 
00077        HashTable *attributes;       /* array of sdlAttributePtr */
00078        HashTable *attributeGroups;  /* array of sdlTypesPtr */
00079        php_stream_context *context;
00080        zval               *old_header;
00081 } sdlCtx;
00082 
00083 struct _sdlBinding {
00084        char           *name;
00085        char           *location;
00086        sdlBindingType  bindingType;
00087        void           *bindingAttributes; /* sdlSoapBindingPtr */
00088 };
00089 
00090 /* Soap Binding Specfic stuff */
00091 struct _sdlSoapBinding {
00092        sdlEncodingStyle  style;
00093        sdlTransport      transport; /* not implemented yet */
00094 };
00095 
00096 typedef struct _sdlSoapBindingFunctionHeader {
00097        char                *name;
00098        char                *ns;
00099        sdlEncodingUse       use;
00100        sdlTypePtr           element;
00101        encodePtr            encode;
00102        sdlRpcEncodingStyle  encodingStyle; /* not implemented yet */
00103        HashTable           *headerfaults;  /* array of sdlSoapBindingFunctionHeaderPtr */
00104 } sdlSoapBindingFunctionHeader, *sdlSoapBindingFunctionHeaderPtr;
00105 
00106 typedef struct _sdlSoapBindingFunctionFault {
00107        char                *ns;
00108        sdlEncodingUse       use;
00109        sdlRpcEncodingStyle  encodingStyle; /* not implemented yet */
00110 } sdlSoapBindingFunctionFault, *sdlSoapBindingFunctionFaultPtr;
00111 
00112 struct _sdlSoapBindingFunctionBody {
00113        char                *ns;
00114        sdlEncodingUse       use;
00115        sdlRpcEncodingStyle  encodingStyle;  /* not implemented yet */
00116        HashTable           *headers;        /* array of sdlSoapBindingFunctionHeaderPtr */
00117 };
00118 
00119 struct _sdlSoapBindingFunction {
00120        char                       *soapAction;
00121        sdlEncodingStyle            style;
00122 
00123        sdlSoapBindingFunctionBody  input;
00124        sdlSoapBindingFunctionBody  output;
00125 };
00126 
00127 struct _sdlRestrictionInt {
00128        int   value;
00129        char  fixed;
00130 };
00131 
00132 struct _sdlRestrictionChar {
00133        char *value;
00134        char  fixed;
00135 };
00136 
00137 struct _sdlRestrictions {
00138        HashTable *enumeration;              /* array of sdlRestrictionCharPtr */
00139        sdlRestrictionIntPtr minExclusive;
00140        sdlRestrictionIntPtr minInclusive;
00141        sdlRestrictionIntPtr maxExclusive;
00142        sdlRestrictionIntPtr maxInclusive;
00143        sdlRestrictionIntPtr totalDigits;
00144        sdlRestrictionIntPtr fractionDigits;
00145        sdlRestrictionIntPtr length;
00146        sdlRestrictionIntPtr minLength;
00147        sdlRestrictionIntPtr maxLength;
00148        sdlRestrictionCharPtr whiteSpace;
00149        sdlRestrictionCharPtr pattern;
00150 };
00151 
00152 typedef enum _sdlContentKind {
00153        XSD_CONTENT_ELEMENT,
00154        XSD_CONTENT_SEQUENCE,
00155        XSD_CONTENT_ALL,
00156        XSD_CONTENT_CHOICE,
00157        XSD_CONTENT_GROUP_REF,
00158        XSD_CONTENT_GROUP,
00159        XSD_CONTENT_ANY
00160 } sdlContentKind;
00161 
00162 
00163 typedef struct _sdlContentModel sdlContentModel, *sdlContentModelPtr;
00164 
00165 struct _sdlContentModel {
00166        sdlContentKind kind;
00167        int min_occurs;
00168        int max_occurs;
00169        union {
00170               sdlTypePtr          element;      /* pointer to element */
00171               sdlTypePtr          group;        /* pointer to group */
00172               HashTable          *content;      /* array of sdlContentModel for sequnce,all,choice*/
00173               char               *group_ref;    /* reference to group */
00174        } u;
00175 };
00176 
00177 typedef enum _sdlTypeKind {
00178        XSD_TYPEKIND_SIMPLE,
00179        XSD_TYPEKIND_LIST,
00180        XSD_TYPEKIND_UNION,
00181        XSD_TYPEKIND_COMPLEX,
00182        XSD_TYPEKIND_RESTRICTION,
00183        XSD_TYPEKIND_EXTENSION
00184 } sdlTypeKind;
00185 
00186 typedef enum _sdlUse {
00187        XSD_USE_DEFAULT,
00188        XSD_USE_OPTIONAL,
00189        XSD_USE_PROHIBITED,
00190        XSD_USE_REQUIRED
00191 } sdlUse;
00192 
00193 typedef enum _sdlForm {
00194        XSD_FORM_DEFAULT,
00195        XSD_FORM_QUALIFIED,
00196        XSD_FORM_UNQUALIFIED
00197 } sdlForm;
00198 
00199 struct _sdlType {
00200        sdlTypeKind         kind;
00201        char               *name;
00202        char               *namens;
00203        char                nillable;
00204        HashTable          *elements;             /* array of sdlTypePtr */
00205        HashTable          *attributes;           /* array of sdlAttributePtr */
00206        sdlRestrictionsPtr  restrictions;
00207        encodePtr           encode;
00208        sdlContentModelPtr  model;
00209        char               *def;
00210        char               *fixed;
00211        char               *ref;
00212        sdlForm             form;
00213 };
00214 
00215 struct _sdlParam {
00216        int        order;
00217        sdlTypePtr element;
00218        encodePtr  encode;
00219        char      *paramName;
00220 };
00221 
00222 typedef struct _sdlFault {
00223        char      *name;
00224        HashTable *details;            /* array of sdlParamPtr */
00225        void      *bindingAttributes;  /* sdlSoapBindingFunctionFaultPtr */
00226 } sdlFault, *sdlFaultPtr;
00227 
00228 struct _sdlFunction {
00229        char               *functionName;
00230        char               *requestName;
00231        char               *responseName;
00232        HashTable          *requestParameters;  /* array of sdlParamPtr */
00233        HashTable          *responseParameters; /* array of sdlParamPtr (this should only be one) */
00234        struct _sdlBinding *binding;
00235        void               *bindingAttributes;  /* sdlSoapBindingFunctionPtr */
00236        HashTable          *faults;             /* array of sdlFaultPtr */
00237 };
00238 
00239 typedef struct _sdlExtraAttribute {
00240        char *ns;
00241        char *val;
00242 } sdlExtraAttribute, *sdlExtraAttributePtr;
00243 
00244 struct _sdlAttribute {
00245        char      *name;
00246        char      *namens;
00247        char      *ref;
00248        char      *def;
00249        char      *fixed;
00250        sdlForm    form;
00251        sdlUse     use;
00252        HashTable *extraAttributes;               /* array of sdlExtraAttribute */
00253        encodePtr  encode;
00254 };
00255 
00256 
00257 sdlPtr get_sdl(zval *this_ptr, char *uri, long cache_wsdl TSRMLS_DC);
00258 
00259 encodePtr get_encoder_from_prefix(sdlPtr sdl, xmlNodePtr data, const xmlChar *type);
00260 encodePtr get_encoder(sdlPtr sdl, const char *ns, const char *type);
00261 encodePtr get_encoder_ex(sdlPtr sdl, const char *nscat, int len);
00262 
00263 sdlBindingPtr get_binding_from_type(sdlPtr sdl, int type);
00264 sdlBindingPtr get_binding_from_name(sdlPtr sdl, char *name, char *ns);
00265 
00266 void delete_sdl(void *handle);
00267 void delete_sdl_impl(void *handle);
00268 
00269 void sdl_set_uri_credentials(sdlCtx *ctx, char *uri TSRMLS_DC);
00270 void sdl_restore_uri_credentials(sdlCtx *ctx TSRMLS_DC);
00271 
00272 #endif