简体   繁体   English

WSDL到PHP:无法导入xml-exc-c14n的架构错误

[英]Wsdl to PHP: Can't import schema error for xml-exc-c14n

I am trying to generate a php file from a wsdl file using wsdl2php.php script. 我正在尝试使用wsdl2php.php脚本从wsdl文件生成php文件。 Previously when I was not using WS-Security in SOAP Service, everything was fine. 以前,当我不在SOAP Service中使用WS-Security时,一切都很好。

Everytime when I run the script, I am getting the error: 每次运行脚本时,都会出现错误:

PHP Fatal error: SOAP-ERROR: Parsing Schema: can't import schema from 'http://www.w3.org/2001/10/xml-exc-c14n#'

I dont know whether any php library or package is missing or not... Can anyone help me out? 我不知道是否缺少任何PHP库或软件包...有人可以帮我吗?

My wsdl file looks like: 我的wsdl文件如下所示:

<types>

 <schema targetNamespace="http://tempuri.org/myService.xsd"
  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:c14n="http://www.w3.org/2001/10/xml-exc-c14n#"
  xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
  xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"
  xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
  xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
  xmlns:myService="http://tempuri.org/myService.xsd"
  xmlns="http://www.w3.org/2001/XMLSchema"
  elementFormDefault="unqualified"
  attributeFormDefault="unqualified">
  <import namespace="http://www.w3.org/2001/10/xml-exc-c14n#" schemaLocation="http://www.w3.org/2001/10/xml-exc-c14n#"/>
  <import namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" schemaLocation="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"/>
  <import namespace="http://www.w3.org/2001/04/xmlenc#" schemaLocation="http://www.w3.org/2001/04/xmlenc#"/>
  <import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="http://www.w3.org/2000/09/xmldsig#"/>
  <import namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" schemaLocation="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"/>
  <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
....
....

Have you tried to open the url http://www.w3.org/2001/10/xml-exc-c14n# in your browser? 您是否尝试在浏览器中打开URL http://www.w3.org/2001/10/xml-exc-c14n# You'll see that it points to a webpage and not a schema as the next one http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd does. 您会看到它指向的是网页,而不是下一个http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd指向的架构。 In any case, using wsdl2php or WsdlToPhp will fire you this error. 无论如何,使用wsdl2php或WsdlToPhp都会引发此错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM