xref: /PHP-8.0/ext/soap/tests/bugs/bug65018.phpt (revision f8d79582)
1--TEST--
2Bug #65018 (SoapHeader problems with SoapServer)
3--SKIPIF--
4<?php require_once('skipif.inc'); ?>
5--FILE--
6<?php
7    class Tool{
8        public function TOKEN($id){
9            return new SoapHeader('namespace1', 'TOKEN', $id, true);
10        }
11        public function Method(){}
12    }
13
14    $input = $input =
15        '<?xml version="1.0"?>'.PHP_EOL.
16        '<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="namespace1"'.
17        ' xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"'.
18        ' xmlns:xsd="http://www.w3.org/2001/XMLSchema">'.
19        '<SOAP-ENV:Header><ns1:TOKEN soapenv:mustUnderstand="1">abc</ns1:TOKEN></SOAP-ENV:Header>'.
20        '<SOAP-ENV:Body><ns1:Method /></SOAP-ENV:Body></SOAP-ENV:Envelope>';
21
22    $soap = new SoapServer(null, array('uri' => '127.0.0.1'));
23    $soap->setClass('Tool');
24    $soap->handle($input);
25?>
26--EXPECT--
27<?xml version="1.0" encoding="UTF-8"?>
28<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="namespace1" xmlns:ns2="127.0.0.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Header><ns1:TOKEN SOAP-ENV:mustUnderstand="1">abc</ns1:TOKEN></SOAP-ENV:Header><SOAP-ENV:Body><ns2:MethodResponse><return xsi:nil="true"/></ns2:MethodResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
29