summaryrefslogtreecommitdiff
path: root/ext/soap/php_http.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2004-01-15 08:38:14 +0000
committerDmitry Stogov <dmitry@php.net>2004-01-15 08:38:14 +0000
commitfb52edb19492c7e2a63c6013eee1095bcbfd8789 (patch)
tree284d2c6e859ae090f524383f3cb28337ce3b6255 /ext/soap/php_http.c
parentad11617f293441db4870e19255dc25f348163904 (diff)
downloadphp-git-fb52edb19492c7e2a63c6013eee1095bcbfd8789.tar.gz
SOAP 1.2 support was improved
Diffstat (limited to 'ext/soap/php_http.c')
-rw-r--r--ext/soap/php_http.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c
index 0716597495..ca81f6de06 100644
--- a/ext/soap/php_http.c
+++ b/ext/soap/php_http.c
@@ -8,7 +8,7 @@ static int get_http_headers(php_stream *socketd,char **response, int *out_size T
#define smart_str_append_const(str, const) \
smart_str_appendl(str,const,sizeof(const)-1)
-int send_http_soap_request(zval *this_ptr, xmlDoc *doc, char *location, char *soapaction TSRMLS_DC)
+int send_http_soap_request(zval *this_ptr, xmlDoc *doc, char *location, char *soapaction, int soap_version TSRMLS_DC)
{
xmlChar *buf;
smart_str soap_headers = {0};
@@ -130,9 +130,13 @@ int send_http_soap_request(zval *this_ptr, xmlDoc *doc, char *location, char *so
"Connection: close\r\n"
"Accept: text/html; text/xml; text/plain\r\n"
*/
- "User-Agent: PHP SOAP 0.1\r\n"
- "Content-Type: text/xml; charset=\"utf-8\"\r\n"
- "Content-Length: ");
+ "User-Agent: PHP SOAP 0.1\r\n");
+ if (soap_version == SOAP_1_2) {
+ smart_str_append_const(&soap_headers,"Content-Type: application/soap+xml; charset=\"utf-8\"\r\n");
+ } else {
+ smart_str_append_const(&soap_headers,"Content-Type: text/xml; charset=\"utf-8\"\r\n");
+ }
+ smart_str_append_const(&soap_headers,"Content-Length: ");
smart_str_append_long(&soap_headers, buf_size);
smart_str_append_const(&soap_headers, "\r\n"
"SOAPAction: \"");