How do I create a PHP Web service to receive data from third parties?
source link: https://www.codesd.com/item/how-do-i-create-a-php-web-service-to-receive-data-from-third-parties.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
How do I create a PHP Web service to receive data from third parties?
I'm creating a webservice in which remote sites can send data to a PHP-based webservice. However, I'm struggling to come up with the best way of handling the incoming data.
The data will be in the form of shopping basket contents, so might include product name, price, ID, date, customer etc. There will be one line of data for each product in the basket, so there could be 20-30 lines for some customers.
Would sending the data to the webservice via GET be sensible? Is there a better option you can think of? Any input is greatly appreciated.
Thanks!
Probably not a great idea to send via get. I'd generate the basket as XML or JSON, then post it to the service. You can then write back a response on XML or JSON saying whether or not the call was successful.
A nice introduction to a RESTful API with PHP is here. I find it goes a bit overboard in some places, you can do the same with a little less code but it is nonetheless a good guide.
Related Articles
The best way to create a PHP Web service
How can I call my PHP web service properly using ksoap2-android?
Error when calling a Web service and receiving data
How to secure a RESTful php web service with SSL / TLS and / or message-level security
Create a PHP Web service to respond to the Android app in JSON format
How do I access a PHP Web service from ASP.Net?
How can I create a Java web service (jax-ws) with array or List as parameter
How do I know if a web service is returning data in XML or JSON format?
How to use an asp.net web service to refresh only a small part of the asp.net 4.0 web page without editing any other part
Expose the SQL Server database as a Web service to obtain data from
How do I create a DataTable and fill it with data from the database using DataView?
how to call a function in the directive after receiving data from two different services?
How can I create a small Mac application that receives data via the WiFi network from an iOS application?
How can I create a PHP web form that validates an email address?
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK