2011-11-29 52 views
1

所以我有一個WSDL我一直在作爲一個肥皂服務的文檔。我需要完全按照定義來實現這個服務,我不想用nusoap來重寫wsdl。有沒有辦法告訴對象nusoap_server = new soap_server();使用現有的wsdl,然後從現有的wsdl中實現這些功能?Nusoap使用現有的WSDL如何?

感謝

回答

0

$ WSDL = '/路徑/到/ WSDL /文件'; $ nusoap_server = new soap_server($ WSDL);

唯一的問題是nusoap可能無法正確創建響應,但它將承載wsdl文件。我不得不自定義我的XML響應。

你可以告訴nusoap做,但你需要修改庫。

<?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庫,你可以看到這 - $> methodreturnisliteralxml

如果設置爲true,那麼你可以定製你從函數返回你定義的NuSOAP到XML處理肥皂請求。

對我來說nusoap縫是過時的。

我不認爲我會再次使用nusoap新項目。