1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Implement request #61105: Support Soap 1.2 SoapFault Reason Text lang attribute

This is on the border line of a bugfix and a new feature.
Anyway, this is necessary to fix compatibility with .NET clients.

Closes GH-18701.
This commit is contained in:
Niels Dossche
2025-05-29 19:15:02 +02:00
parent ed2bebd783
commit 9859d837ca
36 changed files with 205 additions and 118 deletions

2
NEWS
View File

@@ -202,6 +202,8 @@ PHP NEWS
. Fixed bug #70951 (Segmentation fault on invalid WSDL cache). (nielsdos)
. Implement request #55503 (Extend __getTypes to support enumerations).
(nielsdos, datibbaw)
. Implement request #61105 (Support Soap 1.2 SoapFault Reason Text lang
attribute). (nielsdos)
- Sockets:
. Added IPPROTO_ICMP/IPPROTO_ICMPV6 to create raw socket for ICMP usage.

View File

@@ -204,6 +204,11 @@ PHP 8.5 UPGRADE NOTES
- SOAP:
. Enumeration cases are now dumped in __getTypes().
. Implemented request #61105:
support for Soap 1.2 Reason Text xml:lang attribute.
The signature of SoapFault::__construct() and SoapServer::fault() therefore
now have an optional $lang parameter.
This support solves compatibility with .NET SOAP clients.
- XSL:
. The $namespace argument of XSLTProcessor::getParameter(),

View File

