bug65018.phpt 1.5 KB

12345678910111213141516171819202122232425262728
  1. --TEST--
  2. Bug #65018 (SoapHeader problems with SoapServer)
  3. --EXTENSIONS--
  4. soap
  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. $input = $input =
  14. '<?xml version="1.0"?>'.PHP_EOL.
  15. '<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="namespace1"'.
  16. ' xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"'.
  17. ' xmlns:xsd="http://www.w3.org/2001/XMLSchema">'.
  18. '<SOAP-ENV:Header><ns1:TOKEN soapenv:mustUnderstand="1">abc</ns1:TOKEN></SOAP-ENV:Header>'.
  19. '<SOAP-ENV:Body><ns1:Method /></SOAP-ENV:Body></SOAP-ENV:Envelope>';
  20. $soap = new SoapServer(null, array('uri' => '127.0.0.1'));
  21. $soap->setClass('Tool');
  22. $soap->handle($input);
  23. ?>
  24. --EXPECT--
  25. <?xml version="1.0" encoding="UTF-8"?>
  26. <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>