一.REST 方式实现流程
1. 入口:http://www.example.com/sugar/service/v2/rest.php
代码如下:
$webservice_class ='SugarRestService';
$webservice_path ='service/core/SugarRestService.php';//rest 核心类
$webservice_impl_class ='SugarWebServiceImplv4';//最核心的method所在
$registry_class ='registry'; //注册一些函数
$location ='/service/v4/rest.php';//代表本文件路径
$registry_path ='service/v4/registry.php';//注册函数的文件路径
require_once('service/core/webservice.php');//启动程序
2. 启动程序:http://www.example.com/sugar/service/core/webservice.php
代码如下:
/*** This file intializethe service class and does all the setters based on the values provided insoap/rest entry point and calls serve method which takes the request and sendresponse back to the client */
require_once($webservice_path);//include SugarRestService class
require_once($registry_path);.