@@ -455,7 +455,7 @@ try_again:
if (request != buf) {
zend_string_release_ex(request, 0);
}
add_soap_fault(this_ptr, "HTTP", "Unable to parse URL", NULL, NULL);
add_soap_fault(this_ptr, "HTTP", "Unable to parse URL", NULL, NULL, SOAP_GLOBAL(lang_en));
smart_str_free(&soap_headers_z);
efree(http_msg);
return FALSE;
@@ -469,7 +469,7 @@ try_again:
if (request != buf) {
zend_string_release_ex(request, 0);
}
add_soap_fault(this_ptr, "HTTP", "Unknown protocol. Only http and https are allowed.", NULL, NULL);
add_soap_fault(this_ptr, "HTTP", "Unknown protocol. Only http and https are allowed.", NULL, NULL, SOAP_GLOBAL(lang_en));
smart_str_free(&soap_headers_z);
efree(http_msg);
return FALSE;
@@ -482,7 +482,7 @@ try_again:
if (request != buf) {
zend_string_release_ex(request, 0);
}
add_soap_fault(this_ptr, "HTTP", "SSL support is not available in this build", NULL, NULL);
add_soap_fault(this_ptr, "HTTP", "SSL support is not available in this build", NULL, NULL, SOAP_GLOBAL(lang_en));
PG(allow_url_fopen) = old_allow_url_fopen;
smart_str_free(&soap_headers_z);
efree(http_msg);
@@ -537,7 +537,7 @@ try_again:
if (request != buf) {
zend_string_release_ex(request, 0);
}
add_soap_fault(this_ptr, "HTTP", "Could not connect to host", NULL, NULL);
add_soap_fault(this_ptr, "HTTP", "Could not connect to host", NULL, NULL, SOAP_GLOBAL(lang_en));
PG(allow_url_fopen) = old_allow_url_fopen;
smart_str_free(&soap_headers_z);
efree(http_msg);
@@ -908,14 +908,14 @@ try_again:
convert_to_null(Z_CLIENT_HTTPURL_P(this_ptr));
convert_to_null(Z_CLIENT_HTTPSOCKET_P(this_ptr));
convert_to_null(Z_CLIENT_USE_PROXY_P(this_ptr));
add_soap_fault(this_ptr, "HTTP", "Failed Sending HTTP SOAP request", NULL, NULL);
add_soap_fault(this_ptr, "HTTP", "Failed Sending HTTP SOAP request", NULL, NULL, SOAP_GLOBAL(lang_en));
smart_str_free(&soap_headers_z);
efree(http_msg);
return FALSE;
}
smart_str_free(&soap_headers);
} else {
add_soap_fault(this_ptr, "HTTP", "Failed to create stream??", NULL, NULL);
add_soap_fault(this_ptr, "HTTP", "Failed to create stream??", NULL, NULL, SOAP_GLOBAL(lang_en));
smart_str_free(&soap_headers_z);
efree(http_msg);
return FALSE;
@@ -932,7 +932,7 @@ try_again:
php_stream_close(stream);
convert_to_null(Z_CLIENT_HTTPSOCKET_P(this_ptr));
convert_to_null(Z_CLIENT_USE_PROXY_P(this_ptr));
add_soap_fault(this_ptr, "HTTP", "Error Fetching http headers", NULL, NULL);
add_soap_fault(this_ptr, "HTTP", "Error Fetching http headers", NULL, NULL, SOAP_GLOBAL(lang_en));
smart_str_free(&soap_headers_z);
efree(http_msg);
return FALSE;
@@ -1121,7 +1121,7 @@ try_again:
zend_string_release_ex(http_headers, 0);
convert_to_null(Z_CLIENT_HTTPSOCKET_P(this_ptr));
convert_to_null(Z_CLIENT_USE_PROXY_P(this_ptr));
add_soap_fault(this_ptr, "HTTP", "Error Fetching http body, No Content-Length, connection closed or chunked data", NULL, NULL);
add_soap_fault(this_ptr, "HTTP", "Error Fetching http body, No Content-Length, connection closed or chunked data", NULL, NULL, SOAP_GLOBAL(lang_en));
if (http_msg) {
efree(http_msg);
}
@@ -1180,7 +1180,7 @@ try_again:
phpurl = new_url;
if (--redirect_max < 1) {
add_soap_fault(this_ptr, "HTTP", "Redirection limit reached, aborting", NULL, NULL);
add_soap_fault(this_ptr, "HTTP", "Redirection limit reached, aborting", NULL, NULL, SOAP_GLOBAL(lang_en));
smart_str_free(&soap_headers_z);
efree(http_msg);
return FALSE;
@@ -1318,7 +1318,7 @@ try_again:
if (http_msg) {
efree(http_msg);
}
add_soap_fault(this_ptr, "HTTP", "Unknown Content-Encoding", NULL, NULL);
add_soap_fault(this_ptr, "HTTP", "Unknown Content-Encoding", NULL, NULL, SOAP_GLOBAL(lang_en));
return FALSE;
}
if (call_user_function(CG(function_table), (zval*)NULL, &func, &retval, 1, params) == SUCCESS &&
@@ -1334,7 +1334,7 @@ try_again:
efree(content_encoding);
zend_string_release_ex(http_headers, 0);
zend_string_release_ex(http_body, 0);
add_soap_fault(this_ptr, "HTTP", "Can't uncompress compressed response", NULL, NULL);
add_soap_fault(this_ptr, "HTTP", "Can't uncompress compressed response", NULL, NULL, SOAP_GLOBAL(lang_en));
if (http_msg) {
efree(http_msg);
}
@@ -1368,7 +1368,7 @@ try_again:
if (error) {
zval_ptr_dtor(return_value);
ZVAL_UNDEF(return_value);
add_soap_fault(this_ptr, "HTTP", http_msg, NULL, NULL);
add_soap_fault(this_ptr, "HTTP", http_msg, NULL, NULL, SOAP_GLOBAL(lang_en));
efree(http_msg);
return FALSE;
}

View File

@@ -40,11 +40,11 @@ bool parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunctio
response = soap_xmlParseMemory(buffer, buffer_size);
if (!response) {
add_soap_fault(this_ptr, "Client", "looks like we got no XML document", NULL, NULL);
add_soap_fault(this_ptr, "Client", "looks like we got no XML document", NULL, NULL, SOAP_GLOBAL(lang_en));
return false;
}
if (xmlGetIntSubset(response) != NULL) {
add_soap_fault(this_ptr, "Client", "DTD are not supported by SOAP", NULL, NULL);
add_soap_fault(this_ptr, "Client", "DTD are not supported by SOAP", NULL, NULL, SOAP_GLOBAL(lang_en));
xmlFreeDoc(response);
return false;
}
@@ -63,7 +63,7 @@ bool parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunctio
envelope_ns = SOAP_1_2_ENV_NAMESPACE;
soap_version = SOAP_1_2;
} else {
add_soap_fault(this_ptr, "VersionMismatch", "Wrong Version", NULL, NULL);
add_soap_fault(this_ptr, "VersionMismatch", "Wrong Version", NULL, NULL, SOAP_GLOBAL(lang_en));
xmlFreeDoc(response);
return false;
}
@@ -71,7 +71,7 @@ bool parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunctio
trav = trav->next;
}
if (env == NULL) {
add_soap_fault(this_ptr, "Client", "looks like we got XML without \"Envelope\" element", NULL, NULL);
add_soap_fault(this_ptr, "Client", "looks like we got XML without \"Envelope\" element", NULL, NULL, SOAP_GLOBAL(lang_en));
xmlFreeDoc(response);
return false;
}
@@ -79,16 +79,16 @@ bool parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunctio
attr = env->properties;
while (attr != NULL) {
if (attr->ns == NULL) {
add_soap_fault(this_ptr, "Client", "A SOAP Envelope element cannot have non Namespace qualified attributes", NULL, NULL);
add_soap_fault(this_ptr, "Client", "A SOAP Envelope element cannot have non Namespace qualified attributes", NULL, NULL, SOAP_GLOBAL(lang_en));
xmlFreeDoc(response);
return false;
} else if (attr_is_equal_ex(attr,"encodingStyle",SOAP_1_2_ENV_NAMESPACE)) {
if (soap_version == SOAP_1_2) {
add_soap_fault(this_ptr, "Client", "encodingStyle cannot be specified on the Envelope", NULL, NULL);
add_soap_fault(this_ptr, "Client", "encodingStyle cannot be specified on the Envelope", NULL, NULL, SOAP_GLOBAL(lang_en));
xmlFreeDoc(response);
return false;
} else if (strcmp((char*)attr->children->content, SOAP_1_1_ENC_NAMESPACE) != 0) {
add_soap_fault(this_ptr, "Client", "Unknown data encoding style", NULL, NULL);
add_soap_fault(this_ptr, "Client", "Unknown data encoding style", NULL, NULL, SOAP_GLOBAL(lang_en));
xmlFreeDoc(response);
return false;
}
@@ -120,7 +120,7 @@ bool parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunctio
trav = trav->next;
}
if (body == NULL) {
add_soap_fault(this_ptr, "Client", "Body must be present in a SOAP envelope", NULL, NULL);
add_soap_fault(this_ptr, "Client", "Body must be present in a SOAP envelope", NULL, NULL, SOAP_GLOBAL(lang_en));
xmlFreeDoc(response);
return false;
}
@@ -128,17 +128,17 @@ bool parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunctio
while (attr != NULL) {
if (attr->ns == NULL) {
if (soap_version == SOAP_1_2) {
add_soap_fault(this_ptr, "Client", "A SOAP Body element cannot have non Namespace qualified attributes", NULL, NULL);
add_soap_fault(this_ptr, "Client", "A SOAP Body element cannot have non Namespace qualified attributes", NULL, NULL, SOAP_GLOBAL(lang_en));
xmlFreeDoc(response);
return false;
}
} else if (attr_is_equal_ex(attr,"encodingStyle",SOAP_1_2_ENV_NAMESPACE)) {
if (soap_version == SOAP_1_2) {
add_soap_fault(this_ptr, "Client", "encodingStyle cannot be specified on the Body", NULL, NULL);
add_soap_fault(this_ptr, "Client", "encodingStyle cannot be specified on the Body", NULL, NULL, SOAP_GLOBAL(lang_en));
xmlFreeDoc(response);
return false;
} else if (strcmp((char*)attr->children->content, SOAP_1_1_ENC_NAMESPACE) != 0) {
add_soap_fault(this_ptr, "Client", "Unknown data encoding style", NULL, NULL);
add_soap_fault(this_ptr, "Client", "Unknown data encoding style", NULL, NULL, SOAP_GLOBAL(lang_en));
xmlFreeDoc(response);
return false;
}
@@ -146,7 +146,7 @@ bool parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunctio
attr = attr->next;
}
if (trav != NULL && soap_version == SOAP_1_2) {
add_soap_fault(this_ptr, "Client", "A SOAP 1.2 envelope can contain only Header and Body", NULL, NULL);
add_soap_fault(this_ptr, "Client", "A SOAP 1.2 envelope can contain only Header and Body", NULL, NULL, SOAP_GLOBAL(lang_en));
xmlFreeDoc(response);
return false;
}
@@ -155,16 +155,16 @@ bool parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunctio
attr = head->properties;
while (attr != NULL) {
if (attr->ns == NULL) {
add_soap_fault(this_ptr, "Client", "A SOAP Header element cannot have non Namespace qualified attributes", NULL, NULL);
add_soap_fault(this_ptr, "Client", "A SOAP Header element cannot have non Namespace qualified attributes", NULL, NULL, SOAP_GLOBAL(lang_en));
xmlFreeDoc(response);
return false;
} else if (attr_is_equal_ex(attr,"encodingStyle",SOAP_1_2_ENV_NAMESPACE)) {
if (soap_version == SOAP_1_2) {
add_soap_fault(this_ptr, "Client", "encodingStyle cannot be specified on the Header", NULL, NULL);
add_soap_fault(this_ptr, "Client", "encodingStyle cannot be specified on the Header", NULL, NULL, SOAP_GLOBAL(lang_en));
xmlFreeDoc(response);
return false;
} else if (strcmp((char*)attr->children->content, SOAP_1_1_ENC_NAMESPACE) != 0) {
add_soap_fault(this_ptr, "Client", "Unknown data encoding style", NULL, NULL);
add_soap_fault(this_ptr, "Client", "Unknown data encoding style", NULL, NULL, SOAP_GLOBAL(lang_en));
xmlFreeDoc(response);
return false;
}
@@ -177,6 +177,7 @@ bool parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunctio
fault = get_node_ex(body->children,"Fault",envelope_ns);
if (fault != NULL) {
char *faultcode = NULL;
zend_string *lang = ZSTR_EMPTY_ALLOC();
zend_string *faultstring = NULL, *faultactor = NULL;
zval details;
xmlNodePtr tmp;
@@ -219,13 +220,19 @@ bool parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunctio
tmp = get_node(fault->children,"Reason");
if (tmp != NULL && tmp->children != NULL) {
/* TODO: lang attribute */
tmp = get_node(tmp->children,"Text");
if (tmp != NULL && tmp->children != NULL) {
zval zv;
master_to_zval(&zv, get_conversion(IS_STRING), tmp);
convert_to_string(&zv)
faultstring = Z_STR(zv);
/* xml:lang is required by SOAP 1.2, but for BC reasons we allow it to be missing */
xmlAttrPtr lang_attr = get_attribute_ex(tmp->properties, "lang", (const char *) XML_XML_NAMESPACE);
if (lang_attr != NULL && lang_attr->children != NULL) {
const char *lang_str = (const char *) lang_attr->children->content;
lang = zend_string_init(lang_str, strlen(lang_str), false);
}
}
}
@@ -234,13 +241,14 @@ bool parse_packet_soap(zval *this_ptr, char *buffer, int buffer_size, sdlFunctio
master_to_zval(&details, NULL, tmp);
}
}
add_soap_fault(this_ptr, faultcode, faultstring ? ZSTR_VAL(faultstring) : NULL, faultactor ? ZSTR_VAL(faultactor) : NULL, &details);
add_soap_fault(this_ptr, faultcode, faultstring ? ZSTR_VAL(faultstring) : NULL, faultactor ? ZSTR_VAL(faultactor) : NULL, &details, lang);
if (faultstring) {
zend_string_release_ex(faultstring, 0);
}
if (faultactor) {
zend_string_release_ex(faultactor, 0);
}
zend_string_release_ex(lang, false);
if (Z_REFCOUNTED(details)) {
Z_DELREF(details);
}

View File

@@ -170,6 +170,7 @@ ZEND_BEGIN_MODULE_GLOBALS(soap)
HashTable wsdl_cache;
int cur_uniq_ref;
HashTable *ref_map;
zend_string *lang_en;
ZEND_END_MODULE_GLOBALS(soap)
#ifdef ZTS
@@ -194,7 +195,7 @@ extern zend_class_entry* soap_sdl_class_entry;
extern HashTable php_soap_defEncNs, php_soap_defEnc, php_soap_defEncIndex;
void add_soap_fault(zval *obj, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail);
void add_soap_fault(zval *obj, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail, zend_string *lang);
#define soap_error0(severity, format) \
php_error(severity, "SOAP-ERROR: " format)

View File

@@ -49,10 +49,13 @@ static void function_to_string(sdlFunctionPtr function, smart_str *buf);
static void type_to_string(sdlTypePtr type, smart_str *buf, int level);
static void clear_soap_fault(zval *obj);
static void set_soap_fault(zval *obj, const char *fault_code_ns, const char *fault_code, const char *fault_string, const char *fault_actor, zval *fault_detail, zend_string *name);
static void add_soap_fault_ex(zval *fault, zval *obj, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail);
static ZEND_NORETURN void soap_server_fault(char* code, char* string, char *actor, zval* details, zend_string *name);
static void set_soap_fault(zval *obj, const char *fault_code_ns, const char *fault_code, const char *fault_string, const char *fault_actor, zval *fault_detail, zend_string *name, zend_string *lang);
static void add_soap_fault_en(zval *obj, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail);
static void add_soap_fault_ex(zval *fault, zval *obj, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail, zend_string *lang);
static void add_soap_fault_ex_en(zval *fault, zval *obj, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail);
static ZEND_NORETURN void soap_server_fault(char* code, char* string, char *actor, zval* details, zend_string *name, zend_string *lang);
static void soap_server_fault_ex(sdlFunctionPtr function, zval* fault, soapHeader* hdr);
static ZEND_NORETURN void soap_server_fault_en(char* code, char* string, char *actor, zval* details, zend_string *name);
static sdlParamPtr get_param(sdlFunctionPtr function, const char *param_name, zend_ulong index, int);
static sdlFunctionPtr get_function(sdlPtr sdl, const char *function_name, size_t function_name_length);
@@ -156,6 +159,7 @@ static void soap_error_handler(int error_num, zend_string *error_filename, uint3
#define Z_FAULT_DETAIL_P(zv) php_soap_deref(OBJ_PROP_NUM(Z_OBJ_P(zv), FAULT_PROP_START_OFFSET + 4))
#define Z_FAULT_NAME_P(zv) php_soap_deref(OBJ_PROP_NUM(Z_OBJ_P(zv), FAULT_PROP_START_OFFSET + 5))
#define Z_FAULT_HEADERFAULT_P(zv) php_soap_deref(OBJ_PROP_NUM(Z_OBJ_P(zv), FAULT_PROP_START_OFFSET + 6))
#define Z_FAULT_LANG_P(zv) php_soap_deref(OBJ_PROP_NUM(Z_OBJ_P(zv), FAULT_PROP_START_OFFSET + 7))
#define FETCH_THIS_SERVICE_NO_BAILOUT(ss) \
{ \
@@ -448,6 +452,7 @@ static void php_soap_init_globals(zend_soap_globals *soap_globals)
soap_globals->soap_version = SOAP_1_1;
soap_globals->mem_cache = NULL;
soap_globals->ref_map = NULL;
soap_globals->lang_en = zend_string_init_interned(ZEND_STRL("en"), true);
}
PHP_MSHUTDOWN_FUNCTION(soap)
@@ -467,6 +472,7 @@ PHP_MSHUTDOWN_FUNCTION(soap)
zend_hash_destroy(SOAP_GLOBAL(mem_cache));
free(SOAP_GLOBAL(mem_cache));
}
zend_string_release_ex(SOAP_GLOBAL(lang_en), true);
UNREGISTER_INI_ENTRIES();
return SUCCESS;
}
@@ -645,6 +651,7 @@ static void soap_fault_dtor_properties(zval *obj)
zval_ptr_dtor(Z_FAULT_DETAIL_P(obj));
zval_ptr_dtor(Z_FAULT_NAME_P(obj));
zval_ptr_dtor(Z_FAULT_HEADERFAULT_P(obj));
zval_ptr_dtor(Z_FAULT_LANG_P(obj));
ZVAL_EMPTY_STRING(Z_FAULT_STRING_P(obj));
ZVAL_NULL(Z_FAULT_CODE_P(obj));
ZVAL_NULL(Z_FAULT_CODENS_P(obj));
@@ -652,6 +659,7 @@ static void soap_fault_dtor_properties(zval *obj)
ZVAL_NULL(Z_FAULT_DETAIL_P(obj));
ZVAL_NULL(Z_FAULT_NAME_P(obj));
ZVAL_NULL(Z_FAULT_HEADERFAULT_P(obj));
ZVAL_EMPTY_STRING(Z_FAULT_LANG_P(obj));
}
/* {{{ SoapFault constructor */
@@ -660,11 +668,12 @@ PHP_METHOD(SoapFault, __construct)
char *fault_string = NULL, *fault_code = NULL, *fault_actor = NULL, *fault_code_ns = NULL;
size_t fault_string_len, fault_actor_len = 0, fault_code_len = 0;
zend_string *name = NULL;
zend_string *lang = ZSTR_EMPTY_ALLOC();
zval *details = NULL, *headerfault = NULL, *this_ptr;
zend_string *code_str;
HashTable *code_ht;
ZEND_PARSE_PARAMETERS_START(2, 6)
ZEND_PARSE_PARAMETERS_START(2, 7)
Z_PARAM_ARRAY_HT_OR_STR_OR_NULL(code_ht, code_str)
Z_PARAM_STRING(fault_string, fault_string_len)
Z_PARAM_OPTIONAL
@@ -672,6 +681,7 @@ PHP_METHOD(SoapFault, __construct)
Z_PARAM_ZVAL_OR_NULL(details)
Z_PARAM_STR_OR_NULL(name)
Z_PARAM_ZVAL_OR_NULL(headerfault)
Z_PARAM_PATH_STR(lang)
ZEND_PARSE_PARAMETERS_END();
if (code_str) {
@@ -700,7 +710,7 @@ PHP_METHOD(SoapFault, __construct)
}
this_ptr = ZEND_THIS;
set_soap_fault(this_ptr, fault_code_ns, fault_code, fault_string, fault_actor, details, name);
set_soap_fault(this_ptr, fault_code_ns, fault_code, fault_string, fault_actor, details, name, lang);
if (headerfault != NULL) {
ZVAL_COPY(Z_FAULT_HEADERFAULT_P(this_ptr), headerfault);
}
@@ -1245,10 +1255,10 @@ static void _soap_server_exception(soapServicePtr service, sdlFunctionPtr functi
if (service->send_errors) {
zval rv;
zend_string *msg = zval_get_string(zend_read_property_ex(zend_ce_error, Z_OBJ(exception_object), ZSTR_KNOWN(ZEND_STR_MESSAGE), /* silent */ false, &rv));
add_soap_fault_ex(&exception_object, this_ptr, "Server", ZSTR_VAL(msg), NULL, NULL);
add_soap_fault_ex_en(&exception_object, this_ptr, "Server", ZSTR_VAL(msg), NULL, NULL);
zend_string_release_ex(msg, 0);
} else {
add_soap_fault_ex(&exception_object, this_ptr, "Server", "Internal Error", NULL, NULL);
add_soap_fault_ex_en(&exception_object, this_ptr, "Server", "Internal Error", NULL, NULL);
}
soap_server_fault_ex(function, &exception_object, NULL);
}
@@ -1288,7 +1298,7 @@ PHP_METHOD(SoapServer, handle)
SOAP_GLOBAL(soap_version) = service->version;
if (arg && ZEND_SIZE_T_INT_OVFL(arg_len)) {
soap_server_fault("Server", "Input string is too long", NULL, NULL, NULL);
soap_server_fault_en("Server", "Input string is too long", NULL, NULL, NULL);
SOAP_SERVER_END_CODE();
return;
}
@@ -1314,13 +1324,13 @@ PHP_METHOD(SoapServer, handle)
php_stream_passthru(stream);
php_stream_close(stream);
} else {
soap_server_fault("Server", "Couldn't find WSDL", NULL, NULL, NULL);
soap_server_fault_en("Server", "Couldn't find WSDL", NULL, NULL, NULL);
}
SOAP_SERVER_END_CODE();
return;
} else {
soap_server_fault("Server", "WSDL generation is not supported yet", NULL, NULL, NULL);
soap_server_fault_en("Server", "WSDL generation is not supported yet", NULL, NULL, NULL);
/*
sapi_add_header("Content-Type: text/xml; charset=utf-8", sizeof("Content-Type: text/xml; charset=utf-8"), 1);
PUTS("<?xml version=\"1.0\" ?>\n<definitions\n");
@@ -1393,7 +1403,7 @@ PHP_METHOD(SoapServer, handle)
}
if (doc_request == NULL) {
soap_server_fault("Client", "Bad Request", NULL, NULL, NULL);
soap_server_fault_en("Client", "Bad Request", NULL, NULL, NULL);
}
if (xmlGetIntSubset(doc_request) != NULL) {
xmlNodePtr env = get_node(doc_request->children,"Envelope");
@@ -1405,7 +1415,7 @@ PHP_METHOD(SoapServer, handle)
}
}
xmlFreeDoc(doc_request);
soap_server_fault("Server", "DTD are not supported by SOAP", NULL, NULL, NULL);
soap_server_fault_en("Server", "DTD are not supported by SOAP", NULL, NULL, NULL);
}
old_sdl = SOAP_GLOBAL(sdl);
@@ -1463,7 +1473,7 @@ PHP_METHOD(SoapServer, handle)
soap_obj = tmp_soap_p;
} else if (Z_OBJCE_P(tmp_soap_p) == php_ce_incomplete_class) {
/* See #51561, communicate limitation to user */
soap_server_fault("Server", "SoapServer class was deserialized from the session prior to loading the class passed to SoapServer::setClass(). Start the session after loading all classes to resolve this issue.", NULL, NULL, NULL);
soap_server_fault_en("Server", "SoapServer class was deserialized from the session prior to loading the class passed to SoapServer::setClass(). Start the session after loading all classes to resolve this issue.", NULL, NULL, NULL);
}
}
}
@@ -1522,7 +1532,7 @@ PHP_METHOD(SoapServer, handle)
#if 0
if (service->sdl && !h->function && !h->hdr) {
if (h->mustUnderstand) {
soap_server_fault("MustUnderstand","Header not understood", NULL, NULL, NULL);
soap_server_fault_en("MustUnderstand","Header not understood", NULL, NULL, NULL);
} else {
continue;
}
@@ -1553,7 +1563,7 @@ PHP_METHOD(SoapServer, handle)
goto fail;
}
} else if (h->mustUnderstand) {
soap_server_fault("MustUnderstand","Header not understood", NULL, NULL, NULL);
soap_server_fault_en("MustUnderstand","Header not understood", NULL, NULL, NULL);
}
}
}
@@ -1716,12 +1726,13 @@ PHP_METHOD(SoapServer, fault)
size_t code_len, string_len, actor_len = 0;
zval* details = NULL;
zend_string *name = NULL;
zend_string *lang = ZSTR_EMPTY_ALLOC();
soapServicePtr service;
xmlCharEncodingHandlerPtr old_encoding;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|szS",
if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|szSP",
&code, &code_len, &string, &string_len, &actor, &actor_len, &details,
&name) == FAILURE) {
&name, &lang) == FAILURE) {
RETURN_THROWS();
}
@@ -1730,7 +1741,7 @@ PHP_METHOD(SoapServer, fault)
old_encoding = SOAP_GLOBAL(encoding);
SOAP_GLOBAL(encoding) = service->encoding;
soap_server_fault(code, string, actor, details, name);
soap_server_fault(code, string, actor, details, name, lang);
SOAP_GLOBAL(encoding) = old_encoding;
SOAP_SERVER_END_CODE();
@@ -1826,18 +1837,23 @@ static void soap_server_fault_ex(sdlFunctionPtr function, zval* fault, soapHeade
}
/* }}} */
static ZEND_NORETURN void soap_server_fault(char* code, char* string, char *actor, zval* details, zend_string* name) /* {{{ */
static ZEND_NORETURN void soap_server_fault(char* code, char* string, char *actor, zval* details, zend_string* name, zend_string *lang) /* {{{ */
{
zval ret;
ZVAL_NULL(&ret);
set_soap_fault(&ret, NULL, code, string, actor, details, name);
set_soap_fault(&ret, NULL, code, string, actor, details, name, lang);
/* TODO: Which function */
soap_server_fault_ex(NULL, &ret, NULL);
zend_bailout();
}
/* }}} */
static ZEND_NORETURN void soap_server_fault_en(char* code, char* string, char *actor, zval* details, zend_string* name)
{
soap_server_fault(code, string, actor, details, name, SOAP_GLOBAL(lang_en));
}
static zend_never_inline ZEND_COLD void soap_real_error_handler(int error_num, zend_string *error_filename, const uint32_t error_lineno, zend_string *message) /* {{{ */
{
bool _old_in_compilation;
@@ -1861,7 +1877,7 @@ static zend_never_inline ZEND_COLD void soap_real_error_handler(int error_num, z
code = "Client";
}
add_soap_fault_ex(&fault, &SOAP_GLOBAL(error_object), code, ZSTR_VAL(message), NULL, NULL);
add_soap_fault_ex_en(&fault, &SOAP_GLOBAL(error_object), code, ZSTR_VAL(message), NULL, NULL);
Z_ADDREF(fault);
zend_throw_exception_object(&fault);
zend_bailout();
@@ -1904,7 +1920,7 @@ static zend_never_inline ZEND_COLD void soap_real_error_handler(int error_num, z
}
ZVAL_NULL(&fault_obj);
set_soap_fault(&fault_obj, NULL, code, ZSTR_VAL(buffer), NULL, &outbuf, NULL);
set_soap_fault(&fault_obj, NULL, code, ZSTR_VAL(buffer), NULL, &outbuf, NULL, SOAP_GLOBAL(lang_en));
zend_string_release(buffer);
fault = 1;
}
@@ -2215,7 +2231,7 @@ static bool do_request(zval *this_ptr, xmlDoc *request, const char *location, co
xmlDocDumpMemory(request, (xmlChar**)&buf, &buf_size);
if (!buf) {
add_soap_fault(this_ptr, "HTTP", "Error build soap request", NULL, NULL);
add_soap_fault_en(this_ptr, "HTTP", "Error build soap request", NULL, NULL);
return false;
}
@@ -2245,7 +2261,7 @@ static bool do_request(zval *this_ptr, xmlDoc *request, const char *location, co
if (EG(exception) && instanceof_function(EG(exception)->ce, zend_ce_error)) {
/* Programmer error in __doRequest() implementation, let it bubble up. */
} else if (Z_TYPE_P(Z_CLIENT_SOAP_FAULT_P(this_ptr)) != IS_OBJECT) {
add_soap_fault(this_ptr, "Client", "SoapClient::__doRequest() returned non string value", NULL, NULL);
add_soap_fault_en(this_ptr, "Client", "SoapClient::__doRequest() returned non string value", NULL, NULL);
}
ret = false;
} else if (Z_TYPE_P(trace) == IS_TRUE) {
@@ -2405,15 +2421,15 @@ static void do_soap_call(zend_execute_data *execute_data,
smart_str_append(&error,function);
smart_str_appends(&error,"\") is not a valid method for this service");
smart_str_0(&error);
add_soap_fault(this_ptr, "Client", ZSTR_VAL(error.s), NULL, NULL);
add_soap_fault_en(this_ptr, "Client", ZSTR_VAL(error.s), NULL, NULL);
smart_str_free(&error);
}
} else {
zval *uri = Z_CLIENT_URI_P(this_ptr);
if (Z_TYPE_P(uri) != IS_STRING) {
add_soap_fault(this_ptr, "Client", "Error finding \"uri\" property", NULL, NULL);
add_soap_fault_en(this_ptr, "Client", "Error finding \"uri\" property", NULL, NULL);
} else if (location == NULL) {
add_soap_fault(this_ptr, "Client", "Error could not find \"location\" property", NULL, NULL);
add_soap_fault_en(this_ptr, "Client", "Error could not find \"location\" property", NULL, NULL);
} else {
if (call_uri == NULL) {
call_uri = Z_STR_P(uri);
@@ -2450,7 +2466,7 @@ static void do_soap_call(zend_execute_data *execute_data,
if (Z_TYPE_P(fault) == IS_OBJECT) {
ZVAL_COPY(return_value, fault);
} else {
add_soap_fault_ex(return_value, this_ptr, "Client", "Unknown Error", NULL, NULL);
add_soap_fault_ex_en(return_value, this_ptr, "Client", "Unknown Error", NULL, NULL);
Z_ADDREF_P(return_value);
}
} else {
@@ -2898,10 +2914,10 @@ static void clear_soap_fault(zval *obj) /* {{{ */
}
/* }}} */
static void add_soap_fault_ex(zval *fault, zval *obj, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail) /* {{{ */
static void add_soap_fault_ex(zval *fault, zval *obj, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail, zend_string *lang) /* {{{ */
{
ZVAL_NULL(fault);
set_soap_fault(fault, NULL, fault_code, fault_string, fault_actor, fault_detail, NULL);
set_soap_fault(fault, NULL, fault_code, fault_string, fault_actor, fault_detail, NULL, lang);
zval *target;
if (instanceof_function(Z_OBJCE_P(obj), soap_class_entry)) {
target = Z_CLIENT_SOAP_FAULT_P(obj);
@@ -2915,14 +2931,24 @@ static void add_soap_fault_ex(zval *fault, zval *obj, char *fault_code, char *fa
}
/* }}} */
void add_soap_fault(zval *obj, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail) /* {{{ */
static void add_soap_fault_ex_en(zval *fault, zval *obj, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail)
{
add_soap_fault_ex(fault, obj, fault_code, fault_string, fault_actor, fault_detail, SOAP_GLOBAL(lang_en));
}
void add_soap_fault(zval *obj, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail, zend_string *lang) /* {{{ */
{
zval fault;
add_soap_fault_ex(&fault, obj, fault_code, fault_string, fault_actor, fault_detail);
add_soap_fault_ex(&fault, obj, fault_code, fault_string, fault_actor, fault_detail, lang);
}
/* }}} */
static void set_soap_fault(zval *obj, const char *fault_code_ns, const char *fault_code, const char *fault_string, const char *fault_actor, zval *fault_detail, zend_string *name) /* {{{ */
static void add_soap_fault_en(zval *obj, char *fault_code, char *fault_string, char *fault_actor, zval *fault_detail)
{
add_soap_fault(obj, fault_code, fault_string, fault_actor, fault_detail, SOAP_GLOBAL(lang_en));
}
static void set_soap_fault(zval *obj, const char *fault_code_ns, const char *fault_code, const char *fault_string, const char *fault_actor, zval *fault_detail, zend_string *name, zend_string *lang) /* {{{ */
{
if (Z_TYPE_P(obj) != IS_OBJECT) {
object_init_ex(obj, soap_fault_class_entry);
@@ -2973,6 +2999,7 @@ static void set_soap_fault(zval *obj, const char *fault_code_ns, const char *fau
if (name != NULL) {
ZVAL_STR_COPY(Z_FAULT_NAME_P(obj), name);
}
ZVAL_STR_COPY(Z_FAULT_LANG_P(obj), lang);
}
/* }}} */
@@ -3043,7 +3070,7 @@ static void deserialize_parameters(xmlNodePtr params, sdlFunctionPtr function, u
sdlParamPtr param = NULL;
if (function != NULL &&
(param = zend_hash_index_find_ptr(function->requestParameters, cur_param)) == NULL) {
soap_server_fault("Client", "Error cannot find parameter", NULL, NULL, NULL);
soap_server_fault_en("Client", "Error cannot find parameter", NULL, NULL, NULL);
}
if (param == NULL) {
enc = NULL;
@@ -3058,7 +3085,7 @@ static void deserialize_parameters(xmlNodePtr params, sdlFunctionPtr function, u
}
}
if (num_of_params > cur_param) {
soap_server_fault("Client","Missing parameter", NULL, NULL, NULL);
soap_server_fault_en("Client","Missing parameter", NULL, NULL, NULL);
}
(*parameters) = tmp_parameters;
(*num_params) = num_of_params;
@@ -3145,7 +3172,7 @@ static xmlNodePtr get_envelope(xmlNodePtr trav, int *version, char **envelope_ns
return trav;
}
soap_server_fault("VersionMismatch", "Wrong Version", NULL, NULL, NULL);
soap_server_fault_en("VersionMismatch", "Wrong Version", NULL, NULL, NULL);
}
trav = trav->next;
}
@@ -3165,18 +3192,18 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c
/* Get <Envelope> element */
env = get_envelope(request->children, version, &envelope_ns);
if (!env) {
soap_server_fault("Client", "looks like we got XML without \"Envelope\" element", NULL, NULL, NULL);
soap_server_fault_en("Client", "looks like we got XML without \"Envelope\" element", NULL, NULL, NULL);
}
attr = env->properties;
while (attr != NULL) {
if (attr->ns == NULL) {
soap_server_fault("Client", "A SOAP Envelope element cannot have non Namespace qualified attributes", NULL, NULL, NULL);
soap_server_fault_en("Client", "A SOAP Envelope element cannot have non Namespace qualified attributes", NULL, NULL, NULL);
} else if (attr_is_equal_ex(attr,"encodingStyle",SOAP_1_2_ENV_NAMESPACE)) {
if (*version == SOAP_1_2) {
soap_server_fault("Client", "encodingStyle cannot be specified on the Envelope", NULL, NULL, NULL);
soap_server_fault_en("Client", "encodingStyle cannot be specified on the Envelope", NULL, NULL, NULL);
} else if (strcmp((char*)attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) {
soap_server_fault("Client", "Unknown data encoding style", NULL, NULL, NULL);
soap_server_fault_en("Client", "Unknown data encoding style", NULL, NULL, NULL);
}
}
attr = attr->next;
@@ -3206,26 +3233,26 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c
trav = trav->next;
}
if (body == NULL) {
soap_server_fault("Client", "Body must be present in a SOAP envelope", NULL, NULL, NULL);
soap_server_fault_en("Client", "Body must be present in a SOAP envelope", NULL, NULL, NULL);
}
attr = body->properties;
while (attr != NULL) {
if (attr->ns == NULL) {
if (*version == SOAP_1_2) {
soap_server_fault("Client", "A SOAP Body element cannot have non Namespace qualified attributes", NULL, NULL, NULL);
soap_server_fault_en("Client", "A SOAP Body element cannot have non Namespace qualified attributes", NULL, NULL, NULL);
}
} else if (attr_is_equal_ex(attr,"encodingStyle",SOAP_1_2_ENV_NAMESPACE)) {
if (*version == SOAP_1_2) {
soap_server_fault("Client", "encodingStyle cannot be specified on the Body", NULL, NULL, NULL);
soap_server_fault_en("Client", "encodingStyle cannot be specified on the Body", NULL, NULL, NULL);
} else if (strcmp((char*)attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) {
soap_server_fault("Client", "Unknown data encoding style", NULL, NULL, NULL);
soap_server_fault_en("Client", "Unknown data encoding style", NULL, NULL, NULL);
}
}
attr = attr->next;
}
if (trav != NULL && *version == SOAP_1_2) {
soap_server_fault("Client", "A SOAP 1.2 envelope can contain only Header and Body", NULL, NULL, NULL);
soap_server_fault_en("Client", "A SOAP 1.2 envelope can contain only Header and Body", NULL, NULL, NULL);
}
func = NULL;
@@ -3234,7 +3261,7 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c
if (trav->type == XML_ELEMENT_NODE) {
/*
if (func != NULL) {
soap_server_fault("Client", "looks like we got \"Body\" with several functions call", NULL, NULL, NULL);
soap_server_fault_en("Client", "looks like we got \"Body\" with several functions call", NULL, NULL, NULL);
}
*/
func = trav;
@@ -3251,19 +3278,19 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c
if (function) {
ZVAL_STRING(function_name, (char *)function->functionName);
} else {
soap_server_fault("Client", "looks like we got \"Body\" without function call", NULL, NULL, NULL);
soap_server_fault_en("Client", "looks like we got \"Body\" without function call", NULL, NULL, NULL);
}
}
} else {
if (*version == SOAP_1_1) {
attr = get_attribute_ex(func->properties,"encodingStyle",SOAP_1_1_ENV_NAMESPACE);
if (attr && strcmp((char*)attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) {
soap_server_fault("Client","Unknown Data Encoding Style", NULL, NULL, NULL);
soap_server_fault_en("Client","Unknown Data Encoding Style", NULL, NULL, NULL);
}
} else {
attr = get_attribute_ex(func->properties,"encodingStyle",SOAP_1_2_ENV_NAMESPACE);
if (attr && strcmp((char*)attr->children->content,SOAP_1_2_ENC_NAMESPACE) != 0) {
soap_server_fault("DataEncodingUnknown","Unknown Data Encoding Style", NULL, NULL, NULL);
soap_server_fault_en("DataEncodingUnknown","Unknown Data Encoding Style", NULL, NULL, NULL);
}
}
if (!function) {
@@ -3271,7 +3298,7 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c
}
if (sdl != NULL && function == NULL) {
if (*version == SOAP_1_2) {
soap_server_fault("rpc:ProcedureNotPresent","Procedure not present", NULL, NULL, NULL);
soap_server_fault_en("rpc:ProcedureNotPresent","Procedure not present", NULL, NULL, NULL);
} else {
php_error(E_ERROR, "Procedure '%s' not present", func->name);
}
@@ -3285,12 +3312,12 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c
attr = head->properties;
while (attr != NULL) {
if (attr->ns == NULL) {
soap_server_fault("Client", "A SOAP Header element cannot have non Namespace qualified attributes", NULL, NULL, NULL);
soap_server_fault_en("Client", "A SOAP Header element cannot have non Namespace qualified attributes", NULL, NULL, NULL);
} else if (attr_is_equal_ex(attr,"encodingStyle",SOAP_1_2_ENV_NAMESPACE)) {
if (*version == SOAP_1_2) {
soap_server_fault("Client", "encodingStyle cannot be specified on the Header", NULL, NULL, NULL);
soap_server_fault_en("Client", "encodingStyle cannot be specified on the Header", NULL, NULL, NULL);
} else if (strcmp((char*)attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) {
soap_server_fault("Client", "Unknown data encoding style", NULL, NULL, NULL);
soap_server_fault_en("Client", "Unknown data encoding style", NULL, NULL, NULL);
}
}
attr = attr->next;
@@ -3304,7 +3331,7 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c
if (*version == SOAP_1_1) {
attr = get_attribute_ex(hdr_func->properties,"encodingStyle",SOAP_1_1_ENV_NAMESPACE);
if (attr && strcmp((char*)attr->children->content,SOAP_1_1_ENC_NAMESPACE) != 0) {
soap_server_fault("Client","Unknown Data Encoding Style", NULL, NULL, NULL);
soap_server_fault_en("Client","Unknown Data Encoding Style", NULL, NULL, NULL);
}
attr = get_attribute_ex(hdr_func->properties,"actor",envelope_ns);
if (attr != NULL) {
@@ -3316,7 +3343,7 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c
} else if (*version == SOAP_1_2) {
attr = get_attribute_ex(hdr_func->properties,"encodingStyle",SOAP_1_2_ENV_NAMESPACE);
if (attr && strcmp((char*)attr->children->content,SOAP_1_2_ENC_NAMESPACE) != 0) {
soap_server_fault("DataEncodingUnknown","Unknown Data Encoding Style", NULL, NULL, NULL);
soap_server_fault_en("DataEncodingUnknown","Unknown Data Encoding Style", NULL, NULL, NULL);
}
attr = get_attribute_ex(hdr_func->properties,"role",envelope_ns);
if (attr != NULL) {
@@ -3336,7 +3363,7 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c
strcmp((char*)attr->children->content,"false") == 0) {
mustUnderstand = 0;
} else {
soap_server_fault("Client","mustUnderstand value is not boolean", NULL, NULL, NULL);
soap_server_fault_en("Client","mustUnderstand value is not boolean", NULL, NULL, NULL);
}
}
h = emalloc(sizeof(soapHeader));
@@ -3565,7 +3592,7 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, const char *fu
ns = xmlNewNs(envelope, BAD_CAST(SOAP_1_2_ENV_NAMESPACE), BAD_CAST(SOAP_1_2_ENV_NS_PREFIX));
xmlSetNs(envelope,ns);
} else {
soap_server_fault("Server", "Unknown SOAP version", NULL, NULL, NULL);
soap_server_fault_en("Server", "Unknown SOAP version", NULL, NULL, NULL);
}
xmlDocSetRootElement(doc, envelope);
@@ -3734,6 +3761,11 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function, const char *fu
node = master_to_xml(get_conversion(IS_STRING), tmp, SOAP_LITERAL, node);
xmlNodeSetName(node, BAD_CAST("Text"));
xmlSetNs(node, ns);
/* xml:lang attribute is required for <Reason> in SOAP 1.2 */
tmp = Z_FAULT_LANG_P(ret);
zend_string *lang = Z_STR_P(tmp);
xmlNodeSetLang(node, BAD_CAST ZSTR_VAL(lang));
}
detail_name = SOAP_1_2_ENV_NS_PREFIX":Detail";
}

View File

@@ -477,8 +477,9 @@ namespace {
public mixed $detail = null;
public ?string $_name = null;
public mixed $headerfault = null;
public string $lang = "";
public function __construct(array|string|null $code, string $string, ?string $actor = null, mixed $details = null, ?string $name = null, mixed $headerFault = null) {}
public function __construct(array|string|null $code, string $string, ?string $actor = null, mixed $details = null, ?string $name = null, mixed $headerFault = null, string $lang = "") {}
public function __toString(): string {}
}
@@ -502,7 +503,7 @@ namespace {
public function __construct(?string $wsdl, array $options = []) {}
/** @tentative-return-type */
public function fault(string $code, string $string, string $actor = "", mixed $details = null, string $name = ""): void {}
public function fault(string $code, string $string, string $actor = "", mixed $details = null, string $name = "", string $lang = ""): void {}
/** @tentative-return-type */
public function addSoapHeader(SoapHeader $header): void {}

View File

@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 7712aba90b16090fbe7c124c1e3f26b2cc3e2ab2 */
* Stub hash: 78a27b18c6b4007494a6aed9acc5f6e99c6f0350 */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_use_soap_error_handler, 0, 0, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, enable, _IS_BOOL, 0, "true")
@@ -29,6 +29,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_SoapFault___construct, 0, 0, 2)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, details, IS_MIXED, 0, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, name, IS_STRING, 1, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, headerFault, IS_MIXED, 0, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, lang, IS_STRING, 0, "\"\"")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_SoapFault___toString, 0, 0, IS_STRING, 0)
@@ -54,6 +55,7 @@ ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SoapServer_fault
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, actor, IS_STRING, 0, "\"\"")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, details, IS_MIXED, 0, "null")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, name, IS_STRING, 0, "\"\"")
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, lang, IS_STRING, 0, "\"\"")
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_SoapServer_addSoapHeader, 0, 1, IS_VOID, 0)
@@ -444,6 +446,12 @@ static zend_class_entry *register_class_SoapFault(zend_class_entry *class_entry_
zend_declare_typed_property(class_entry, property_headerfault_name, &property_headerfault_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_ANY));
zend_string_release(property_headerfault_name);
zval property_lang_default_value;
ZVAL_EMPTY_STRING(&property_lang_default_value);
zend_string *property_lang_name = zend_string_init("lang", sizeof("lang") - 1, 1);
zend_declare_typed_property(class_entry, property_lang_name, &property_lang_default_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_STRING));
zend_string_release(property_lang_name);
return class_entry;
}

View File

@@ -42,4 +42,4 @@ echo($client->__getLastResponse());
--EXPECT--
This is our fault: Ä
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>Test</env:Value></env:Code><env:Reason><env:Text>This is our fault: Ä</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>Test</env:Value></env:Code><env:Reason><env:Text xml:lang="">This is our fault: Ä</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>

View File

@@ -56,4 +56,4 @@ handleFormatted($s, $HTTP_RAW_POST_DATA);
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode/><faultstring>some msg</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value/></env:Code><env:Reason><env:Text>some msg</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value/></env:Code><env:Reason><env:Text xml:lang="">some msg</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>

View File

@@ -109,12 +109,13 @@ HDRS;
$out .= fread($fp, 1024);
}
$pos = strpos($out, "<env:Text>");
$marker = '<env:Text xml:lang="en">';
$pos = strpos($out, $marker);
if (false === $pos) {
echo $out;
goto cleanup;
}
$pos0 = $pos + strlen("<env:Text>");
$pos0 = $pos + strlen($marker);
$pos = strpos($out, "</env:Text>");
if (false === $pos) {
echo $out;

View File

@@ -0,0 +1,29 @@
--TEST--
SOAP Server: user fault with language
--EXTENSIONS--
soap
--FILE--
<?php
function test() {
global $server;
$server->fault("MyFault", "My fault string", lang: "custom");
}
$server = new SoapServer(null, ['uri' => 'http://testuri.org', 'soap_version' => SOAP_1_2]);
$server->addFunction("test");
$HTTP_RAW_POST_DATA = <<<EOF
<?xml version="1.0" encoding="ISO-8859-1"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope">
<SOAP-ENV:Body>
<ns1:test xmlns:ns1="http://testuri.org"/>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
EOF;
$server->handle($HTTP_RAW_POST_DATA);
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>MyFault</env:Value></env:Code><env:Reason><env:Text xml:lang="custom">My fault string</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>

View File

@@ -20,4 +20,4 @@ include "soap12-test.inc";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:MustUnderstand</env:Value></env:Code><env:Reason><env:Text>Header not understood</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:MustUnderstand</env:Value></env:Code><env:Reason><env:Text xml:lang="en">Header not understood</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>

View File

@@ -20,4 +20,4 @@ include "soap12-test.inc";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:MustUnderstand</env:Value></env:Code><env:Reason><env:Text>Header not understood</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:MustUnderstand</env:Value></env:Code><env:Reason><env:Text xml:lang="en">Header not understood</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>

View File

@@ -20,4 +20,4 @@ include "soap12-test.inc";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Sender</env:Value></env:Code><env:Reason><env:Text>mustUnderstand value is not boolean</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Sender</env:Value></env:Code><env:Reason><env:Text xml:lang="en">mustUnderstand value is not boolean</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>

View File

@@ -21,4 +21,4 @@ include "soap12-test.inc";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Sender</env:Value></env:Code><env:Reason><env:Text>mustUnderstand value is not boolean</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Sender</env:Value></env:Code><env:Reason><env:Text xml:lang="en">mustUnderstand value is not boolean</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>

View File

@@ -18,4 +18,4 @@ include "soap12-test.inc";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:VersionMismatch</env:Value></env:Code><env:Reason><env:Text>Wrong Version</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:VersionMismatch</env:Value></env:Code><env:Reason><env:Text xml:lang="en">Wrong Version</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>

View File

@@ -19,4 +19,4 @@ include "soap12-test.inc";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Receiver</env:Value></env:Code><env:Reason><env:Text>DTD are not supported by SOAP</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Receiver</env:Value></env:Code><env:Reason><env:Text xml:lang="en">DTD are not supported by SOAP</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>

View File

@@ -25,4 +25,4 @@ include "soap12-test.inc";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Receiver</env:Value></env:Code><env:Reason><env:Text>SOAP-ERROR: Encoding: Violation of encoding rules</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Receiver</env:Value></env:Code><env:Reason><env:Text xml:lang="en">SOAP-ERROR: Encoding: Violation of encoding rules</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>

View File

@@ -18,4 +18,4 @@ include "soap12-test.inc";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Sender</env:Value></env:Code><env:Reason><env:Text>encodingStyle cannot be specified on the Body</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Sender</env:Value></env:Code><env:Reason><env:Text xml:lang="en">encodingStyle cannot be specified on the Body</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>

View File

@@ -17,4 +17,4 @@ include "soap12-test.inc";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>rpc:ProcedureNotPresent</env:Value></env:Code><env:Reason><env:Text>Procedure not present</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>rpc:ProcedureNotPresent</env:Value></env:Code><env:Reason><env:Text xml:lang="en">Procedure not present</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>

View File

@@ -21,4 +21,4 @@ include "soap12-test.inc";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:MustUnderstand</env:Value></env:Code><env:Reason><env:Text>Header not understood</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:MustUnderstand</env:Value></env:Code><env:Reason><env:Text xml:lang="en">Header not understood</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>

View File

@@ -20,4 +20,4 @@ include "soap12-test.inc";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:MustUnderstand</env:Value></env:Code><env:Reason><env:Text>Header not understood</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:MustUnderstand</env:Value></env:Code><env:Reason><env:Text xml:lang="en">Header not understood</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>

View File

@@ -19,4 +19,4 @@ include "soap12-test.inc";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Sender</env:Value></env:Code><env:Reason><env:Text>mustUnderstand value is not boolean</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Sender</env:Value></env:Code><env:Reason><env:Text xml:lang="en">mustUnderstand value is not boolean</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>

View File

@@ -30,4 +30,4 @@ include "soap12-test.inc";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Receiver</env:Value></env:Code><env:Reason><env:Text>SOAP-ERROR: Encoding: Unresolved reference '#data-2'</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Receiver</env:Value></env:Code><env:Reason><env:Text xml:lang="en">SOAP-ERROR: Encoding: Unresolved reference '#data-2'</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>

View File

@@ -24,4 +24,4 @@ include "soap12-test.inc";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Receiver</env:Value></env:Code><env:Reason><env:Text>SOAP-ERROR: Encoding: Violation of encoding rules</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Receiver</env:Value></env:Code><env:Reason><env:Text xml:lang="en">SOAP-ERROR: Encoding: Violation of encoding rules</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>

View File

@@ -25,4 +25,4 @@ include "soap12-test.inc";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Receiver</env:Value></env:Code><env:Reason><env:Text>SOAP-ERROR: Encoding: Violation of id and ref information items '#data'</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Receiver</env:Value></env:Code><env:Reason><env:Text xml:lang="en">SOAP-ERROR: Encoding: Violation of id and ref information items '#data'</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>

View File

@@ -25,4 +25,4 @@ include "soap12-test.inc";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Receiver</env:Value></env:Code><env:Reason><env:Text>SOAP-ERROR: Encoding: '*' may only be first arraySize value in list</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Receiver</env:Value></env:Code><env:Reason><env:Text xml:lang="en">SOAP-ERROR: Encoding: '*' may only be first arraySize value in list</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>

View File

@@ -21,5 +21,5 @@ include "soap12-test.inc";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests"><env:Header><ns1:validateCountryCodeFault>Country code must be 2 letters.</ns1:validateCountryCodeFault></env:Header><env:Body><env:Fault><env:Code><env:Value>env:Sender</env:Value></env:Code><env:Reason><env:Text>Not a valid country code</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests"><env:Header><ns1:validateCountryCodeFault>Country code must be 2 letters.</ns1:validateCountryCodeFault></env:Header><env:Body><env:Fault><env:Code><env:Value>env:Sender</env:Value></env:Code><env:Reason><env:Text xml:lang="">Not a valid country code</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
ok

View File

@@ -21,4 +21,4 @@ include "soap12-test.inc";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Receiver</env:Value></env:Code><env:Reason><env:Text>DTD are not supported by SOAP</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Receiver</env:Value></env:Code><env:Reason><env:Text xml:lang="en">DTD are not supported by SOAP</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>

View File

@@ -23,4 +23,4 @@ include "soap12-test.inc";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Receiver</env:Value></env:Code><env:Reason><env:Text>DTD are not supported by SOAP</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Receiver</env:Value></env:Code><env:Reason><env:Text xml:lang="en">DTD are not supported by SOAP</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>

View File

@@ -16,4 +16,4 @@ include "soap12-test.inc";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Sender</env:Value></env:Code><env:Reason><env:Text>Body must be present in a SOAP envelope</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Sender</env:Value></env:Code><env:Reason><env:Text xml:lang="en">Body must be present in a SOAP envelope</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>

View File

@@ -20,4 +20,4 @@ include "soap12-test.inc";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Sender</env:Value></env:Code><env:Reason><env:Text>A SOAP 1.2 envelope can contain only Header and Body</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Sender</env:Value></env:Code><env:Reason><env:Text xml:lang="en">A SOAP 1.2 envelope can contain only Header and Body</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>

View File

@@ -21,4 +21,4 @@ include "soap12-test.inc";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Sender</env:Value></env:Code><env:Reason><env:Text>A SOAP Envelope element cannot have non Namespace qualified attributes</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Sender</env:Value></env:Code><env:Reason><env:Text xml:lang="en">A SOAP Envelope element cannot have non Namespace qualified attributes</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>

View File

@@ -19,4 +19,4 @@ include "soap12-test.inc";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Sender</env:Value></env:Code><env:Reason><env:Text>encodingStyle cannot be specified on the Envelope</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:Sender</env:Value></env:Code><env:Reason><env:Text xml:lang="en">encodingStyle cannot be specified on the Envelope</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>

View File

@@ -16,4 +16,4 @@ include "soap12-test.inc";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:DataEncodingUnknown</env:Value></env:Code><env:Reason><env:Text>Unknown Data Encoding Style</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"><env:Body><env:Fault><env:Code><env:Value>env:DataEncodingUnknown</env:Value></env:Code><env:Reason><env:Text xml:lang="en">Unknown Data Encoding Style</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>