dpp34603 2013-09-01 13:36
浏览 48

使用nusoap获取服务器500错误

i want to use nusoap package to working with some webservices. according to documentation of nusoap, we first have to include nusoap.php to our php script and then write other codes...

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

but when i include nusoap.php to my code like this:

require_once('nusoap.php');

i get an server 500 error that says(IE 10):

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

but i dont understand what is the caus of it... i enabled error_reporting in php.ini but it doestnt show any error, it says server 500 error!!
whats's the problrm? how i can know more about the cause of this problem?

  • 写回答

1条回答 默认 最新

  • doulan8330 2014-01-06 14:58
    关注

    I recently had the exact same problem. This was the first webservice I created and I didn't know anything about, so the reason for my problem was my own foolishness.

    This was what it looked like:

    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);
    

    So you see, i just forgot to define the function..

    Following works:

    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);
    

    I hope I could help you.

    评论

报告相同问题?

悬赏问题

  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大