Nusoap use existing WSDL how to?

寵の児 提交于 2019-12-02 05:08:22

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

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

I had to customize my xml responses.

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 {

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

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.

To me nusoap seams to be out of date.

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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!