#49226 [Bgs]: SoapServer failing on construction (cannot load wsdl)

2009-08-24 Thread richard at rjharrison dot org
 ID:   49226
 User updated by:  richard at rjharrison dot org
 Reported By:  richard at rjharrison dot org
 Status:   Bogus
 Bug Type: SOAP related
 Operating System: linux
 PHP Version:  5.3.0
 New Comment:

Sjoerd,

Respectfully, I think you're wrong. I am *far* from being a SOAP
expert, but the specifications for SOAP 1.1[1] and for WSDL[2] both show
use of HTTP 1.1.

1. http://www.w3.org/TR/2000/NOTE-SOAP-2508/#_Toc478383526
2. http://www.w3.org/TR/wsdl#_http


Previous Comments:


[2009-08-24 12:51:11] sjo...@php.net

Thank you both for your feedback.

SOAP retrieves the WSDL using HTTP/1.0, which does not have chunked
transfers. Therefore, the server should provide a Content-length header.
If it does not do that, SoapServer can not load the WSDL correctly. This
is not a bug in PHP, since the content-length header is mandatory for
HTTP/1.0 messages which have a body.

You could implement/request the feature that PHP can load WSDLs even if
they don't have a content-length header, but it is not a bug in PHP
itself.



[2009-08-12 17:24:55] richard at rjharrison dot org

Its not in the PHP 5.3 release, rather its a bug in the Zend
AutoDiscover class

If it works fine in 5.2(.6) but not in 5.3 then something changed in
5.3 that made things break, which suggests a bug in 5.3.

If adding a content-length header fixes things then that's great as a
quick-fix, but SoapServer should be able to deal with chunk-encoded
responses which don't, by their nature, have a content-length.



[2009-08-12 14:01:26] stig dot woxholt at fotoknudsen dot no

The service works when using a local file.

I did some more tests, and have identified the actual problem.
Its not in the PHP 5.3 release, rather its a bug in the Zend
AutoDiscover class provided by Zend.

I assume the reporter also might be using this to generate the WSDL's
?

I guess that in php 5.3 the soap server expects the content length to
be set in the header inorder to parse the complete wsdl, but the
AutoDiscover class does not send this.

By adding header('Content-Length: '.strlen($this-_wsdl-toXML())); to
the handle function in the AutoDiscover class things are working 

I'll report the findings on the Zend bugtracker.



[2009-08-12 13:05:41] richard at rjharrison dot org

@sjoerd,

When I load the WSDL over HTTP there is no content-length header, as
the response is sent chunk-encoded. As stated in the original report, if
I save the WSDL to disk then it works, for example:-

?php
$data = file_get_contents('http://myserver/path?wsdl');
file_put_contents(wsdl.xml, $data);
$serv = new SoapServer(wsdl.xml); // works
?


@stig,

The behaviour you describe with different size WSDL might backup the
theory that it's chunk-encoding related. With a small body size, I think
PHP *does* send a content-length header; but if the body is larger than
the output buffer (?) it will switch to chunk-encoding to allow for the
unknown, variable length.



[2009-08-12 11:39:05] sjoerd-php at linuxonly dot nl

Thank you for your bug report.

When you retrieve the WSDL over HTTP, does the Content-Length header
match the length of the WSDL? You can try saving the WSDL to disk and
load that one instead.



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/49226

-- 
Edit this bug report at http://bugs.php.net/?id=49226edit=1



#49226 [Bgs]: SoapServer failing on construction (cannot load wsdl)

2009-08-24 Thread sjoerd
 ID:   49226
 Updated by:   sjo...@php.net
 Reported By:  richard at rjharrison dot org
 Status:   Bogus
 Bug Type: SOAP related
 Operating System: linux
 PHP Version:  5.3.0
 New Comment:

The specifications you supply do not describe how to retrieve the
WSDL.

In this case, the WSDL is retrieved using HTTP. I don't think it is
specified which HTTP version to use. The SoapServer class uses HTTP 1.0.
If the server serving the WSDL implements HTTP 1.0, it should send a
content-length header. If it does not implement HTTP 1.0, it should send
a 505 HTTP Version Not Supported.


Previous Comments:


[2009-08-24 13:20:41] richard at rjharrison dot org

Sjoerd,

Respectfully, I think you're wrong. I am *far* from being a SOAP
expert, but the specifications for SOAP 1.1[1] and for WSDL[2] both show
use of HTTP 1.1.

1. http://www.w3.org/TR/2000/NOTE-SOAP-2508/#_Toc478383526
2. http://www.w3.org/TR/wsdl#_http



[2009-08-24 12:51:11] sjo...@php.net

Thank you both for your feedback.

SOAP retrieves the WSDL using HTTP/1.0, which does not have chunked
transfers. Therefore, the server should provide a Content-length header.
If it does not do that, SoapServer can not load the WSDL correctly. This
is not a bug in PHP, since the content-length header is mandatory for
HTTP/1.0 messages which have a body.

You could implement/request the feature that PHP can load WSDLs even if
they don't have a content-length header, but it is not a bug in PHP
itself.



[2009-08-12 17:24:55] richard at rjharrison dot org

Its not in the PHP 5.3 release, rather its a bug in the Zend
AutoDiscover class

