我的 soapserver 调用中有 URL 参数。调用 'mysoapserver.php?version=1' 效果很好,除了这种情况
mysoapserver.php?wsdl&version=1
Soapserver 不输出 wsdl。
代码看起来像这样
$version = isset($_GET['version']) ? $_GET['version'] : 1;
switch($version) {
case 1:
$wsdl = 'myservices.v1.wsdl';
break;
case 2:
$wsdl = 'myservices.v2.wsdl';
break;
default:
throw new SoapFault('Server',utf8_encode('error'));
break;
}
$mysoapserver = new SoapServer($wsdl);
$mysoapserver->setClass('SOAPServices');
$mysoapserver->handle();
任何想法如何让这个工作?