bug41004.phpt 1000 B

123456789101112131415161718192021222324252627282930313233343536
  1. --TEST--
  2. Bug #41004 (minOccurs="0" and null class member variable)
  3. --EXTENSIONS--
  4. soap
  5. --FILE--
  6. <?php
  7. ini_set('soap.wsdl_cache_enabled', false);
  8. class EchoBean{
  9. public $mandatoryElement;
  10. public $optionalElement;
  11. }
  12. class EchoRequest{
  13. public $in;
  14. }
  15. class EchoResponse{
  16. public $out;
  17. }
  18. $wsdl = __DIR__."/bug41004.wsdl";
  19. $classmap = array('EchoBean'=>'EchoBean','echo'=>'EchoRequest','echoResponse'=>'EchoResponse');
  20. $client = new SoapClient($wsdl, array('location'=>'test://',"classmap" => $classmap, 'exceptions'=>0, 'trace'=>1));
  21. $echo=new EchoRequest();
  22. $in=new EchoBean();
  23. $in->mandatoryElement="REV";
  24. $in->optionalElement=NULL;
  25. $echo->in=$in;
  26. $client->echo($echo);
  27. echo $client->__getLastRequest();
  28. ?>
  29. --EXPECT--
  30. <?xml version="1.0" encoding="UTF-8"?>
  31. <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:Formation"><SOAP-ENV:Body><ns1:echo><in><mandatoryElement>REV</mandatoryElement></in></ns1:echo></SOAP-ENV:Body></SOAP-ENV:Envelope>