xref: /PHP-5.4/ext/soap/tests/bugs/bug38067.phpt (revision 610c7fbe)
1--TEST--
2Bug #38067 (Parameters are not decoded from utf-8 when using encoding option)
3--SKIPIF--
4<?php require_once('skipif.inc'); ?>
5--INI--
6soap.wsdl_cache_enabled=0
7--FILE--
8<?php
9function Test($param) {
10	global $g;
11	$g = $param->str;
12	return $g;
13}
14
15class TestSoapClient extends SoapClient {
16  function __construct($wsdl, $opt) {
17    parent::__construct($wsdl, $opt);
18    $this->server = new SoapServer($wsdl, $opt);
19    $this->server->addFunction('Test');
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$client = new TestSoapClient(dirname(__FILE__).'/bug38067.wsdl',
32	array('encoding' => 'ISO-8859-1'));
33$str = 'test: �';
34$res = $client->Test(array('str'=>$str));
35echo $str."\n";
36echo $res."\n";
37echo $g."\n";
38?>
39--EXPECT--
40test: �
41test: �
42test: �
43