ID: 34950 Updated by: [EMAIL PROTECTED] Reported By: mag at alcormizar dot com -Status: Open +Status: Feedback Bug Type: SOAP related Operating System: Windows 2000, 2003, Linux PHP Version: 5.0.5 New Comment:
Please try using this CVS snapshot: http://snaps.php.net/php5-latest.tar.gz For Windows: http://snaps.php.net/win32/php5-win32-latest.zip Previous Comments: ------------------------------------------------------------------------ [2005-10-21 20:30:08] mag at alcormizar dot com Description: ------------ Hi, I've been trying to use the SOAP extension to get a WSDL through a proxy, but it seems that the http header sent to the proxy server are invalid. I tried with Squid 2.5.STABLE11 and Privoxy 3.0.3 without success. This is not a duplicate of the bug 29211. From what I see, the request sent to the proxy server is pure HTTP/1.1, with the server specified in the "Host:" header and the command being "GET /dir/xxx.wsdl HTTP/1.0". From the HTTP RFC, in HTTP/1.0 you can only use : GET http://www.example.com/dir/xxx.wsdl HTTP/1.0 With HTTP 1.1 you can use the method above or : GET /dir/xxx.wsdl HTTP/1.1 Host: www.example.com Since very few (if any) proxy server fully support the HTTP/1.1 method, I suggest we stick with the good old HTTP/1.0 GET. Reproduce code: --------------- <?php $client = new SoapClient("http://service.mappoint.net/standard-30/mappoint.wsdl", array("proxy_host" => "192.168.0.18", "proxy_port" => 8118, "trace" => 1)); print_r($client->__getFunctions()); ?> Expected result: ---------------- To get the WSDL. Actual result: -------------- Here's a dump of the packets sent to the proxy : 0000 00 04 00 01 00 06 00 07 e9 ad 37 45 00 00 08 00 ..........7E.... 0010 45 00 00 5d 39 83 40 00 40 06 7f 6a c0 a8 00 4b [EMAIL PROTECTED]@..j...K 0020 c0 a8 00 12 e5 26 1f b6 af cc d9 0a f9 a0 05 e6 .....&.......... 0030 80 18 05 b4 63 0d 00 00 01 01 08 0a 01 1f e0 77 ....c..........w 0040 f9 f3 92 17 47 45 54 20 2f 73 74 61 6e 64 61 72 ....GET /standar 0050 64 2d 33 30 2f 6d 61 70 70 6f 69 6e 74 2e 77 73 d-30/mappoint.ws 0060 64 6c 20 48 54 54 50 2f 31 2e 30 0d 0a dl HTTP/1.0.. There's also this part that follow in another packet (the "Host:" header : 0000 00 04 00 01 00 06 00 07 e9 ad 37 45 00 00 08 00 ..........7E.... 0010 45 00 00 52 39 85 40 00 40 06 7f 73 c0 a8 00 4b [EMAIL PROTECTED]@..s...K 0020 c0 a8 00 12 e5 26 1f b6 af cc d9 33 f9 a0 05 e6 .....&.....3.... 0030 80 18 05 b4 e0 16 00 00 01 01 08 0a 01 1f e0 77 ...............w 0040 f9 f3 92 17 48 6f 73 74 3a 20 73 65 72 76 69 63 ....Host: servic 0050 65 2e 6d 61 70 70 6f 69 6e 74 2e 6e 65 74 0d 0a e.mappoint.net.. 0060 0d 0a .. Then the answer from the proxy (privoxy 3 in this case) : 0000 00 00 00 01 00 06 00 10 5a 9e 16 6c 00 00 08 00 ........Z..l.... 0010 45 00 00 69 97 f5 40 00 40 06 20 ec c0 a8 00 12 [EMAIL PROTECTED]@. ..... 0020 c0 a8 00 4b 1f b6 e5 26 f9 a0 05 e6 af cc d9 51 ...K...&.......Q 0030 80 18 05 a8 83 b5 00 00 01 01 08 0a f9 f3 92 18 ................ 0040 01 1f e0 77 48 54 54 50 2f 31 2e 30 20 34 30 30 ...wHTTP/1.0 400 0050 20 49 6e 76 61 6c 69 64 20 68 65 61 64 65 72 20 Invalid header 0060 72 65 63 65 69 76 65 64 20 66 72 6f 6d 20 62 72 received from br 0070 6f 77 73 65 72 0d 0a 0d 0a owser.... Warning: SoapClient::__construct(http://service.mappoint.net/standard-30/mappoint.wsdl) [function.--construct]: failed to open stream: HTTP request failed! HTTP/1.0 400 Invalid header received from browser in /home/http/wsdl.php on line 4 Warning: Operation in progressI/O warning : failed to load external entity "http://service.mappoint.net/standard-30/mappoint.wsdl" in /home/http/wsdl.php on line 4 Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://service.mappoint.net/standard-30/mappoint.wsdl' in /home/http/wsdl.php:4 Stack trace: #0 /home/http/wsdl.php(4): SoapClient->__construct('http://service....', Array) #1 {main} thrown in /home/http/wsdl.php on line 4 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=34950&edit=1