所以我有一个WSDL作为肥皂服务的文档.我需要完全按照定义实现此服务,并且我不想使用nusoap重写wsdl.有没有办法告诉对象nusoap_server = new soap_server();使用现有的wsdl,然后从现有的wsdl实现功能?
谢谢
解决方法:
$WSDL =’/路径/到/ wsdl /文件’;
$nusoap_server =新的soap_server($WSDL);
唯一的问题是nusoap可能无法正确创建响应,但是它将托管wsdl文件.
我必须自定义我的xml响应.
您可以告诉nusoap这样做,但是您需要修改库.
function serialize_return() {
//$this->fuze_debug(array('test',$this->fuze_print_s($this->methodreturn)),'soap_server_debug.log');
$this->debug('Entering serialize_return methodname: ' . $this->methodname . ' methodURI: ' . $this->methodURI);
// if fault
if (isset($this->methodreturn) && is_object($this->methodreturn) && ((get_class($this->methodreturn) == 'soap_fault') || (get_class($this->methodreturn) == 'nusoap_fault'))) {
$this->debug('got a fault object from method');
$this->fault = $this->methodreturn;
return;
// for some reason with code ignitor this doesnot get set correctly
} elseif ($this->methodreturnisliteralxml) {
//$this->fuze_debug(array('literal xml is : ',$this->fuze_print_s($this->methodreturnisliteralxml)),'soap_server_debug.log');
$return_val = $this->methodreturn;
// returned value(s)
} else {
上面的代码在nusoap库中,您可以看到$this-> methodreturnisliteralxml
如果将其设置为true,则可以自定义从为nusoap处理soap请求的函数返回的xml.
对我来说,nusoap接缝已经过时了.
我认为我不会在新项目中再次使用nusoap.
标签:nusoap,php,soap,wsdl
来源: https://codeday.me/bug/20191013/1910681.html