If it works fine in 5.2(.6) but not in 5.3 then something changed in
5.3 that made things break, which suggests a bug in 5.3.

If adding a content-length header fixes things then that's great as a
quick-fix, but SoapServer should be able to deal with chunk-encoded
responses which don't, by their nature, have a content-length.



[2009-08-12 14:01:26] stig dot woxholt at fotoknudsen dot no

The service works when using a local file.

I did some more tests, and have identified the actual problem.
Its not in the PHP 5.3 release, rather its a bug in the Zend
AutoDiscover class provided by Zend.

I assume the reporter also might be using this to generate the WSDL's
?

I guess that in php 5.3 the soap server expects the content length to
be set in the header inorder to parse the complete wsdl, but the
AutoDiscover class does not send this.

By adding header('Content-Length: '.strlen($this-_wsdl-toXML())); to
the handle function in the AutoDiscover class things are working 

I'll report the findings on the Zend bugtracker.



[2009-08-12 13:05:41] richard at rjharrison dot org

@sjoerd,

When I load the WSDL over HTTP there is no content-length header, as
the response is sent chunk-encoded. As stated in the original report, if
I save the WSDL to disk then it works, for example:-

?php
$data = file_get_contents('http://myserver/path?wsdl');
file_put_contents(wsdl.xml, $data);
$serv = new SoapServer(wsdl.xml); // works
?


@stig,

The behaviour you describe with different size WSDL might backup the
theory that it's chunk-encoding related. With a small body size, I think
PHP *does* send a content-length header; but if the body is larger than
the output buffer (?) it will switch to chunk-encoding to allow for the
unknown, variable length.



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/49226

-- 
Edit this bug report at http://bugs.php.net/?id=49226edit=1



#49226 [Bgs]: SoapServer failing on construction (cannot load wsdl)

2009-08-24 Thread richard at rjharrison dot org
 ID:   49226
 User updated by:  richard at rjharrison dot org
 Reported By:  richard at rjharrison dot org
 Status:   Bogus
 Bug Type: SOAP related
 Operating System: linux
 PHP Version:  5.3.0
 New Comment:

Ok I understand your point (that the WSDL server is supposedly at fault
for not providing an HTTP 1.0 response). 

I just tested again and watched my Apache access_log. With 5.2.10, the
request is sent from SoapServer using HTTP 1.0, and the response from
the WSDL server correctly includes a content-length header (and
everything works fine).

When I test with 5.3, SoapServer sends the request using HTTP 1.1
(according to the Apache log) and the response is chunk-encoded causing
SoapServer to error.

Therefore I believe that SoapServer in 5.3 is sending an HTTP 1.1
request but is unable to process an HTTP 1.1 response.


Previous Comments:


[2009-08-24 16:49:16] sjo...@php.net

The specifications you supply do not describe how to retrieve the
WSDL.

In this case, the WSDL is retrieved using HTTP. I don't think it is
specified which HTTP version to use. The SoapServer class uses HTTP 1.0.
If the server serving the WSDL implements HTTP 1.0, it should send a
content-length header. If it does not implement HTTP 1.0, it should send
a 505 HTTP Version Not Supported.



[2009-08-24 13:20:41] richard at rjharrison dot org

Sjoerd,

Respectfully, I think you're wrong. I am *far* from being a SOAP
expert, but the specifications for SOAP 1.1[1] and for WSDL[2] both show
use of HTTP 1.1.

1. http://www.w3.org/TR/2000/NOTE-SOAP-2508/#_Toc478383526
2. http://www.w3.org/TR/wsdl#_http



[2009-08-24 12:51:11] sjo...@php.net

Thank you both for your feedback.

SOAP retrieves the WSDL using HTTP/1.0, which does not have chunked
transfers. Therefore, the server should provide a Content-length header.
If it does not do that, SoapServer can not load the WSDL correctly. This
is not a bug in PHP, since the content-length header is mandatory for
HTTP/1.0 messages which have a body.

You could implement/request the feature that PHP can load WSDLs even if
they don't have a content-length header, but it is not a bug in PHP
itself.



[2009-08-12 17:24:55] richard at rjharrison dot org

Its not in the PHP 5.3 release, rather its a bug in the Zend
AutoDiscover class

If it works fine in 5.2(.6) but not in 5.3 then something changed in
5.3 that made things break, which suggests a bug in 5.3.

If adding a content-length header fixes things then that's great as a
quick-fix, but SoapServer should be able to deal with chunk-encoded
responses which don't, by their nature, have a content-length.



[2009-08-12 14:01:26] stig dot woxholt at fotoknudsen dot no

The service works when using a local file.

I did some more tests, and have identified the actual problem.
Its not in the PHP 5.3 release, rather its a bug in the Zend
AutoDiscover class provided by Zend.

I assume the reporter also might be using this to generate the WSDL's
?

I guess that in php 5.3 the soap server expects the content length to
be set in the header inorder to parse the complete wsdl, but the
AutoDiscover class does not send this.

By adding header('Content-Length: '.strlen($this-_wsdl-toXML())); to
the handle function in the AutoDiscover class things are working 

I'll report the findings on the Zend bugtracker.



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/49226

-- 
Edit this bug report at http://bugs.php.net/?id=49226edit=1