xref: /php-src/ext/soap/tests/bugs/bug49169.phpt (revision 63e0b9cc)
1--TEST--
2Bug #49169 (SoapServer calls wrong function, although "SOAP action" header is correct)
3--EXTENSIONS--
4soap
5--INI--
6soap.wsdl_cache_enabled=0
7--SKIPIF--
8<?php
9    if (php_sapi_name()=='cli') echo 'skip';
10?>
11--POST--
12<SOAP-ENV:Envelope
13    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
14    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
15    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
16    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
17    SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
18>
19    <SOAP-ENV:Body>
20        <testParam xsi:type="xsd:string">hello</testParam>
21    </SOAP-ENV:Body>
22</SOAP-ENV:Envelope>
23--FILE--
24<?php
25function test($input) {
26  return strrev($input);
27}
28function test2($input) {
29  return strlen($input);
30}
31
32$server = new soapserver(__DIR__.'/bug49169.wsdl', []);
33$server->addfunction("test");
34$server->addfunction("test2");
35$_SERVER["HTTP_SOAPACTION"] = "#test";
36$server->handle();
37$_SERVER["HTTP_SOAPACTION"] = "#test2";
38$server->handle();
39?>
40--EXPECT--
41<?xml version="1.0" encoding="UTF-8"?>
42<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><testParam xsi:type="xsd:string">olleh</testParam></SOAP-ENV:Body></SOAP-ENV:Envelope>
43<?xml version="1.0" encoding="UTF-8"?>
44<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><testParam xsi:type="xsd:string">5</testParam></SOAP-ENV:Body></SOAP-ENV:Envelope>
45