Re: [SOAP] soap response content-length

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Well I thought that I can't reset this header myself but after sending this email I figured that PHP's header() can overwrite previous headers.

I know I rather convert the data before building the response but I decided to go with the output control functions to prevent changing my whole code at this time.

If anyone else is trying to do this using the ob functions, you can use the following code:

In the beginning of the script:
mb_internal_encoding('ISO-8859-8');
mb_http_output('UTF-8');
ob_start();

And in the end:
$content = mb_convert_encoding(ob_get_contents(), 'UTF-8');
ob_end_clean();

header('Content-Length: '.strlen($content));
print $content;

I think it works, but I haven't had the chance to verify it with MS client yet.

BTW you mentioned persistent connections - is it possible to use them with pear::soap right now? my application might have to use many functions at the same time and I would like to prevent the overhead of reconnecting to the server in every function, is that possible?

On 15/08/2003 23:03, Shane Caraveo wrote:

If content-length is not in the headers, then a number of things wont work. Off the top of my head, http/1.1 persistent connections, DIME and attachements are immediately broken. You should convert the data prior to creating the soap message.
Shane


Sagi Bashari wrote:

Hi,

Is it really necessary to set http content-length header in soap resonse (Server.php:214) ?

I'm using mb output handler to covnert iso8 strings (hebrew) to utf-8 so ms clients can use my server, and ofcourse it changes the length of the response so the header is wrong.

Right now I disabled it locally and it works great. I think others might have the same problem, and I just wondered why this header is needed at all.

If it isn't possible to remove it, what about adding an option to disable it at runtime?

Sagi










--
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Kernel Newbies]     [PHP Database]     [Yosemite]

  Powered by Linux