/** * Set the location at which the WSDL file will be availabe. * * @throws \Zend\Soap\AutoDiscover\Exception * @param \Zend\URI\URI|string $uri * @return \Zend\Soap\AutoDiscover\AutoDiscover */ public function setUri($uri) { if (!is_string($uri) && !$uri instanceof URI\URI) { throw new Exception('No uri given to \\Zend\\Soap\\AutoDiscover\\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\WSDL) { $this->_wsdl->setUri($uri); } return $this; }
/** * @group ZF-5736 */ public function testHtmlAmpersandInUrlInSetUriIsEncodedCorrectly() { $wsdl = new WSDL\WSDL("MyService", "http://example.com"); $wsdl->setUri(self::URI_WITH_EXPANDED_AMP); $this->assertContains(self::URI_WITH_EXPANDED_AMP, $wsdl->toXML()); }