setheaders.phpt 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. --TEST--
  2. SOAP: SoapClient::__setHeaders
  3. --EXTENSIONS--
  4. soap
  5. --FILE--
  6. <?php
  7. $client = new SoapClient(NULL, array("location"=>"test://","uri"=>"test://",
  8. "exceptions"=>0,"trace"=>1));
  9. $client->test();
  10. echo $client->__getLastRequest();
  11. $client->__setSoapHeaders(new SoapHeader("test://","HDR1"));
  12. $client->test();
  13. echo $client->__getLastRequest();
  14. $client->test();
  15. echo $client->__getLastRequest();
  16. $client->__setSoapHeaders();
  17. $client->test();
  18. echo $client->__getLastRequest();
  19. $client->__setSoapHeaders(array(new SoapHeader("test://","HDR1"),new SoapHeader("test://","HDR2")));
  20. $client->test();
  21. echo $client->__getLastRequest();
  22. $h = array(new SoapHeader("test://","HDR0"));
  23. $client->__soapCall("test", array(), null, $h);
  24. echo $client->__getLastRequest();
  25. ?>
  26. --EXPECT--
  27. <?xml version="1.0" encoding="UTF-8"?>
  28. <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:test/></SOAP-ENV:Body></SOAP-ENV:Envelope>
  29. <?xml version="1.0" encoding="UTF-8"?>
  30. <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:Header><ns1:HDR1/></SOAP-ENV:Header><SOAP-ENV:Body><ns1:test/></SOAP-ENV:Body></SOAP-ENV:Envelope>
  31. <?xml version="1.0" encoding="UTF-8"?>
  32. <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:Header><ns1:HDR1/></SOAP-ENV:Header><SOAP-ENV:Body><ns1:test/></SOAP-ENV:Body></SOAP-ENV:Envelope>
  33. <?xml version="1.0" encoding="UTF-8"?>
  34. <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:test/></SOAP-ENV:Body></SOAP-ENV:Envelope>
  35. <?xml version="1.0" encoding="UTF-8"?>
  36. <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:Header><ns1:HDR1/><ns1:HDR2/></SOAP-ENV:Header><SOAP-ENV:Body><ns1:test/></SOAP-ENV:Body></SOAP-ENV:Envelope>
  37. <?xml version="1.0" encoding="UTF-8"?>
  38. <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:Header><ns1:HDR0/><ns1:HDR1/><ns1:HDR2/></SOAP-ENV:Header><SOAP-ENV:Body><ns1:test/></SOAP-ENV:Body></SOAP-ENV:Envelope>