value == SOAP_PERSISTENCE_REQUEST) {
service->soap_class.persistance = value;
} else {
- php_error(E_ERROR, "Tried to set persistence with bogus value (%d)", value);
+ php_error(E_ERROR, "Tried to set persistence with bogus value (%ld)", value);
}
} else {
php_error(E_ERROR, "Tried to set persistence when you are using you SOAP SERVER in function mode, no persistence needed");
doc_request = soap_xmlParseMemory(Z_STRVAL_PP(raw_post),Z_STRLEN_PP(raw_post));
}
} else {
- if (!zend_ini_long("always_populate_raw_post_data", sizeof("always_populate_raw_post_data"), 0)) {
- php_error(E_ERROR, "PHP-SOAP requires 'always_populate_raw_post_data' to be on please check your php.ini file");
+ if (zend_hash_find(&EG(symbol_table), "_SERVER", sizeof("_SERVER"), (void **)&server_vars) == SUCCESS) {
+ zval **req_method;
+ if (zend_hash_find(Z_ARRVAL_PP(server_vars), "REQUEST_METHOD", sizeof("REQUEST_METHOD"), (void **)&req_method) == SUCCESS) {
+ if (!strcmp(Z_STRVAL_PP(req_method), "POST")) {
+ if (!zend_ini_long("always_populate_raw_post_data", sizeof("always_populate_raw_post_data"), 0)) {
+ php_error(E_ERROR, "PHP-SOAP requires 'always_populate_raw_post_data' to be on please check your php.ini file");
+ }
+ }
+ }
}
- php_error(E_ERROR, "Can't find HTTP_RAW_POST_DATA");
+ php_error(E_ERROR, "Bad Request. Can't find HTTP_RAW_POST_DATA");
return;
}
} else {