xref: /PHP-5.5/ext/soap/tests/bugs/bug42488.phpt (revision 610c7fbe)
1--TEST--
2Bug #42488 (SoapServer reports an encoding error and the error itself breaks)
3--SKIPIF--
4<?php require_once('skipif.inc'); ?>
5--INI--
6soap.wsdl_cache_enabled=0
7--FILE--
8<?php
9$request = <<<EOF
10<?xml version="1.0" encoding="UTF-8"?>
11<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="test:\" 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:Body><ns1:getBadUTF/></SOAP-ENV:Body></SOAP-ENV:Envelope>
12EOF;
13$soap = new SoapServer(NULL, array('uri'=>'test://'));
14function getBadUTF(){
15    return "stuff\x93thing";
16}
17$soap->addFunction('getBadUTF');
18$soap->handle($request);
19?>
20--EXPECT--
21<?xml version="1.0" encoding="UTF-8"?>
22<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>SOAP-ERROR: Encoding: string 'stuff\x93...' is not a valid utf-8 string</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>