2015-09-01 14 views
0

我已經用php語言編寫了soap web服務,它在localhost上正常工作,但是當我在服務器上上傳時,我可以看到wsdl文件並在soapUI中添加它的URL,但是當我調用它顯示的內部函數服務器錯誤。爲什麼soap web服務在服務器上顯示內部服務器錯誤?

服務器的操作系統是centos6和PHP版本是php54和PHP肥皂已經存在。

有什麼不對?

<xs:element name="getServices"> 
<xs:complexType> 
<xs:sequence> 
<xs:element name="username" type="xs:string"/> 
<xs:element name="password" type="xs:string"/> 
<xs:element name="mobileNum" type="xs:string"/> 
</xs:sequence> 
</xs:complexType> 
</xs:element> 




$client = new SoapClient("http://IpAddress/ws/ws?wsdl"); 
     try { 
       $response = $client->getServices(
          array(
           'username'   => 'username', 
           'password'   => 'pass', 
           'mobileNum'  => '1111111', 
          )); 

       return $response; 
      } 
      catch(Exception $e) 
      { 
       return $e->getMessage(); 
     } 

回答

0

嘗試尋找服務器的錯誤日誌文件它會告訴你爲什麼發生錯誤的詳細說明。通常,當服務器無法執行腳本不是因爲廣告腳本一個錯誤,但由於其自身limiations,像max_execution時間,max_upload_size,post_size等

+0

我檢查錯誤日誌文件,但沒有錯誤,當我再次調用我的soapclient時,沒有任何東西被添加到這個錯誤日誌文件。 – h3dgh

+0

access.log – Arpita

+0

它只是顯示:[01/Sep/2015:11:53:18 +0430]「POST/patch HTTP/1.1」500 - 「 - 」「PHP-SOAP/5.5.6」 – h3dgh

0

您的WSDL缺少一些點發生

內部服務器錯誤:例如命名空間。

<?xml version="1.0" encoding="UTF-8"?> 
    <definitions name ="name" 
     targetNamespace="?" 
     xmlns:tns="?" 
     xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
     xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
     xmlns="http://schemas.xmlsoap.org/wsdl/"> 
     <xs:element name="getServices"> 
<xs:complexType> 
<xs:sequence> 
<xs:element name="username" type="xs:string"/> 
<xs:element name="password" type="xs:string"/> 
<xs:element name="mobileNum" type="xs:string"/> 
</xs:sequence> 
</xs:complexType> 
</xs:element> 
     </port> 
     </service> 
    </definitions>