本文介绍了SugarFullTest_Version2.php 在哪里?(糖 CRM 和 SOAP)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

有关用法的更多示例,请参阅/examples/SugarFullTest_Version2.php."

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

来源: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?

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

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.

推荐答案

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

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

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

For debugging and testing SoapUI is very helpful.

这篇关于SugarFullTest_Version2.php 在哪里?(糖 CRM 和 SOAP)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 00:07