[英]PHP Soap Server: instantiate with a string (xml string) instead of WSDL file (url to it)
Soap Server的PHP页面(我已经看过了):
http://www.php.net/manual/en/soapserver.soapserver.php
但是我错过了一个重要的缺乏文档,因为我自己的问题:
我需要知道是否可以使用XML字符串直接实例化服务器,就像SimpleXML
类一样:
//From var (the one I want):
$movies = new SimpleXMLElement($xmlstr);
要么
//From file and from string (the one I want):
$xml = simplexml_load_file('test.xml');
$xml = simplexml_load_string($string);
所以我想做这样的事情:
$wsdl_cont = file_get_contents("../xmls/mywsdl.wsdl");
$server = new SoapServer($wsdl_cont);
可能吗?
原因是,因为我有一些不同的URL必须使用相同的XML,所以我需要在模板URL上动态替换,并将其更改为正确的URL,然后加载WSDL。 但我不想在硬盘上保存即时生成的WSDL,以便在读取后立即将其删除。
是否有可能在PHP上创建某种“虚拟文件”并使用它,就像它是一个磁盘读取一样? 某种流缓冲? 还是某种文件描述符?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.