diff options
Diffstat (limited to 'ext/soap/soap.c')
-rw-r--r-- | ext/soap/soap.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/ext/soap/soap.c b/ext/soap/soap.c index a20c7860e..8a9e9bafe 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2008 The PHP Group | + | Copyright (c) 1997-2009 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -17,7 +17,7 @@ | Dmitry Stogov <dmitry@zend.com> | +----------------------------------------------------------------------+ */ -/* $Id: soap.c,v 1.156.2.28.2.39 2008/03/04 12:23:10 dmitry Exp $ */ +/* $Id: soap.c,v 1.156.2.28.2.44 2009/02/18 13:25:32 dmitry Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -2348,6 +2348,7 @@ PHP_METHOD(SoapClient, SoapClient) if (zend_hash_find(ht, "stream_context", sizeof("stream_context"), (void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_RESOURCE) { context = php_stream_context_from_zval(*tmp, 1); + zend_list_addref(context->rsrc_id); } if (zend_hash_find(ht, "location", sizeof("location"), (void**)&tmp) == SUCCESS && @@ -2380,8 +2381,8 @@ PHP_METHOD(SoapClient, SoapClient) if (zend_hash_find(ht, "proxy_host", sizeof("proxy_host"), (void**)&tmp) == SUCCESS && Z_TYPE_PP(tmp) == IS_STRING) { add_property_stringl(this_ptr, "_proxy_host", Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), 1); - if (zend_hash_find(ht, "proxy_port", sizeof("proxy_port"), (void**)&tmp) == SUCCESS && - Z_TYPE_PP(tmp) == IS_LONG) { + if (zend_hash_find(ht, "proxy_port", sizeof("proxy_port"), (void**)&tmp) == SUCCESS) { + convert_to_long(*tmp); add_property_long(this_ptr, "_proxy_port", Z_LVAL_PP(tmp)); } if (zend_hash_find(ht, "proxy_login", sizeof("proxy_login"), (void**)&tmp) == SUCCESS && @@ -2566,11 +2567,11 @@ static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *act ZVAL_LONG(params[4], one_way); if (call_user_function(NULL, &this_ptr, &func, response, 5, params TSRMLS_CC) != SUCCESS) { - add_soap_fault(this_ptr, "Client", "SoapSlient::__doRequest() failed", NULL, NULL TSRMLS_CC); + add_soap_fault(this_ptr, "Client", "SoapClient::__doRequest() failed", NULL, NULL TSRMLS_CC); ret = FALSE; } else if (Z_TYPE_P(response) != IS_STRING) { if (zend_hash_find(Z_OBJPROP_P(this_ptr), "__soap_fault", sizeof("__soap_fault"), (void **) &fault) == FAILURE) { - add_soap_fault(this_ptr, "Client", "SoapSlient::__doRequest() returned non string value", NULL, NULL TSRMLS_CC); + add_soap_fault(this_ptr, "Client", "SoapClient::__doRequest() returned non string value", NULL, NULL TSRMLS_CC); } ret = FALSE; } else if (zend_hash_find(Z_OBJPROP_P(this_ptr), "trace", sizeof("trace"), (void **) &trace) == SUCCESS && @@ -4186,7 +4187,17 @@ static xmlDocPtr serialize_function_call(zval *this_ptr, sdlFunctionPtr function /*style = SOAP_RPC;*/ if (style == SOAP_RPC) { ns = encode_add_ns(body, uri); - method = xmlNewChild(body, ns, BAD_CAST(function_name), NULL); + if (function_name) { + method = xmlNewChild(body, ns, BAD_CAST(function_name), NULL); + } else if (function && function->requestName) { + method = xmlNewChild(body, ns, BAD_CAST(function->requestName), NULL); + } else if (function && function->functionName) { + method = xmlNewChild(body, ns, BAD_CAST(function->functionName), NULL); + } else { + method = body; + } + } else { + method = body; } if (zend_hash_find(Z_OBJPROP_P(this_ptr), "use", sizeof("use"), (void **)&zuse) == SUCCESS && |