Answered by:
Creating a WCF web service that will be comsumed by a PHP web app

Question
-
Hi. I need to develop a web service for our Property Management System. I've never developed a web service before (although I've consumed web services one or twice from my .Net WinForms app). I've been doing a little bit of research and it appears that WCF is the way to go today as far as .Net development is concerned. (If I am wrong, please correct me).
However, I want to make sure that the WCF web service will be able to be consumed by a PHP 5.5 web app. Is there anything special I need to do to make sure the PHP 5.5 web app that is being developed alongside my WCF web service will be able to connect and interact with the web service? I understand web services work on industry standard XML/SOAP/HTTP technologies, so I am assuming that, although I am developing the web service in Microsoft's proprietary .NET platform, ultimately it will expose itself in the aforementioned open technologies? And therefore the PHP web app should have no trouble consuming said web service? Am I correct in this assumption?
Thank you
Fabricio Rodriguez Pretoria, South Africa
- Edited by Fabs1977 Tuesday, November 5, 2013 8:25 AM
Tuesday, November 5, 2013 8:25 AM
Answers
-
Hi Fabs1977,
For WCF service which need to be interop with various client platform, we can build it as a standard SOAP service. Thus, any client (like PHP or java) that supports XML soap can consume the service:
- #Using WCF Services with PHP
http://gunnarpeipman.com/2007/09/using-wcf-services-with-php/ - #Using WCF Services With PHP 5
http://cgeers.com/2009/08/20/using-wcf-services-with-php-5/ - #Expose WCF 4.0 Service as SOAP and REST
http://www.dotnetcurry.com/ShowArticle.aspx?ID=728
Another option is to build the service as a REST service. REST service can be consumed via plain HTTP GET/POST request. Thus, we can easily access REST service from various client like web page(javascript), winform, WPF, etc...
- #An Introduction To RESTful Services With WCF
http://msdn.microsoft.com/en-us/magazine/dd315413.aspx - #WCF Web HTTP Programming Model Overview
http://msdn.microsoft.com/en-us/library/bb412172.aspx
#WCF REST Service Template 40(CS)
http://visualstudiogallery.msdn.microsoft.com/fbc7e5c1-a0d2-41bd-9d7b-e54c845394cd
<THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
Thanks
MSDN Community Support
Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.- Marked as answer by Amy PengMicrosoft employee Tuesday, November 12, 2013 2:10 AM
Wednesday, November 6, 2013 6:22 AM - #Using WCF Services with PHP
All replies
-
Hi Fabs1977,
For WCF service which need to be interop with various client platform, we can build it as a standard SOAP service. Thus, any client (like PHP or java) that supports XML soap can consume the service:
- #Using WCF Services with PHP
http://gunnarpeipman.com/2007/09/using-wcf-services-with-php/ - #Using WCF Services With PHP 5
http://cgeers.com/2009/08/20/using-wcf-services-with-php-5/ - #Expose WCF 4.0 Service as SOAP and REST
http://www.dotnetcurry.com/ShowArticle.aspx?ID=728
Another option is to build the service as a REST service. REST service can be consumed via plain HTTP GET/POST request. Thus, we can easily access REST service from various client like web page(javascript), winform, WPF, etc...
- #An Introduction To RESTful Services With WCF
http://msdn.microsoft.com/en-us/magazine/dd315413.aspx - #WCF Web HTTP Programming Model Overview
http://msdn.microsoft.com/en-us/library/bb412172.aspx
#WCF REST Service Template 40(CS)
http://visualstudiogallery.msdn.microsoft.com/fbc7e5c1-a0d2-41bd-9d7b-e54c845394cd
<THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
Thanks
MSDN Community Support
Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.- Marked as answer by Amy PengMicrosoft employee Tuesday, November 12, 2013 2:10 AM
Wednesday, November 6, 2013 6:22 AM - #Using WCF Services with PHP
-
Maybe your option should be to use an ASMX legacy Web service, which have been around for a long time.Wednesday, November 6, 2013 8:56 PM