webservice for android ppt
Post on 23-Jan-2018
478 Views
Preview:
TRANSCRIPT
Web Service
• Web service used for data transferring between two language or two platform
• In other words web service is known as script code
• Firstly we create database
• For performing operation on database we use php code
• By using query we can operate database
Web Service
• Query fired inside php(webservice) code so we can say that this web service code is responsible for :
1. Insert data into database
2. Delete data from database
3. Fetch data from database
4. Update data into database
Web Service
• For establish connection between database and php code we use connection file
• Code of connection file is also written in php
Code of connection file:
Connection file
Here
Localhost:127.0.0.1
Root: user_name of vertrigo(local server)
Vertrigo: password of vertrigo
• Connection file save with extension of php
• This connection file include inside the webservice(php) code in which query fired
STEP FOR CREATE WEB SERVICE CODE
1. Call connection file for establish connection2. Create array because multiple value
insert/delete/fetch/update into database3. Check value(isset variable used for checking
value)4. Initialize Get method5. Decode field6. Fire query7. Check data operate(according to query)or not8. Lastly encode
DATABASE
• Firstly create database than create table
CODE FOR INSET DATA INTO DATABASE
CODE FOR delete DATA from DATABASE
CODE FOR update DATA INTO DATABASE
CODE FOR fetch DATA from DATABASE
URL FOR CHECK OPERATION
• URL for insertion of data:
(127.0.0.1/web/insert.php?u_name=santosh&
u_fname=mr.surender)
Here:
web- folder name
Insert.php-file name
• Entry of first field with “?” and entry of all other with “&”
URL FOR CHECK OPERATION
• URL for deletion of data:
(127.0.0.1/web/delete.php?id=2)
Here:
Delete u_id=2 raw from table
• URL for updation of data:
(127.0.0.1/web/update.php?id=2&u_name=santu&u_fname=mr.surender)
URL FOR CHECK OPERATION
• URL for fetch data from database
(127.0.0.1/web/fetch.php)
Thanku…..
top related