SoapClient()
takes a URI which supports not only web addresses, but local file paths. But relative paths aren't working here, so it needs to be the full file path.
Here's how to load a local WSDL file with a relative reference. If the WSDL is in the same directory as the current PHP file:
new SoapClient(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'the.wsdl.xml');
or if it's in a subfolder of the current PHP file:
new SoapClient(dirname(__FILE__) . DIRECTORY_SEPARATOR. 'subfolder' . DIRECTORY_SEPARATOR . 'the.wsdl.xml');
or if it's in a parent folder of the current PHP file:
new SoapClient(dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'the.wsdl.xml');
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…