http_close = TRUE;
connection = get_http_header_value(http_headers,"Connection: ");
if (connection) {
- if (!strcmp(connection, "Keep-Alive")) {
+ if (strncasecmp(connection, "Keep-Alive", sizeof("Keep-Alive")-1) == 0) {
http_close = FALSE;
}
efree(connection);
cmplen = strlen(content_type);
}
- if (strncmp(content_type, "text/xml", cmplen)) {
+ if (strncmp(content_type, "text/xml", cmplen) == 0 ||
+ strncmp(content_type, "application/soap+xml", cmplen == 0)) {
if (strncmp(http_body, "<?xml", 5)) {
zval *err;
MAKE_STD_ZVAL(err);
xmlDocPtr response;
xmlNodePtr trav, env, head, body, resp, cur, fault;
int param_count = 0;
+ int old_error_reporting;
ZVAL_NULL(return_value);
+ old_error_reporting = EG(error_reporting);
+ EG(error_reporting) &= ~(E_WARNING|E_NOTICE|E_USER_WARNING|E_USER_NOTICE);
+
/* Parse XML packet */
response = xmlParseMemory(buffer, buffer_size);
xmlCleanupParser();
+
+ EG(error_reporting) = old_error_reporting;
+
if (!response) {
add_soap_fault(this_ptr, "SOAP-ENV:Client", "looks like we got no XML document", NULL, NULL TSRMLS_CC);
return FALSE;
xmlDocPtr wsdl;
xmlNodePtr root, definitions, trav;
xmlAttrPtr targetNamespace;
+ int old_error_reporting;
/* TODO: WSDL Caching */
+ old_error_reporting = EG(error_reporting);
+ EG(error_reporting) &= ~(E_WARNING|E_NOTICE|E_USER_WARNING|E_USER_NOTICE);
+
wsdl = xmlParseFile(struri);
xmlCleanupParser();
+ EG(error_reporting) = old_error_reporting;
+
+
if (!wsdl) {
php_error(E_ERROR, "SOAP-ERROR: Parsing WSDL: Couldn't load from %s", struri);
}
if (zend_hash_find(&EG(symbol_table), HTTP_RAW_POST_DATA, sizeof(HTTP_RAW_POST_DATA), (void **) &raw_post)!=FAILURE
&& ((*raw_post)->type==IS_STRING)) {
+ int old_error_reporting = EG(error_reporting);
+ EG(error_reporting) &= ~(E_WARNING|E_NOTICE|E_USER_WARNING|E_USER_NOTICE);
+
doc_request = xmlParseMemory(Z_STRVAL_PP(raw_post),Z_STRLEN_PP(raw_post));
xmlCleanupParser();
+ EG(error_reporting) = old_error_reporting;
+
if (doc_request == NULL) {
php_error(E_ERROR, "Bad Request");
}