public function setUp() { $this->strategy = new Zend_Soap_Wsdl_Strategy_DefaultComplexType(); $this->wsdl = new Zend_Soap_Wsdl("TestService", "http://framework.zend.com/soap/unittests"); $this->wsdl->setComplexTypeStrategy($this->strategy); $this->strategy->setContext($this->wsdl); }
/** * Set the strategy that handles functions and classes that are added AFTER this call. * * @param boolean|string|Zend_Soap_Wsdl_Strategy_Interface $strategy * @return Zend_Soap_AutoDiscover */ public function setComplexTypeStrategy($strategy) { $this->_strategy = $strategy; if ($this->_wsdl instanceof Zend_Soap_Wsdl) { $this->_wsdl->setComplexTypeStrategy($strategy); } return $this; }
/** * @group ZF-5430 */ public function testMultipleSequenceDefinitionsOfSameTypeWillBeRecognizedOnceBySequenceStrategy() { $wsdl = new Zend_Soap_Wsdl("MyService", "http://localhost/MyService.php"); $wsdl->setComplexTypeStrategy(new Zend_Soap_Wsdl_Strategy_ArrayOfTypeSequence()); $wsdl->addComplexType("string[]"); $wsdl->addComplexType("int[]"); $wsdl->addComplexType("string[]"); $xml = $wsdl->toXml(); $this->assertEquals(1, substr_count($xml, "ArrayOfString"), "ArrayOfString should appear only once."); $this->assertEquals(1, substr_count($xml, "ArrayOfInt"), "ArrayOfInt should appear only once."); }