SugarFullTest_Version2.php 在哪里? (Sugar CRM 和 SOAP)

发布于 2024-10-25 06:23:46 字数 569 浏览 6 评论 0原文

关于使用 SOAP 连接到 Sugar CRM,Sugar 6.1 Community Edition 的文档指出:

“有关使用的更多示例,请参阅 /examples/SugarFullTest_Version2.php。”

来源: http: //developers.sugarcrm.com/docs/OS/6.1/-docs-Developer_Guides-Sugar_Developer_Guide_6.1.0-Chapter%202%20Application%20Framework.html#9000244

此文件不在示例文件夹中。它在哪里?

如果此文件不存在,我在哪里可以找到使用 SOAP 连接到 Sugar CRM 的工作示例? /examples/ 文件夹中的所有测试脚本都不起作用。

In regards to using SOAP to connect to Sugar CRM, the documentation for Sugar 6.1 Community Edition states:

"See /examples/SugarFullTest_Version2.php for more examples on usage."

source:
http://developers.sugarcrm.com/docs/OS/6.1/-docs-Developer_Guides-Sugar_Developer_Guide_6.1.0-Chapter%202%20Application%20Framework.html#9000244

This file is not in the examples folder. Where is it?

If this file does not exist, where can I find a working example of connecting to Sugar CRM with SOAP? None of the test scripts in the /examples/ folder work.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

等风来 2024-11-01 06:23:46

也找不到该文件,因此为您制作了一个示例(连接到 SugarCRM v6 SOAP 的 PHP 脚本)。

<?php
require_once('include/nusoap/lib/nusoap.php');

$myWsdl = 'http://mysite.com/soap.php?wsdl';
$myAuth = array(
    'user_name' => 'xxxx',
    'password' => MD5('xxxx'),
    'version' => '0.1'
);
$soapClient = new nusoap_client($myWsdl,true);

// Create lead
// (Can be made without login, i.e. sessionid)
$leadParams = array('user_name' => 'xxxx',
    'password' => MD5('xxxx'), 
    'first_name' => 'Test',
    'last_name' => '2',
    'email_address' => '2@'
);
$leadResult = $soapClient->call('create_lead', $leadParams);
$leadId = $leadResult;
print_r($leadResult);

// Login
$loginParams = array('user_auth' => $myAuth, 'application_name' => 'WebForm');
$loginResult = $soapClient->call('login', $loginParams);
$sessionId = $loginResult['id'];

// Modules
// (Need login, so sessionID is used)
$modulesResult = $soapClient->call('get_available_modules', array('session' => $sessionId));
print_r($modulesResult);

// Get account list
$accountParams = array('session' => $sessionId,
    'module_name' => 'Accounts',
    'query' => "accounts.name = 'Amarelo'",
    'order_by' => '',
    'deleted' => 0
);
$accountResult = $soapClient->call('get_entry_list', $accountParams);
print_r($accountResult);

// Get entry
$leadParams = array('session' => $sessionId,
    'module_name' => 'Leads',
    'id' => "$leadId"
);
$leadResult = $soapClient->call('get_entry', $leadParams);
print_r($leadResult);

// Logout
$logoutResult = $soapClient->call('logout', array('session' => $sessionId));
?>

对于调试和测试 SoapUI 非常有帮助。

Couldn't find the file either, so made an example (PHP script connecting to sugarCRM v6 SOAP) for you.

<?php
require_once('include/nusoap/lib/nusoap.php');

$myWsdl = 'http://mysite.com/soap.php?wsdl';
$myAuth = array(
    'user_name' => 'xxxx',
    'password' => MD5('xxxx'),
    'version' => '0.1'
);
$soapClient = new nusoap_client($myWsdl,true);

// Create lead
// (Can be made without login, i.e. sessionid)
$leadParams = array('user_name' => 'xxxx',
    'password' => MD5('xxxx'), 
    'first_name' => 'Test',
    'last_name' => '2',
    'email_address' => '2@'
);
$leadResult = $soapClient->call('create_lead', $leadParams);
$leadId = $leadResult;
print_r($leadResult);

// Login
$loginParams = array('user_auth' => $myAuth, 'application_name' => 'WebForm');
$loginResult = $soapClient->call('login', $loginParams);
$sessionId = $loginResult['id'];

// Modules
// (Need login, so sessionID is used)
$modulesResult = $soapClient->call('get_available_modules', array('session' => $sessionId));
print_r($modulesResult);

// Get account list
$accountParams = array('session' => $sessionId,
    'module_name' => 'Accounts',
    'query' => "accounts.name = 'Amarelo'",
    'order_by' => '',
    'deleted' => 0
);
$accountResult = $soapClient->call('get_entry_list', $accountParams);
print_r($accountResult);

// Get entry
$leadParams = array('session' => $sessionId,
    'module_name' => 'Leads',
    'id' => "$leadId"
);
$leadResult = $soapClient->call('get_entry', $leadParams);
print_r($leadResult);

// Logout
$logoutResult = $soapClient->call('logout', array('session' => $sessionId));
?>

For debugging and testing SoapUI is very helpful.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文