PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Web Services » SOAP » Bug #5003

Client: incoming headers mix with outgoing

Details

Submitted2005-08-05 09:12 UTC
Fromlaihro at gmx dot de
Assignedyunosh
StatusClosed
PackageSOAP
PHP Version4.3.11
OSWidows XP SP2
Roadmaps(Not assigned)

Comments

[2005-08-05 09:12 UTC] laihro at gmx dot de

Description:
------------
The http headers are in pear::soap 0.9.1 not properly cleaned between the sending of two messages. If the client receives a message witch headers differ from the next message the client sends, both header sets will be mixed. This behaviour occurs for example when the client recieved an attachment and then tries to send a message without attachments.
This problem may produce http errors like "Error 413 Request entity too large".

Test script:
---------------
[server]
<?php
if (strpos($HTTP_RAW_POST_DATA, "attachTest") === false) {
} else {
$response = "------=_Part_13_18150163.1123064466959\nContent-Type: text/xml; charset=UTF-8\nContent-Transfer-Encoding: binary\nContent-Id: <E499622513F9AA87E77E75F8A2F73498>\n\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n<soapenv:Body>\n<ns1:getZippedCourseResponse soapenv:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:ns1=\"urn:WWRInterface\">\n<ns1:getZippedCourseReturn xsi:type=\"ns2:instance\" xmlns:ns2=\"WWREncoding\">\n<ns1:dataHandler href=\"cid:C8EFC5F183DA5492B74666A49D7603B4\" xmlns:ns3=\"http://xml.apache.org/xml-soap\"/>\n</ns1:getZippedCourseReturn>\n</ns1:getZippedCourseResponse>\n</soapenv:Body>\n</soapenv:Envelope>\n------=_Part_13_18150163.1123064466959\nContent-Type: text/xml\nContent-Transfer-Encoding: binary\nContent-Id: <C8EFC5F183DA5492B74666A49D7603B4>\n\nTEST\n------=_Part_13_18150163.1123064466959--\n";
header("Content-Type: multipart/related; type=\"text/xml\"; start=\"<E499622513F9AA87E77E75F8A2F73498>\"; boundary=\"----=_Part_13_18150163.1123064466959\"");
print $response;
}
?>

[client]
<?php
require_once 'SOAP/Client.php';
$client = new SOAP_Client("http://localhost/test/server.php");
$param = array();
$client->call("attachTest", $param);
$param = array();
$result = $client->call("anything", $param);
?>

Suggestion to patch this bug:
Change Transport/HTTP.php
function &send(&$msg, $options = null)
{
if (!$this->_validateUrl()) {
to
function &send(&$msg, $options = null)
{
$this->headers = array();
if (!$this->_validateUrl()) {

Actual result:
--------------
Request entity too large!

The POST method does not allow the data transmitted, or the data volume exceeds the capacity limit.

If you think this is a server error, please contact the webmaster.
Error 413