简体   繁体   中英

What are the best practices for consuming REST based WCF services from PHP?

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?

顺便说一下,WCF / C#方面是完全不相关的。

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM