I had a requirement to connect CRM Online to a Drupal website. As I didn't have the benefit of writing a custom web service I used the CRM SOAP interface and PHP.
This was working fine for months however in the last week and a bit this has stopped working. I can retrieve the required tokens for authentication however any request I send off results in a blank response.
I'm presuming something has on CRM Online. So I guess my question is has anybody noticed this and does anyone have a fix?
*This post is locked for comments
Glad you fixed the problem and thanks for posting up your solution Andrew!
2007 is deprecated in 2013 but it still works. In 2015 it's completely gone.
Looks like that's the case Guido!
Looks like they might have started early as that says 7th of December.
Andre,
The 2007 Endpoint is deprecated in CRM 2013 I thought??
Anyway I have just discovered the answer.
The following is a snapshot of my code
$cURLHandle = curl_init();
curl_setopt($cURLHandle, CURLOPT_URL, $soapUrl);
curl_setopt($cURLHandle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($cURLHandle, CURLOPT_TIMEOUT, 60);
curl_setopt($cURLHandle, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($cURLHandle, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($cURLHandle, CURLOPT_SSLVERSION, 3);
curl_setopt($cURLHandle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($cURLHandle, CURLOPT_HTTPHEADER, $headers);
curl_setopt($cURLHandle, CURLOPT_POST, 1);
curl_setopt($cURLHandle, CURLOPT_POSTFIELDS, $request);
$response = curl_exec($cURLHandle);
curl_close($cURLHandle);
Two things needed to be fixed here. Firstly I was doing nothing when there was an issue here where I really should be replacing this line
$response = curl_exec($cURLHandle);
With this
if( ! $response = curl_exec($cURLHandle))
{
trigger_error(curl_error($cURLHandle));
}
And secondly it appears the SSL version being used has been modified at the Microsoft end presumably. By changing this line
curl_setopt($cURLHandle, CURLOPT_SSLVERSION, 3);
To version 4 instead of 3 it started working! So instead of this i've just commented out this line entirely.
Hope this helps someone else!
Btw, which endpoint that you are using for the SOAP call? The 2011 one or 2007 one?
AFAIK, with the upcoming CRM 2015 release, that might be rolled-out or soon to be to the CRM Online instances, the 2007 endpoint is going to be deprecated.
Andre,
Yeah thought this might be the issue however I have tested this and the username and password work correctly.
Not sure whether it might be relevant or not.
I found one of my integration job with CRM Online was not working after a couple months of the deployment was due to the password expiry of the user that configured for the integration.
I need to investigate further to see if there is an error however I haven't caught any SOAP exceptions yet.
The request for authentication tokens works. Then any call (trying the WhoAmIRequest in particular) is returning nothing.
As I said there has been no code change from our end however as its connected to CRM Online i'm guessing there might have been a change on Microsoft's side.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,134 Super User 2024 Season 2
Martin Dráb 229,928 Most Valuable Professional
nmaenpaa 101,156