version 1.1.1.3, 2013/07/22 01:32:01
|
version 1.1.1.4, 2013/10/14 08:02:30
|
Line 1284 PHP_METHOD(SoapServer, setClass)
|
Line 1284 PHP_METHOD(SoapServer, setClass)
|
} |
} |
} |
} |
} else { |
} else { |
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tried to set a non existant class (%s)", classname); | php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tried to set a non existent class (%s)", classname); |
return; |
return; |
} |
} |
|
|
Line 1415 PHP_METHOD(SoapServer, addFunction)
|
Line 1415 PHP_METHOD(SoapServer, addFunction)
|
zend_str_tolower_copy(key, Z_STRVAL_PP(tmp_function), key_len); |
zend_str_tolower_copy(key, Z_STRVAL_PP(tmp_function), key_len); |
|
|
if (zend_hash_find(EG(function_table), key, key_len+1, (void**)&f) == FAILURE) { |
if (zend_hash_find(EG(function_table), key, key_len+1, (void**)&f) == FAILURE) { |
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tried to add a non existant function '%s'", Z_STRVAL_PP(tmp_function)); | php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tried to add a non existent function '%s'", Z_STRVAL_PP(tmp_function)); |
return; |
return; |
} |
} |
|
|
Line 1437 PHP_METHOD(SoapServer, addFunction)
|
Line 1437 PHP_METHOD(SoapServer, addFunction)
|
zend_str_tolower_copy(key, Z_STRVAL_P(function_name), key_len); |
zend_str_tolower_copy(key, Z_STRVAL_P(function_name), key_len); |
|
|
if (zend_hash_find(EG(function_table), key, key_len+1, (void**)&f) == FAILURE) { |
if (zend_hash_find(EG(function_table), key, key_len+1, (void**)&f) == FAILURE) { |
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tried to add a non existant function '%s'", Z_STRVAL_P(function_name)); | php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tried to add a non existent function '%s'", Z_STRVAL_P(function_name)); |
return; |
return; |
} |
} |
if (service->soap_functions.ft == NULL) { |
if (service->soap_functions.ft == NULL) { |
Line 3658 ignore_header:
|
Line 3658 ignore_header:
|
return function; |
return function; |
} |
} |
|
|
static int serialize_response_call2(xmlNodePtr body, sdlFunctionPtr function, char *function_name, char *uri, zval *ret, int version, int main TSRMLS_DC) | static void set_soap_header_attributes(xmlNodePtr h, HashTable *ht, int version) |
{ |
{ |
|
zval **tmp; |
|
|
|
if (zend_hash_find(ht, "mustUnderstand", sizeof("mustUnderstand"), (void**)&tmp) == SUCCESS && |
|
Z_TYPE_PP(tmp) == IS_BOOL && Z_LVAL_PP(tmp)) { |
|
if (version == SOAP_1_1) { |
|
xmlSetProp(h, BAD_CAST(SOAP_1_1_ENV_NS_PREFIX":mustUnderstand"), BAD_CAST("1")); |
|
} else { |
|
xmlSetProp(h, BAD_CAST(SOAP_1_2_ENV_NS_PREFIX":mustUnderstand"), BAD_CAST("true")); |
|
} |
|
} |
|
if (zend_hash_find(ht, "actor", sizeof("actor"), (void**)&tmp) == SUCCESS) { |
|
if (Z_TYPE_PP(tmp) == IS_STRING) { |
|
if (version == SOAP_1_1) { |
|
xmlSetProp(h, BAD_CAST(SOAP_1_1_ENV_NS_PREFIX":actor"), BAD_CAST(Z_STRVAL_PP(tmp))); |
|
} else { |
|
xmlSetProp(h, BAD_CAST(SOAP_1_2_ENV_NS_PREFIX":role"), BAD_CAST(Z_STRVAL_PP(tmp))); |
|
} |
|
} else if (Z_TYPE_PP(tmp) == IS_LONG) { |
|
if (version == SOAP_1_1) { |
|
if (Z_LVAL_PP(tmp) == SOAP_ACTOR_NEXT) { |
|
xmlSetProp(h, BAD_CAST(SOAP_1_1_ENV_NS_PREFIX":actor"), BAD_CAST(SOAP_1_1_ACTOR_NEXT)); |
|
} |
|
} else { |
|
if (Z_LVAL_PP(tmp) == SOAP_ACTOR_NEXT) { |
|
xmlSetProp(h, BAD_CAST(SOAP_1_2_ENV_NS_PREFIX":role"), BAD_CAST(SOAP_1_2_ACTOR_NEXT)); |
|
} else if (Z_LVAL_PP(tmp) == SOAP_ACTOR_NONE) { |
|
xmlSetProp(h, BAD_CAST(SOAP_1_2_ENV_NS_PREFIX":role"), BAD_CAST(SOAP_1_2_ACTOR_NONE)); |
|
} else if (Z_LVAL_PP(tmp) == SOAP_ACTOR_UNLIMATERECEIVER) { |
|
xmlSetProp(h, BAD_CAST(SOAP_1_2_ENV_NS_PREFIX":role"), BAD_CAST(SOAP_1_2_ACTOR_UNLIMATERECEIVER)); |
|
} |
|
} |
|
} |
|
} |
|
} |
|
|
|
static int serialize_response_call2(xmlNodePtr body, sdlFunctionPtr function, char *function_name, char *uri, zval *ret, int version, int main, xmlNodePtr *node TSRMLS_DC) |
|
{ |
xmlNodePtr method = NULL, param; |
xmlNodePtr method = NULL, param; |
sdlParamPtr parameter = NULL; |
sdlParamPtr parameter = NULL; |
int param_count; |
int param_count; |
Line 3758 static int serialize_response_call2(xmlNodePtr body, s
|
Line 3795 static int serialize_response_call2(xmlNodePtr body, s
|
if (use == SOAP_ENCODED && version == SOAP_1_2 && method != NULL) { |
if (use == SOAP_ENCODED && version == SOAP_1_2 && method != NULL) { |
xmlSetNsProp(method, body->ns, BAD_CAST("encodingStyle"), BAD_CAST(SOAP_1_2_ENC_NAMESPACE)); |
xmlSetNsProp(method, body->ns, BAD_CAST("encodingStyle"), BAD_CAST(SOAP_1_2_ENC_NAMESPACE)); |
} |
} |
|
if (node) { |
|
*node = method; |
|
} |
return use; |
return use; |
} |
} |
|
|
Line 3839 static xmlDocPtr serialize_response_call(sdlFunctionPt
|
Line 3879 static xmlDocPtr serialize_response_call(sdlFunctionPt
|
} |
} |
|
|
if (headers->function) { |
if (headers->function) { |
if (serialize_response_call2(head, headers->function, Z_STRVAL(headers->function_name), uri, hdr_ret, version, 0 TSRMLS_CC) == SOAP_ENCODED) { | if (serialize_response_call2(head, headers->function, Z_STRVAL(headers->function_name), uri, hdr_ret, version, 0, NULL TSRMLS_CC) == SOAP_ENCODED) { |
use = SOAP_ENCODED; |
use = SOAP_ENCODED; |
} |
} |
} else { |
} else { |
Line 4025 static xmlDocPtr serialize_response_call(sdlFunctionPt
|
Line 4065 static xmlDocPtr serialize_response_call(sdlFunctionPt
|
zval *hdr_ret = &h->retval; |
zval *hdr_ret = &h->retval; |
char *hdr_ns = h->hdr?h->hdr->ns:NULL; |
char *hdr_ns = h->hdr?h->hdr->ns:NULL; |
char *hdr_name = Z_STRVAL(h->function_name); |
char *hdr_name = Z_STRVAL(h->function_name); |
|
HashTable *ht = NULL; |
|
|
|
|
if (Z_TYPE(h->retval) == IS_OBJECT && |
if (Z_TYPE(h->retval) == IS_OBJECT && |
instanceof_function(Z_OBJCE(h->retval), soap_header_class_entry TSRMLS_CC)) { |
instanceof_function(Z_OBJCE(h->retval), soap_header_class_entry TSRMLS_CC)) { |
HashTable* ht = Z_OBJPROP(h->retval); |
|
zval **tmp; |
zval **tmp; |
sdlSoapBindingFunctionHeaderPtr *hdr; |
sdlSoapBindingFunctionHeaderPtr *hdr; |
smart_str key = {0}; |
smart_str key = {0}; |
|
|
|
ht = Z_OBJPROP(h->retval); |
if (zend_hash_find(ht, "namespace", sizeof("namespace"), (void**)&tmp) == SUCCESS && |
if (zend_hash_find(ht, "namespace", sizeof("namespace"), (void**)&tmp) == SUCCESS && |
Z_TYPE_PP(tmp) == IS_STRING) { |
Z_TYPE_PP(tmp) == IS_STRING) { |
smart_str_appendl(&key, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); |
smart_str_appendl(&key, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); |
Line 4064 static xmlDocPtr serialize_response_call(sdlFunctionPt
|
Line 4104 static xmlDocPtr serialize_response_call(sdlFunctionPt
|
} |
} |
|
|
if (h->function) { |
if (h->function) { |
if (serialize_response_call2(head, h->function, Z_STRVAL(h->function_name), uri, hdr_ret, version, 0 TSRMLS_CC) == SOAP_ENCODED) { | xmlNodePtr xmlHdr = NULL; |
| |
| if (serialize_response_call2(head, h->function, Z_STRVAL(h->function_name), uri, hdr_ret, version, 0, &xmlHdr TSRMLS_CC) == SOAP_ENCODED) { |
use = SOAP_ENCODED; |
use = SOAP_ENCODED; |
} |
} |
|
if (ht) { |
|
set_soap_header_attributes(xmlHdr, ht, version); |
|
} |
} else { |
} else { |
xmlNodePtr xmlHdr = master_to_xml(hdr_enc, hdr_ret, hdr_use, head TSRMLS_CC); |
xmlNodePtr xmlHdr = master_to_xml(hdr_enc, hdr_ret, hdr_use, head TSRMLS_CC); |
if (hdr_name) { |
if (hdr_name) { |
Line 4076 static xmlDocPtr serialize_response_call(sdlFunctionPt
|
Line 4121 static xmlDocPtr serialize_response_call(sdlFunctionPt
|
xmlNsPtr nsptr = encode_add_ns(xmlHdr,hdr_ns); |
xmlNsPtr nsptr = encode_add_ns(xmlHdr,hdr_ns); |
xmlSetNs(xmlHdr, nsptr); |
xmlSetNs(xmlHdr, nsptr); |
} |
} |
|
if (ht) { |
|
set_soap_header_attributes(xmlHdr, ht, version); |
|
} |
} |
} |
} |
} |
h = h->next; |
h = h->next; |
Line 4089 static xmlDocPtr serialize_response_call(sdlFunctionPt
|
Line 4137 static xmlDocPtr serialize_response_call(sdlFunctionPt
|
|
|
body = xmlNewChild(envelope, ns, BAD_CAST("Body"), NULL); |
body = xmlNewChild(envelope, ns, BAD_CAST("Body"), NULL); |
|
|
if (serialize_response_call2(body, function, function_name, uri, ret, version, 1 TSRMLS_CC) == SOAP_ENCODED) { | if (serialize_response_call2(body, function, function_name, uri, ret, version, 1, NULL TSRMLS_CC) == SOAP_ENCODED) { |
use = SOAP_ENCODED; |
use = SOAP_ENCODED; |
} |
} |
|
|
Line 4281 static xmlDocPtr serialize_function_call(zval *this_pt
|
Line 4329 static xmlDocPtr serialize_function_call(zval *this_pt
|
} |
} |
nsptr = encode_add_ns(h, Z_STRVAL_PP(ns)); |
nsptr = encode_add_ns(h, Z_STRVAL_PP(ns)); |
xmlSetNs(h, nsptr); |
xmlSetNs(h, nsptr); |
| set_soap_header_attributes(h, ht, version); |
if (zend_hash_find(ht, "mustUnderstand", sizeof("mustUnderstand"), (void**)&tmp) == SUCCESS && | |
Z_TYPE_PP(tmp) == IS_BOOL && Z_LVAL_PP(tmp)) { | |
if (version == SOAP_1_1) { | |
xmlSetProp(h, BAD_CAST(SOAP_1_1_ENV_NS_PREFIX":mustUnderstand"), BAD_CAST("1")); | |
} else { | |
xmlSetProp(h, BAD_CAST(SOAP_1_2_ENV_NS_PREFIX":mustUnderstand"), BAD_CAST("true")); | |
} | |
} | |
if (zend_hash_find(ht, "actor", sizeof("actor"), (void**)&tmp) == SUCCESS) { | |
if (Z_TYPE_PP(tmp) == IS_STRING) { | |
if (version == SOAP_1_1) { | |
xmlSetProp(h, BAD_CAST(SOAP_1_1_ENV_NS_PREFIX":actor"), BAD_CAST(Z_STRVAL_PP(tmp))); | |
} else { | |
xmlSetProp(h, BAD_CAST(SOAP_1_2_ENV_NS_PREFIX":role"), BAD_CAST(Z_STRVAL_PP(tmp))); | |
} | |
} else if (Z_TYPE_PP(tmp) == IS_LONG) { | |
if (version == SOAP_1_1) { | |
if (Z_LVAL_PP(tmp) == SOAP_ACTOR_NEXT) { | |
xmlSetProp(h, BAD_CAST(SOAP_1_1_ENV_NS_PREFIX":actor"), BAD_CAST(SOAP_1_1_ACTOR_NEXT)); | |
} | |
} else { | |
if (Z_LVAL_PP(tmp) == SOAP_ACTOR_NEXT) { | |
xmlSetProp(h, BAD_CAST(SOAP_1_2_ENV_NS_PREFIX":role"), BAD_CAST(SOAP_1_2_ACTOR_NEXT)); | |
} else if (Z_LVAL_PP(tmp) == SOAP_ACTOR_NONE) { | |
xmlSetProp(h, BAD_CAST(SOAP_1_2_ENV_NS_PREFIX":role"), BAD_CAST(SOAP_1_2_ACTOR_NONE)); | |
} else if (Z_LVAL_PP(tmp) == SOAP_ACTOR_UNLIMATERECEIVER) { | |
xmlSetProp(h, BAD_CAST(SOAP_1_2_ENV_NS_PREFIX":role"), BAD_CAST(SOAP_1_2_ACTOR_UNLIMATERECEIVER)); | |
} | |
} | |
} | |
} | |
} |
} |
zend_hash_move_forward(soap_headers); |
zend_hash_move_forward(soap_headers); |
} |
} |