2014-11-04 59 views
0

我正在运行一些使用soap编写的web服务。PHP SOAP-ERROR:解析架构:无法从xsd导入架构

然而那些试图导入本地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"/> 

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

回答

0

已解决!

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