2014-02-12 157 views
0

我試圖用我的PHP SOAP客戶端發送測試消息。我使用的是BeSimpleSoap庫,因爲我在標準的PHP SOAP calss和NuSOAP類中遇到了問題。在scriptis的 部分是:致命錯誤:未捕獲SoapFault異常:[env:Client]內部錯誤

 $client = new BeSimple\SoapClient\SoapClient("GSBService.wsdl", array( 
         "trace"=>1, 
         "exceptions"=>1, 
         'location'=>$SERVICE_TEST, 
         "local_cert" =>$SOAP_cert, 
         'uri'=>$NAMESPACE_URI, 
         "passphrase"=>$cert_password, 
          "connection_timeout" => 60)); 

     var_dump($client->echo('abc1234')); 
     print_r($client->sendMessage($par_envelope)); 



     echo "<p>Request :".htmlspecialchars($client->__getLastRequest()) ."</p>"; 
     echo "<p>Response:".htmlspecialchars($client->__getLastResponse())."</p>"; 
     echo "<p>Debug:".soapDebug($client)."</p>"; 

錯誤是:

string(57) "Request: 'abc1234'. Response: '2014-02-12T09:39:56.474Z'." 
Fatal error: Uncaught SoapFault exception: [env:Client] Internal Error in C:\xampp\htdocs\NIAS\HZZO-OKP-SOAP.php:146 Stack trace: #0 C:\xampp\htdocs\NIAS\HZZO-OKP-SOAP.php(146): SoapClient->__call('sendMessage', Array) #1 C:\xampp\htdocs\NIAS\HZZO-OKP-SOAP.php(146): BeSimple\SoapClient\SoapClient->sendMessage(Array) #2 {main} thrown in C:\xampp\htdocs\NIAS\HZZO-OKP-SOAP.php on line 146 

我想:

ini_set('soap.wsdl_cache_enabled',0); 

,並得到這個:

Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing Schema: can't import schema from 'file:///schema/GSBSchema.xsd' in C:\xampp\htdocs\NIAS\BeSimpleSoap-master\src\BeSimple\SoapClient\SoapClient.php:113 Stack trace: #0 C:\xampp\htdocs\NIAS\BeSimpleSoap-master\src\BeSimple\SoapClient\SoapClient.php(113): SoapClient->SoapClient('\wsdl_9429a1dff...', Array) #1 C:\xampp\htdocs\NIAS\HZZO-OKP-SOAP.php(134): BeSimple\SoapClient\SoapClient->__construct('GSBService.wsdl', Array) #2 {main} thrown in C:\xampp\htdocs\NIAS\BeSimpleSoap-master\src\BeSimple\SoapClient\SoapClient.php on line 113 

回答

0

的問題是在編碼$par_envelope。 我用UTF-8編碼字符串後用utf8_encode我沒有得到 Fatal error: Uncaught SoapFault exception: [env:Client] Internal Error

相關問題