PHP SOAP-错误:解析架构:can';t从xsd导入架构


PHP SOAP-ERROR: Parsing Schema: can't import schema from xsd

我正在运行一些使用soap编写的web服务。

一些web服务正在运行,但是那些试图导入本地xsd的web服务正在失败

<faultcode>WSDL</faultcode>
<faultstring>
    SOAP-ERROR: Parsing Schema: can't import schema from 'http://localhost/myproject/_xsd/1'
</faultstring>

以下是我的wsdl 的摘录

<definitions
        xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
        xmlns:wsp="http://www.w3.org/ns/ws-policy"
        xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy"
        xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"
        xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
        xmlns:tns="http://ws.platform.commersite.com/"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        xmlns="http://schemas.xmlsoap.org/wsdl/"
        targetNamespace="http://ws.platform.commersite.com/"
        name="PlatformControllerWSService">
<types>
    <xsd:schema>
        <xsd:import
                namespace="http://mysite/"
                schemaLocation="http://localhost/myproject/1" />
    </xsd:schema>
    <xsd:schema>
        <xsd:import
                namespace="http://somesite/"
                schemaLocation="http://localhost/myproject/_xsd/2" />
    </xsd:schema>
</types>

加载xsd文件将转到php函数

public function _xsdAction($xsd) {
        $this->response->setHeader("Content-Type", "text/xml");
        $this->view->pick('server/_xsd' . $xsd);
        $this->view->setVars(array(
            'param1' => Server::config('param1'),
            'param2'  => Server::config('param2'),
        ));
}

同样值得一提的是,xsd1导入xsd2

<xs:import namespace="{{ param1 }}" schemaLocation="{{ param2 }}xsd/2"/>

我不确定可能是什么问题。如有任何帮助,将不胜感激

已解决!

问题是用于定位xsd文件的路径不正确,因为它已经进入/myproject/文件夹,并且不需要我手动添加/myproject/的位置。