簡體   English   中英

使用nusoap獲取服務器500錯誤

[英]getting server 500 error with nusoap

我想使用nusoap軟件包來使用某些Web服務。 根據nusoap的文檔,我們首先必須將nusoap.php包含到我們的php腳本中,然后編寫其他代碼...

http://www.scottnichol.com/nusoapintro.htm

但是當我將nusoap.php包含在我的代碼中時,如下所示:

require_once('nusoap.php');

我收到說(IE 10)的服務器500錯誤:

 Most likely causes:
    •The website is under maintenance.
    •The website has a programming error.

但是我不明白它的原因是什么...我在php.ini中啟用了error_reporting,但是它並沒有顯示任何錯誤,它說服務器500錯誤!
問題是什么? 我如何才能更多地了解此問題的原因?

我最近有完全相同的問題。 這是我創建的第一個Web服務,但我對此一無所知,所以出現問題的原因是我自己的愚蠢。

看起來是這樣的:

error_reporting(E_ALL);
require_once("lib/nusoap.php");
$namespace = "http://www.mywebsite.com/services";

$server = new soap_server();
$server->configureWSDL("TestService");
$server->wsdl->schemaTargetNamespace = $namespace;

$server->register('TestFunction', array('test'=>'xsd:string'), array('return'=>'xsd:string'), $namespace, false, 'rpc', 'encoded', 'Function for evaluation of SOAP');

$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);

所以你看,我只是忘記定義函數了。

以下作品:

error_reporting(E_ALL);
require_once("lib/nusoap.php");
$namespace = "http://www.mywebsite.com/services";

$server = new soap_server();
$server->configureWSDL("TestService");
$server->wsdl->schemaTargetNamespace = $namespace;

$server->register('TestFunction', array('test'=>'xsd:string'), array('return'=>'xsd:string'), $namespace, false, 'rpc', 'encoded', 'Function for evaluation of SOAP');

function TestFunction($test) {
    return "Response: ".$test;
}

$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);

希望能對您有所幫助。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM