TCP 连接由对等方重置 - Salesforce - PHP



在使用 Web 服务发送潜在客户信息后,我们突然开始收到来自"Salesforce"的"对等方重置 TCP 连接"响应。

我们端使用的技术堆栈: 操作系统: Redhat Linux (RHEL( 网络服务器:阿帕奇 网页脚本语言:PHP 使用 CURL 发送详细信息。

用于向 Salesforce 发送请求的潜在客户生成的代码片段是....

/*****************************************************************************************************/
/* Purpose           : Sending request to sales-force for lead generation
/* Inputs       : $pStrPostArr :: Post data array.
/* Returns      : None.
/* Created By   : Jaiswar Vipin Kumar R.
/*****************************************************************************************************/
function send($pStrPostArr = array()){
/* if post data is empty then do needful */
if (empty($pStrPostArr)){
/* return status */
return false;
}
/* set POST variables */
$strDestiantionURL = 'https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8';
/* removed used index */
unset($pStrPostArr['desitnationURL']);
/* if destination URL is not set then do needful */
if (empty($strDestiantionURL)){
/* return status */
return false;
}
/* variable initialization */
$strFields = '';

/* url-ify the data for the POST */
foreach($pStrPostArr as $strKey=>$strValue) { 
if($strFields == ''){
$strFields .= $strKey.'='.$strValue;
}else{
$strFields .= '&'.$strKey.'='.$strValue; 
}
}
// rtrim($strFields,'&');
if(isset($_COOKIE['debug'])){
//print_r($pStrPostArr);
echo $strFields;exit;
}
/* open connection */
$ch = curl_init($strDestiantionURL);
/* set the url, number of POST vars, POST data */
curl_setopt($ch,CURLOPT_URL,$strDestiantionURL);
curl_setopt($ch,CURLOPT_POST,count($pStrPostArr));
curl_setopt($ch,CURLOPT_POSTFIELDS,$strFields);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch,CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch,CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2);

/* execute post */
$this->_strReponse           = curl_exec($ch);
/* Request Body */
$this->_strRequestBody     = curl_getinfo($ch);
if($this->_strReponse === FALSE){
$this->_strError     = curl_error($ch);
}
/* close connection */
curl_close($ch);
}

和发送潜在客户信息数据集是:

Array
(
[desitnationURL] => https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8
[first_name] => Jaiswar
[last_name] => Vipin+Kumar+R
[company] => PocketApp
[job_title__c] => 
[country_c__c] => 
[appdetail] => app development & designing
[email] => vipin.jaiswar%40pocketapp.co.uk
[phone] => %2B919773596947
[Lead_Budget__c] => Undisclosed
[description] => Fill+out+the+form+below+with+your+requirments+and+we+will+get+back+to+you+as+soon+as+possible.+Alternatively%2C+send+an+email+to+sales%40pocketapp.co.uk+or+give+us+a+call+on+%2B44+20+7183+4388
[oid] => XXXXXXXXXXXXXXX
[sfga] => XXXXXXXXXXXXXXX
[retURL] => https://www.pocketapp.co.uk/thank-you/
[lead_source] => Web
[source__c] => https://www.semrush.com/siteaudit/campaign/472189/review/
[medium__c] => -
[campaign__c] => -
[term__c] => -
[content__c] => 
[Visitor_ID__c] => -
[gclid__c] => -
[Count_of_Sessions__c] => 1
[Count_of_Pageviews__c] => 1
[00ND0000006RIpG] => 
[00ND0000006RHJY] => 
[00ND0000006RHJd] => 
[00ND0000006RHJi] => 
[00ND0000006RHJs] => 
[00ND0000006RHJn] => 
[00ND00000064Guy] => 
[00ND00000064Gv3] => 
)

您能否帮助我们,我们需要做出哪些改变才能使它开始工作?

Salesforce 移动了 web2lead 端点,您需要更改目标 URL 以使用 webto.salesforce.com 而不是 www.salesforce.com 请参阅此知识库文章。

相关内容

  • 没有找到相关文章

最新更新