/** * Set the location at which the WSDL file will be availabe. * * @throws \Zend\Soap\AutoDiscover\Exception * @param Uri\Uri|string $uri * @return \Zend\Soap\AutoDiscover */ public function setUri($uri) { if (!is_string($uri) && !$uri instanceof Uri\Uri) { throw new Exception\InvalidArgumentException('No uri given to \\Zend\\Soap\\AutoDiscover::setUri as string or \\Zend\\Uri\\Uri instance.'); } $this->_uri = $uri; // change uri in WSDL file also if existant if ($this->_wsdl instanceof Wsdl) { $this->_wsdl->setUri($uri); } return $this; }
/** * @group ZF-5736 */ public function testHtmlAmpersandInUrlInSetUriIsEncodedCorrectly() { $wsdl = new Wsdl("MyService", "http://example.com"); $wsdl->setUri(self::URI_WITH_EXPANDED_AMP); $this->assertContains(self::URI_WITH_EXPANDED_AMP, $wsdl->toXML()); }