Answered by:
Connecting to Dynamics CRM online through PHP?

Question
-
I am having a tough time trying to access content from MS Dynamics CRM through PHP. I'm wondering if there's even a possibility for that. Could someone please point to a useful resource that shows how to use php soap calls to connect to Dynamics CRM online? I know there's a 7 step process to authenticate and talk to the CRM service, (http://msdn.microsoft.com/en-us/library/dd548513.aspx) but thats all .NET example. The PHP MSCRM library on codeplex is only limited to premise install scenario. :(Thursday, April 14, 2011 2:41 PM
Answers
-
You can use nusoap PHP libarary. The speciality for the CRM webservice is the authentication-token which you need to change to Live authentication
//create contact
$soapHeader='<soap:Header>' .
'<CrmAuthenticationToken xmlns="http://schemas.microsoft.com/crm/2007/WebServices">' .
'<AuthenticationType xmlns="http://schemas.microsoft.com/crm/2007/CoreTypes">0</AuthenticationType>' .
'<OrganizationName xmlns="http://schemas.microsoft.com/crm/2007/CoreTypes">'.$your_organization.'</OrganizationName>' .
'<CallerId xmlns="http://schemas.microsoft.com/crm/2007/CoreTypes">00000000-0000-0000-0000-000000000000</CallerId>' .
'</CrmAuthenticationToken>' .
'</soap:Header>';For more details have look at following thread
http://social.microsoft.com/Forums/en/crm/thread/023ee195-18d4-49fb-88f3-6a8f63936583
- Vijay- Proposed as answer by vijay i Thursday, April 14, 2011 3:07 PM
- Marked as answer by Andrii ButenkoMVP, Moderator Wednesday, May 23, 2012 2:54 PM
Thursday, April 14, 2011 3:07 PM -
You can find the WSDL for the web services CRM exposes in the CRM web app in SETTINGS - customization - developer resources. Then it's just web services as usual in PHP
Then the other part of it is working with the SDK in CRM to determine what the soap messages look like so you can create them and send them to the service.
SDK Links:
For 4.0:
For 2011:
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=420f0f05-c226-4194-b7e1-f23ceaa83b69
Jamie Miley
http://mileyja.blogspot.com
Linked-In Profile
Follow Me on Twitter!- Proposed as answer by Jamie MileyModerator Thursday, April 14, 2011 3:27 PM
- Marked as answer by Andrii ButenkoMVP, Moderator Wednesday, May 23, 2012 2:54 PM
Thursday, April 14, 2011 3:27 PMModerator -
I have come across this article (http://www.21logs.com/php-and-microsoft-dynamics-crm-source-code/) which links to the sourceforge project (http://sourceforge.net/projects/php2dynamics/files/webclient/).
The code claims to be able to connect to Dynamics CRM 2011 online from PHP. I downloaded the code a few hours ago but I am having trouble getting it to work.
My progress:
1. I installed the code on my localhost (WAMP).
2. The login page is displayed and it authenticates successfully with Windows Live. I know this because if an incorrect password is entered, it displays an auth failed error message.
3. Looking at the code, it is supposed to display a list of organisations but nothing is displayed for me. This is as far as i've got.
If anyone manages to get it working, please post here. Meanwhile, I have emailed the developer and will post an update when i hear back.
--Edit
It works! I am in Australia meaning I had to change "crm" to "crm5" in the code as documented here: http://blogs.msdn.com/b/girishr/archive/2011/03/22/crm-online-2011-web-services-soap-sample-now-ready-for-emea-amp-asia.aspx
--End of Edit
- Edited by alfom88 Saturday, April 23, 2011 2:05 PM new information
- Marked as answer by Andrii ButenkoMVP, Moderator Wednesday, May 23, 2012 2:54 PM
Saturday, April 23, 2011 8:14 AM
All replies
-
You can use nusoap PHP libarary. The speciality for the CRM webservice is the authentication-token which you need to change to Live authentication
//create contact
$soapHeader='<soap:Header>' .
'<CrmAuthenticationToken xmlns="http://schemas.microsoft.com/crm/2007/WebServices">' .
'<AuthenticationType xmlns="http://schemas.microsoft.com/crm/2007/CoreTypes">0</AuthenticationType>' .
'<OrganizationName xmlns="http://schemas.microsoft.com/crm/2007/CoreTypes">'.$your_organization.'</OrganizationName>' .
'<CallerId xmlns="http://schemas.microsoft.com/crm/2007/CoreTypes">00000000-0000-0000-0000-000000000000</CallerId>' .
'</CrmAuthenticationToken>' .
'</soap:Header>';For more details have look at following thread
http://social.microsoft.com/Forums/en/crm/thread/023ee195-18d4-49fb-88f3-6a8f63936583
- Vijay- Proposed as answer by vijay i Thursday, April 14, 2011 3:07 PM
- Marked as answer by Andrii ButenkoMVP, Moderator Wednesday, May 23, 2012 2:54 PM
Thursday, April 14, 2011 3:07 PM -
You can find the WSDL for the web services CRM exposes in the CRM web app in SETTINGS - customization - developer resources. Then it's just web services as usual in PHP
Then the other part of it is working with the SDK in CRM to determine what the soap messages look like so you can create them and send them to the service.
SDK Links:
For 4.0:
For 2011:
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=420f0f05-c226-4194-b7e1-f23ceaa83b69
Jamie Miley
http://mileyja.blogspot.com
Linked-In Profile
Follow Me on Twitter!- Proposed as answer by Jamie MileyModerator Thursday, April 14, 2011 3:27 PM
- Marked as answer by Andrii ButenkoMVP, Moderator Wednesday, May 23, 2012 2:54 PM
Thursday, April 14, 2011 3:27 PMModerator -
I have come across this article (http://www.21logs.com/php-and-microsoft-dynamics-crm-source-code/) which links to the sourceforge project (http://sourceforge.net/projects/php2dynamics/files/webclient/).
The code claims to be able to connect to Dynamics CRM 2011 online from PHP. I downloaded the code a few hours ago but I am having trouble getting it to work.
My progress:
1. I installed the code on my localhost (WAMP).
2. The login page is displayed and it authenticates successfully with Windows Live. I know this because if an incorrect password is entered, it displays an auth failed error message.
3. Looking at the code, it is supposed to display a list of organisations but nothing is displayed for me. This is as far as i've got.
If anyone manages to get it working, please post here. Meanwhile, I have emailed the developer and will post an update when i hear back.
--Edit
It works! I am in Australia meaning I had to change "crm" to "crm5" in the code as documented here: http://blogs.msdn.com/b/girishr/archive/2011/03/22/crm-online-2011-web-services-soap-sample-now-ready-for-emea-amp-asia.aspx
--End of Edit
- Edited by alfom88 Saturday, April 23, 2011 2:05 PM new information
- Marked as answer by Andrii ButenkoMVP, Moderator Wednesday, May 23, 2012 2:54 PM
Saturday, April 23, 2011 8:14 AM -
Did you ever figure this out? If so, how and did any of these posts help?
Jamie Miley
Check out my about.me profile!
http://mileyja.blogspot.com
Linked-In Profile
Follow Me on Twitter!Tuesday, February 14, 2012 4:38 PMModerator