xref: /PHP-5.3/ext/soap/tests/bugs/bug34453.phpt (revision 610c7fbe)
1--TEST--
2Bug #29839 (incorrect convert (xml:lang to lang))
3--SKIPIF--
4<?php require_once('skipif.inc'); ?>
5--INI--
6soap.wsdl_cache_enabled=0
7--FILE--
8<?php
9
10function EchoString($s) {
11  return $s;
12}
13
14class LocalSoapClient extends SoapClient {
15
16  function __construct($wsdl, $options) {
17    parent::__construct($wsdl, $options);
18    $this->server = new SoapServer($wsdl, $options);
19    $this->server->addFunction('EchoString');
20  }
21
22  function __doRequest($request, $location, $action, $version, $one_way = 0) {
23    ob_start();
24    $this->server->handle($request);
25    $response = ob_get_contents();
26    ob_end_clean();
27    return $response;
28  }
29
30}
31
32$client = new LocalSoapClient(dirname(__FILE__)."/bug34453.wsdl", array("trace"=>1));
33$client->EchoString(array("value"=>"hello","lang"=>"en"));
34echo $client->__getLastRequest();
35echo $client->__getLastResponse();
36echo "ok\n";
37?>
38--EXPECT--
39<?xml version="1.0" encoding="UTF-8"?>
40<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>
41<?xml version="1.0" encoding="UTF-8"?>
42<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>
43ok
44