php nusoap wsdl,PHP-Nusoap使用现有的WSDL如何?

所以我有一个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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值