Nusoap如何使用现有的WSDL? [英] Nusoap use existing WSDL how to?

查看:37
本文介绍了Nusoap如何使用现有的WSDL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我有一个 WSDL,我一直作为肥皂服务的文档提供.我需要完全按照定义来实现这个服务,我不想使用 nusoap 重写 wsdl.有没有办法告诉对象 nusoap_server = new soap_server();使用现有的 wsdl,然后实现现有 wsdl 的功能?

so I have a WSDL I've been giving as documentation for a soap service. I need to implement this service exactly as defined and I don't want to rewrite the wsdl using nusoap. Is there a way to tell the object nusoap_server = new soap_server(); to use an existing wsdl and then implement the functions from the existing wsdl?

谢谢

推荐答案

$WSDL = '/path/to/wsdl/file';$nusoap_server = 新的soap_server($WSDL);

$WSDL = '/path/to/wsdl/file'; $nusoap_server = new soap_server($WSDL);

唯一的问题是 nusoap 可能无法正确创建响应,但它会托管 wsdl 文件.

The only problem with this is that nusoap may not create the response correctly, but it will host the wsdl file.

我必须自定义我的 xml 响应.

I had to customize my xml responses.

您可以告诉 nusoap 做什么,但您需要修改库.

Which you can tell nusoap to do but you will need to modify the library.

<?PHP     

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

This above code is in the nusoap library as you can see $this->methodreturnisliteralxml

如果您将其设置为 true,那么您可以自定义从您为 nusoap 定义的函数返回的 xml,以处理soap 请求.

If you set that to true then you can customize the xml you return from the function you define for nusoap to handle the soap request.

对我来说 nusoap 接缝已经过时了.

To me nusoap seams to be out of date.

我不认为我会在新项目中再次使用 nusoap.

I do not think I would use nusoap again for new projects.

这篇关于Nusoap如何使用现有的WSDL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