bug36908.phpt 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. --TEST--
  2. Bug #36908 (wsdl default value overrides value in soap request)
  3. --EXTENSIONS--
  4. soap
  5. --INI--
  6. soap.wsdl_cache_enabled=0
  7. --FILE--
  8. <?php
  9. class PublisherService {
  10. function add($publisher) {
  11. return $publisher->region_id;
  12. }
  13. }
  14. $input =
  15. '<?xml version="1.0" encoding="UTF-8"?>
  16. <soapenv:Envelope
  17. xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
  18. xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  19. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  20. <soapenv:Body>
  21. <ns1:add xmlns:ns1="urn:PublisherService" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
  22. <publisher href="#id0"/>
  23. </ns1:add>
  24. <multiRef xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
  25. xmlns:ns3="http://soap.dev/soap/types" id="id0" soapenc:root="0"
  26. soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
  27. xsi:type="ns3:publisher">
  28. <region_id href="#id5"/>
  29. </multiRef>
  30. <multiRef xmlns:ns5="http://soap.dev/soap/types"
  31. xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" id="id5"
  32. soapenc:root="0"
  33. soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
  34. xsi:type="xsd:long">9</multiRef>
  35. </soapenv:Body>
  36. </soapenv:Envelope>';
  37. ini_set('soap.wsdl_cache_enabled', false);
  38. $server = new SoapServer(__DIR__."/bug36908.wsdl");
  39. $server->setClass("PublisherService");
  40. $server->handle($input);
  41. ?>
  42. --EXPECT--
  43. <?xml version="1.0" encoding="UTF-8"?>
  44. <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>