bug29839.phpt 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. --TEST--
  2. Bug #29839 (incorrect convert (xml:lang to lang))
  3. --EXTENSIONS--
  4. soap
  5. --INI--
  6. soap.wsdl_cache_enabled=0
  7. --FILE--
  8. <?php
  9. function EchoString($s) {
  10. return $s;
  11. }
  12. class LocalSoapClient extends SoapClient {
  13. function __construct($wsdl, $options) {
  14. parent::__construct($wsdl, $options);
  15. $this->server = new SoapServer($wsdl, $options);
  16. $this->server->addFunction('EchoString');
  17. }
  18. function __doRequest($request, $location, $action, $version, $one_way = 0): ?string {
  19. ob_start();
  20. $this->server->handle($request);
  21. $response = ob_get_contents();
  22. ob_end_clean();
  23. return $response;
  24. }
  25. }
  26. $client = new LocalSoapClient(__DIR__."/bug29839.wsdl", array("trace"=>1));
  27. $client->EchoString(array("value"=>"hello","lang"=>"en"));
  28. echo $client->__getLastRequest();
  29. echo $client->__getLastResponse();
  30. echo "ok\n";
  31. ?>
  32. --EXPECT--
  33. <?xml version="1.0" encoding="UTF-8"?>
  34. <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri"><SOAP-ENV:Body><string xml:lang="en"><ns1:value>hello</ns1:value></string></SOAP-ENV:Body></SOAP-ENV:Envelope>
  35. <?xml version="1.0" encoding="UTF-8"?>
  36. <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://test-uri"><SOAP-ENV:Body><string xml:lang="en"><ns1:value>hello</ns1:value></string></SOAP-ENV:Body></SOAP-ENV:Envelope>
  37. ok