xref: /PHP-7.2/ext/soap/tests/bugs/bug36908.phpt (revision 17ccbeec)
1--TEST--
2Bug #36908 (wsdl default value overrides value in soap request)
3--SKIPIF--
4<?php
5  if (!extension_loaded('soap')) die('skip soap extension not available');
6?>
7--INI--
8soap.wsdl_cache_enabled=0
9--FILE--
10<?php
11class PublisherService {
12  function add($publisher) {
13    return $publisher->region_id;
14  }
15}
16$input =
17'<?xml version="1.0" encoding="UTF-8"?>
18<soapenv:Envelope
19xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
20xmlns:xsd="http://www.w3.org/2001/XMLSchema"
21xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
22  <soapenv:Body>
23    <ns1:add xmlns:ns1="urn:PublisherService" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
24      <publisher href="#id0"/>
25    </ns1:add>
26    <multiRef xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
27xmlns:ns3="http://soap.dev/soap/types" id="id0" soapenc:root="0"
28soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
29xsi:type="ns3:publisher">
30      <region_id href="#id5"/>
31    </multiRef>
32    <multiRef xmlns:ns5="http://soap.dev/soap/types"
33xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" id="id5"
34soapenc:root="0"
35soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
36xsi:type="xsd:long">9</multiRef>
37  </soapenv:Body>
38</soapenv:Envelope>';
39ini_set('soap.wsdl_cache_enabled', false);
40$server = new SoapServer(dirname(__FILE__)."/bug36908.wsdl");
41$server->setClass("PublisherService");
42$server->handle($input);
43?>
44--EXPECT--
45<?xml version="1.0" encoding="UTF-8"?>
46<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:PublisherService" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:addResponse><out xsi:type="xsd:string">9</out></ns1:addResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
47