]> granicus.if.org Git - php/commitdiff
Proper handling of SOAPAction in SOAP 1.1 and SOAP 1.2
authorDmitry Stogov <dmitry@php.net>
Tue, 27 Jan 2004 06:54:14 +0000 (06:54 +0000)
committerDmitry Stogov <dmitry@php.net>
Tue, 27 Jan 2004 06:54:14 +0000 (06:54 +0000)
ext/soap/php_http.c

index c7254e4280548e3d5aaecf20b19967f1b9184582..73c72e661b3ffebc3f4c0647d030251bf1e4e8eb 100644 (file)
@@ -132,16 +132,21 @@ int send_http_soap_request(zval *this_ptr, xmlDoc *doc, char *location, char *so
 */
                        "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");
+                       smart_str_append_const(&soap_headers,"Content-Type: application/soap+xml; charset=\"utf-8");
+                       if (soapaction) {
+                               smart_str_append_const(&soap_headers,"\"; action=\"");
+                               smart_str_appends(&soap_headers, soapaction);
+                       }
+                       smart_str_append_const(&soap_headers,"\"\r\n");
                } else {
                        smart_str_append_const(&soap_headers,"Content-Type: text/xml; charset=\"utf-8\"\r\n");
+                       smart_str_append_const(&soap_headers, "SOAPAction: \"");
+                       smart_str_appends(&soap_headers, soapaction);
+                       smart_str_append_const(&soap_headers, "\"\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: \"");
-               smart_str_appends(&soap_headers, soapaction);
-               smart_str_append_const(&soap_headers, "\"\r\n");
+               smart_str_append_const(&soap_headers, "\r\n");
 
                /* HTTP Authentication */
                if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_login", sizeof("_login"), (void **)&login) == SUCCESS) {