tags:

views:

630

answers:

3

We have a website built in PHP and are trying to enable it to talk to couple of services that are going to be written in WCF and follow REST Style architecture for web services.

Anybody have any best practices? issues?

A: 

By the way, the WCF/C# aspect is completely irrelevant.

vidalsasoon
Not necessarily - depending on how the WCF service is configured he may or may not be able to use it at all with PHP.
Terry Donaghe
It's hardly RESTful then, is it?
troelskn
All he needs to know is that the REST calls are functioning correctly. Whether they originate from WCF or Java makes no difference.By the way, referring to your other post, basicHttpBinding will create SOAP messages. I think he needs webHttpBinding for REST.
vidalsasoon
yes I wil be using webHttpBinding
CodeToGlory
A: 

I'd consider configuring the WCF component to use the basicHTTPBinding. Be mindful that it's possible to configure the WCF component so that you won't be able to access it at all with PHP.

Terry Donaghe
A: 

You can use file_get_contents to retrieve a resource. If you need to manipulate it, you can use the curl extension. Curl also supports various forms of authentication.

You'll also need a parser to handle the resources. This will depend on the content-type, but XML is a common format and can be parsed with the simplexml extension

troelskn