xref: /PHP-8.0/ext/soap/tests/bugs/bug31755.phpt (revision 47d9446c)
1--TEST--
2Bug #31422 (No Error-Logging on SoapServer-Side)
3--SKIPIF--
4<?php require_once('skipif.inc'); ?>
5--FILE--
6<?php
7$client=new SOAPClient(null, array('location' => 'http://localhost',
8'uri' => 'myNS', 'exceptions' => false, 'trace' => true));
9
10try {
11    new SOAPHeader('', 'foo', 'bar');
12} catch (ValueError $exception) {
13    echo $exception->getMessage() . "\n";
14}
15
16$header = new SOAPHeader('namespace', 'foo', 'bar');
17$response= $client->__soapCall('function', array(), null, $header);
18
19print $client->__getLastRequest();
20?>
21--EXPECT--
22SoapHeader::__construct(): Argument #1 ($namespace) cannot be empty
23<?xml version="1.0" encoding="UTF-8"?>
24<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="myNS" xmlns:ns2="namespace" 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><ns2:foo>bar</ns2:foo></SOAP-ENV:Header><SOAP-ENV:Body><ns1:function/></SOAP-ENV:Body></SOAP-ENV:Envelope>
25