サードパーティの wsdl を使用して PHP SOAP サーバーを実装しています。含まれている xsd には、次のような外部スキーマへの参照があります。
<xsd:import schemaLocation="http://www.w3.org/TR/2008/REC-xmldsig-core-20080610/xmldsig-core-schema.xsd" namespace="http://www.w3.org/2000/09/xmldsig"/>
次のコードを含む SoapClient は完全に機能します。
$options = array();
$options['features'] = 1;
$options['trace'] = 1;
$options['connection_timeout'] = 2000;
$options['exceptions'] = 1;
$options['soap_version'] = SOAP_1_1;
$options['encoding'] = 'UTF-8';
$options["user_agent"] = 'php-file_get_contents/'.phpversion();
$clent = new SoapClient( $wsdl, $options);
ただし、SoapServer ではありません
$options = array();
$options['features'] = 1;
$options['trace'] = 1;
$options['connection_timeout'] = 2000;
$options['exceptions'] = 1;
$options['soap_version'] = SOAP_1_1;
$options['encoding'] = 'UTF-8';
$server = new SoapServer($wsdl, $options);
次のエラーが発生する
SoapServer::SoapServer("http://www.w3.org/TR/2008/REC-xmldsig-core-20080610/xmldsig-core-schema.xsd"): failed to open stream: HTTP request failed! HTTP/1.0 500 Server Error\r\n in ..../index.php on line 54
PHP Warning: SoapServer::SoapServer(): I/O warning : failed to load external entity "http://www.w3.org/TR/2008/REC-xmldsig-core-20080610/xmldsig-core-schema.xsd" in ..../index.php on line 54
PHP Fatal error: SOAP-ERROR: Parsing Schema: can't import schema from 'http://www.w3.org/TR/2008/REC-xmldsig-core-20080610/xmldsig-core-schema.xsd' in .../index.php on line 54
SoapClient も同じエラーをスローしていましたが、「user_agent」オプションを追加すると解決されます。SoapServer の「user_agent」オプションが表示されません。
ここで何か不足していますか?
URL: http://www.w3.org/TR/2008/REC-xmldsig-core-20080610/xmldsig-core-schema.xsdにアクセスでき、xsd ファイルをダウンロードできます。
編集: 実際の xsd リンクを追加しました。