Hello, I want to learn more about web services. I have a table: ID, name, phone How will be the code for program that send name+phone to the webservice and the webservice check if it exist or not in the DB Roi.
Hi there, Lets says that I have DB and I want to let other website/clients to make some queris in my DB, for that I need to build webservice
You just need a script that they can call with the info they have and you then return it (normally as xml or plain text) eg www.mysite.com/getinfo.php?id=4543 you then take 4543, query the database and return the info
So what you says is that I need to receive the variables in GET method? And - how do I send back the respond (the XML)?
It doesn't have to be get but its simpler for the other site than post or soap, rest etc Look up php.net and find the headers for xml, then just use Php to output the text string that is really xml... Plain text might be easier, perhaps. Sounds like coding is a new skill so take it slowly. Only other issue is security, do you need to ensure you don't give the info to anyone who asks for it?
No, if yes I will add IP checks...(right?) Can you please write me a simple code for both files (the one that send and receive the request, and the one that create the query based on the request parameters) ?
I don't think anyone should waste their time doing it for you. This is something you need to do for yourself. If you don't know how then you should pick up a book on programming and start to learn how to program. This is actually very easy to do. The easiest method would be to simply accept a HTTP POST to your script with the XML. Then parse the data, error check, run the database query, then return a response.
If your "web service" means somethings like "web service" from .NET... You should google for some jQuery + PHP example. That will help i think.