PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Web Services » SOAP » Bug #10023

unquoted type parameter text/xml when using HTTP transport and mime attachments

Details

Submitted2007-02-04 18:21 UTC
Fromdamjan dot glad at zejn dot si
Assignedyunosh
StatusClosed
PackageSOAP
PHP Version5.1.4
OSWindows XP
Roadmaps(Not assigned)

Comments

[2007-02-04 18:21 UTC] damjan dot glad at zejn dot si

Description:
------------
When using mime attachments and HTTP transport the resulting HTTP request is invalid. Problem is that "type" parameter in Content-Type header is not quoted. This is not HTTP compliant, e.g. Axis will reject such requests.

This is how the HTTP header type parameter is currently generated: Content-Type: multipart/related; type=text/xml;

This is the correct HTTP header type parameter (it is quoted): Content-Type: multipart/related; type="text/xml";

Test script:
---------------
function SOAP_Base::_makeMimeMessage defines the content type in the following line:

$params = array('content_type' => 'multipart/related; type=text/xml');

Changing this line to:

$params = array('content_type' => 'multipart/related; type="text/xml"');

solves the bug. But the same function is also reused in other contexts:

- SOAP_Server_Email::service

- SOAP_Server_Email_Gateway::service

- SOAP_Server::service

I did not check if the above mentioned "fix" is the right thing to do when called from other three locations. This should be verified and corrected if needed.