web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Consuming web services with PHP

(0) ShareShare
ReportReport
Posted on by

Hi, we're looking to implement Dynamics CRM 4 but our websites are PHP-based and they need a way to communicate to CRM. We've been struggling to find a way to consume the web services exposed by CRM and were wondering if anyone has come across this before.

We have confirmed that we can successfully consume .NET web services in PHP and vice-versa. And we have confirmed that we are able to talk to the server that CRM is on.

Our first hurdle seems to be that our calls are being rejected with an authentication failed 401 message. We're not sure whether this is because CrmService.asmx is rejecting our request because we've formed it incorrectly or because of some other factor.

Has anyone been through this exercise? Have any PHP code examples?

*This post is locked for comments

I have the same question (0)
  • Frode Stenstrom Profile Picture
    75 on at

    We run our customer support sites on a PHP framework (http://minside.tb.no). This site uses web services from CRM and a few other systems.

    PHP has a hard time consuming complex types and supporting authentication to crm, so we decided to create a Web Service proxy that stands between the PHP sites and CRM. This proxy also makes sure that Internet access to the CRM server is cut off. (There are many firewalls here.) 

    Thus, only a subset of the web services on the CRM server are available to the web sites.

    This works very well, but cost money to maintain.

    I can give you the code, if you decide to do the same setup. My only condition is that you then give me the code that you add. (Share and share alike :) )

    Let me know what you want over at http://twitter.com/frodeste or at my web site http://www.s-consulting.no. (Use the contact form at http://www.s-consulting.no/contact)

  • Community Member Profile Picture
    on at

    Thank you Frode and sorry for taking so long to respond. We've been battling this issue.

    We were aware that many people had taken the step to build an intermediate web service layer in .NET but found this to be an unacceptable solution.

    But I have good news; we have successfully managed to communicate directly (and securely) to Dynamics CRM from PHP using CRM's web services.

    Here's what we did:

    We first set up a virtual machine running XP and Visual Studio Web edition which we used to connect to the web service provided by CRM. We couldn't find a way to easily output the SOAP XML from .NET so we used WireShark to sniff it out. We then used this to replicate the calls to discovery service as well as the crm service from PHP using hand-written XML and CURL.

    We are now working to translate this across to PHP5's SoapClient class but at least we know we can use CURL if need be. No need for an inbetween web service.

  • Frode Stenstrom Profile Picture
    75 on at

    Good stuff.

    We will continue to use an web service "proxy" for many other purposes as well. (Ex hide Biztalk from the Internet). The proxy is used for datavalidation as well. If this wasn't the case, then I would drop the proxy all together.

  • Reliance Profile Picture
    80 on at

    Hello,

    We want to intergrate our .net application with MS CRM 4.0 Work group edition. We want to consume the Web Services provided by CRM 4.0 SDK. But we are not sure whether Work Group edition will support web services or not. as the licensing point of view It requires external connector license to connect to CRM 4.0 from external system . as CRM 4.0 does not support or provide external connector license. so what would be the best approach to use CRM 4.0 Webservices on a work group edition.Kindly let us know your valuable suggessions.

     

    I appreciate your help . thank you for your help

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans