Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Web services opencart的nusoap实现_Web Services_Nusoap_Opencart - Fatal编程技术网

Web services opencart的nusoap实现

Web services opencart的nusoap实现,web-services,nusoap,opencart,Web Services,Nusoap,Opencart,希望这里有人熟悉OpenCart。我在OpenCart上的Nusoap实现有问题。这是我的实现 我创建了一个名为ws.php的新库文件(我在system/library/中有整个nusoap文件夹) $this->nusoap\u server->service(文件获取内容)php://input")); } } ?> 这是我的soap客户端,驻留在OpenCart之外的应用程序上 $nusoap_客户端=新建 nusoap_客户(“http://localhost/opencart/in

希望这里有人熟悉OpenCart。我在OpenCart上的Nusoap实现有问题。这是我的实现

  • 我创建了一个名为ws.php的新库文件(我在system/library/中有整个nusoap文件夹)
  • $this->nusoap\u server->service(文件获取内容)php://input")); } } ?>

  • 这是我的soap客户端,驻留在OpenCart之外的应用程序上
  • $nusoap_客户端=新建 nusoap_客户(“http://localhost/opencart/index.php?route=webservice/ws"); $id=90001;如果($nusoap_客户端->故障) { $text='Error:'。$nusoap_client->fault

        }
        else
        {
            if ($nusoap_client->getError())
            {
                $text = 'Error: '.$nusoap_client->getError();
            }
            else
            {
              $row = $nusoap_client->call(
                    'selectMemberInfo',
                    array($id),
                    'urn:MemberWSDL',
                    'urn:MemberWSDL#selectMemberInfo'
                );
                echo
    
    ''.htmlspecialchars($nusoap_客户->响应, ",; } }

      function index(){
    
          $this->nusoap_server->service(file_get_contents("php://input"));
    
      }
    
      function select_member_info() {
            function selectMemberInfo($member_id) {
              return 'hello';
            }
    
    ?>

    这就是我得到的

    HTTP/1.1 500内部服务器错误服务器:Microsoft IIS/5.1日期: 2011年10月4日星期二04:47:41 GMT内容类型:text/xml; charset=ISO-8859-1 X-Powered-By:PHP/5.3.1 Set Cookie: PHPSESSID=fas5fisb84rcs3g94njljhrhk4;path=/Expires:1981年11月19日星期四 08:52:00 GMT缓存控制:无存储,无缓存,必须重新验证, 后检查=0,预检查=0 Pragma:no cache Set Cookie:language=en; expires=周四,2011年11月3日04:47:41格林威治标准时间;路径=/;域=本地主机 设置Cookie:currency=MYR;expires=周四,2011年11月3日04:47:41格林威治标准时间; 路径=/;域=本地主机服务器:NuSOAP服务器v0.7.3 X-SOAP-Server: NuSOAP/0.7.3(1.114)内容长度:692

    xmlns:SOAP-ENV=”http://schemas.xmlsoap.org/soap/envelope/“
    xmlns:xsd=”http://www.w3.org/2001/XMLSchema“
    xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance“
    xmlns:SOAP-ENC=”http://schemas.xmlsoap.org/soap/encoding/"> SOAP-ENV:Clientmethod'选择MemberInfo'未定义 在职

    有没有人尝试过在OpenCart中实现Nusoap/SOAP,或者知道我的实现中出现了什么问题


    提前谢谢。

    我也有同样的问题。但是我意识到如果你把
    select\u member\u info()
    放在主类之外,它就工作了


    一旦我得到一个有效的解决方案,我会再写一次。

    你试过调试代码吗?
      function index(){
    
          $this->nusoap_server->service(file_get_contents("php://input"));
    
      }
    
      function select_member_info() {
            function selectMemberInfo($member_id) {
              return 'hello';
            }
    
        }
        else
        {
            if ($nusoap_client->getError())
            {
                $text = 'Error: '.$nusoap_client->getError();
            }
            else
            {
              $row = $nusoap_client->call(
                    'selectMemberInfo',
                    array($id),
                    'urn:MemberWSDL',
                    'urn:MemberWSDL#selectMemberInfo'
                );
                echo
    
    '.htmlspecialchars($nusoap_client->response, ENT_QUOTES).'