@@ -1935,8 +1935,6 @@ PHP_METHOD(SoapClient, __construct)
1935
1935
RETURN_THROWS ();
1936
1936
}
1937
1937
1938
- SOAP_CLIENT_BEGIN_CODE ();
1939
-
1940
1938
cache_wsdl = SOAP_GLOBAL (cache_enabled ) ? SOAP_GLOBAL (cache_mode ) : 0 ;
1941
1939
1942
1940
if (options != NULL ) {
@@ -1949,7 +1947,8 @@ PHP_METHOD(SoapClient, __construct)
1949
1947
Z_TYPE_P (tmp ) == IS_STRING ) {
1950
1948
ZVAL_STR_COPY (Z_CLIENT_URI_P (this_ptr ), Z_STR_P (tmp ));
1951
1949
} else {
1952
- php_error_docref (NULL , E_ERROR , "'uri' option is required in nonWSDL mode" );
1950
+ zend_argument_value_error (2 , "must provide \"uri\" option as it is required in nonWSDL mode" );
1951
+ RETURN_THROWS ();
1953
1952
}
1954
1953
1955
1954
if ((tmp = zend_hash_str_find (ht , "style" , sizeof ("style" )- 1 )) != NULL &&
@@ -1977,7 +1976,8 @@ PHP_METHOD(SoapClient, __construct)
1977
1976
Z_TYPE_P (tmp ) == IS_STRING ) {
1978
1977
ZVAL_STR_COPY (Z_CLIENT_LOCATION_P (this_ptr ), Z_STR_P (tmp ));
1979
1978
} else if (!wsdl ) {
1980
- php_error_docref (NULL , E_ERROR , "'location' option is required in nonWSDL mode" );
1979
+ zend_argument_value_error (2 , "must provide \"location\" option as it is required in nonWSDL mode" );
1980
+ RETURN_THROWS ();
1981
1981
}
1982
1982
1983
1983
if ((tmp = zend_hash_str_find (ht , "soap_version" , sizeof ("soap_version" )- 1 )) != NULL ) {
@@ -2056,7 +2056,8 @@ PHP_METHOD(SoapClient, __construct)
2056
2056
2057
2057
encoding = xmlFindCharEncodingHandler (Z_STRVAL_P (tmp ));
2058
2058
if (encoding == NULL ) {
2059
- php_error_docref (NULL , E_ERROR , "Invalid 'encoding' option - '%s'" , Z_STRVAL_P (tmp ));
2059
+ zend_argument_value_error (2 , "provided \"encoding\" option \"%s\" is invalid" , Z_STRVAL_P (tmp ));
2060
+ RETURN_THROWS ();
2060
2061
} else {
2061
2062
xmlCharEncCloseFunc (encoding );
2062
2063
ZVAL_STR_COPY (Z_CLIENT_ENCODING_P (this_ptr ), Z_STR_P (tmp ));
@@ -2112,10 +2113,15 @@ PHP_METHOD(SoapClient, __construct)
2112
2113
"The \"ssl_method\" option is deprecated. "
2113
2114
"Use \"ssl\" stream context options instead" );
2114
2115
}
2115
- } else if (!wsdl ) {
2116
- php_error_docref (NULL , E_ERROR , "'location' and 'uri' options are required in nonWSDL mode" );
2117
2116
}
2118
2117
2118
+ if (options == NULL && wsdl == NULL ) {
2119
+ zend_argument_value_error (2 , "must provide \"uri\" and \"location\" options as they are required in nonWSDL mode" );
2120
+ RETURN_THROWS ();
2121
+ }
2122
+
2123
+ SOAP_CLIENT_BEGIN_CODE ();
2124
+
2119
2125
ZVAL_LONG (Z_CLIENT_SOAP_VERSION_P (this_ptr ), soap_version );
2120
2126
2121
2127
if (wsdl ) {
0 commit comments