• JMcIvor
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 11
    Replies
We are experiencing an issue where sometimes we cannot log into SalesForce using the following code. It seems to work about 90-95% of the time, but every now and then it fails, and causes a 404 page – the error shown is “Could not connect to host.”. The username and password we’re using (i.e. $this->SF_username) are both valid as it works most of the time.

The issue seems to lie in the “$this->sforce->login” part of the following code, which I believe is handled on the SalesForce end. I can’t find any (code) declaration of that login() function in the “sforce” SoapClient object, though it is present in the “partner.wsdl.xml” XML file. I’ve tried assigning the result of “$this->sforce->login()” to a variable and printing it, but when the login() function fails, it doesn’t get that far, it just triggers the 404 page.

1)
file_one.php:
$mySforceConnection = $joomlaSf->getSFConnection();

2)
file_two.php:

function getSFConnection()
{
if ($mySforceConnection->createConnection(JPATH_BASE . '/custom_files/SF_sync/soapclient/partner.wsdl.xml')) {
$mySforceConnection = new SforcePartnerClient();
$mySforceConnection->login($this->SF_username, $this->SF_password);
}
}

3)
SF_sync/soapclient/SforceBaseClient.php:
public function login($username, $password) {
$this->sforce->__setSoapHeaders(NULL);
if ($this->callOptions != NULL) {
$this->sforce->__setSoapHeaders(array($this->callOptions));
}
if ($this->loginScopeHeader != NULL) {
$this->sforce->__setSoapHeaders(array($this->loginScopeHeader));
}

// The following function seems to be causing the issue.
$result = $this->sforce->login(array (
'username' => $username,
'password' => $password
));

$result = $result->result;
$this->_setLoginHeader($result);
return $result;
}

Does anyone have any insight as to why this happens, and possible solutions to fix this?

Hello,

 

I have created the WSDL Enterprise file in the Setup and I have added the Web Reference in Visual Studio 2010 I am receiving the following errors:

 

Error 1 Custom tool error: Unable to import WebService/Schema. Unable to import binding 'SoapBinding' from namespace 'urn:enterprise.soap.sforce.com'. Unable to import operation 'create'. The datatype 'urn:sobject.enterprise.soap.sforce.com:RecordType' is missing.

 

Error 2 Custom tool error: Unable to import WebService/Schema. Unable to import binding 'SoapBinding' from namespace 'urn:enterprise.soap.sforce.com'. Unable to import operation 'create'. The datatype 'urn:sobject.enterprise.soap.sforce.com:RecordType' is missing.

 

These errors are in the Settings.settings file and Reference.map file respectively. Any help you could provide would be greatly appreciated.

We are experiencing an issue where sometimes we cannot log into SalesForce using the following code. It seems to work about 90-95% of the time, but every now and then it fails, and causes a 404 page – the error shown is “Could not connect to host.”. The username and password we’re using (i.e. $this->SF_username) are both valid as it works most of the time.

The issue seems to lie in the “$this->sforce->login” part of the following code, which I believe is handled on the SalesForce end. I can’t find any (code) declaration of that login() function in the “sforce” SoapClient object, though it is present in the “partner.wsdl.xml” XML file. I’ve tried assigning the result of “$this->sforce->login()” to a variable and printing it, but when the login() function fails, it doesn’t get that far, it just triggers the 404 page.

1)
file_one.php:
$mySforceConnection = $joomlaSf->getSFConnection();

2)
file_two.php:

function getSFConnection()
{
if ($mySforceConnection->createConnection(JPATH_BASE . '/custom_files/SF_sync/soapclient/partner.wsdl.xml')) {
$mySforceConnection = new SforcePartnerClient();
$mySforceConnection->login($this->SF_username, $this->SF_password);
}
}

3)
SF_sync/soapclient/SforceBaseClient.php:
public function login($username, $password) {
$this->sforce->__setSoapHeaders(NULL);
if ($this->callOptions != NULL) {
$this->sforce->__setSoapHeaders(array($this->callOptions));
}
if ($this->loginScopeHeader != NULL) {
$this->sforce->__setSoapHeaders(array($this->loginScopeHeader));
}

// The following function seems to be causing the issue.
$result = $this->sforce->login(array (
'username' => $username,
'password' => $password
));

$result = $result->result;
$this->_setLoginHeader($result);
return $result;
}

Does anyone have any insight as to why this happens, and possible solutions to fix this?
How many records can we delete with API Request Limit of 22600?

Hello,

 

I have created the WSDL Enterprise file in the Setup and I have added the Web Reference in Visual Studio 2010 I am receiving the following errors:

 

Error 1 Custom tool error: Unable to import WebService/Schema. Unable to import binding 'SoapBinding' from namespace 'urn:enterprise.soap.sforce.com'. Unable to import operation 'create'. The datatype 'urn:sobject.enterprise.soap.sforce.com:RecordType' is missing.

 

Error 2 Custom tool error: Unable to import WebService/Schema. Unable to import binding 'SoapBinding' from namespace 'urn:enterprise.soap.sforce.com'. Unable to import operation 'create'. The datatype 'urn:sobject.enterprise.soap.sforce.com:RecordType' is missing.

 

These errors are in the Settings.settings file and Reference.map file respectively. Any help you could provide would be greatly appreciated.