This is a comprehensive slide on implementing web service in iOS . There are basic information on Web Service . There are steps of using web service in iOS. The presentation emphasized on XML Parsing .
3. Web Service
A Web service is a method of communications
between two electronic devices over the World
Wide Web. It is a software function provided at
a network address over the web with the service
always on as in the concept of utility computing.
4.
5. Several Types of Web Services
WSDL
• WSDL stands for Web Services Description
Language
• WSDL is an XML-based language for describing
Web services.
• WSDL is a W3C recommendation
6. Several Types of Web Services
SOAP
• SOAP stands for Simple Object Access Protocol
• SOAP is an XML based protocol for accessing
Web Services.
• SOAP is based on XML
• SOAP is a W3C recommendation
7. Several Types of Web Services
UDDI
• UDDI stands for Universal Description,
Discovery and Integration
• UDDI is a directory service where companies
can search for Web services.
• UDDI is described in WSDL
• UDDI communicates via SOAP
8. Several Types of Web Services
RDF
• RDF stands for Resource Description
Framework
• RDF is a framework for describing resources
on the web
• RDF is written in XML
• RDF is a W3C Recommendation
9.
10. Advantage of Using Web Service in
Mobile Application
•
•
•
•
Minimize application size
Minimize Code Size
Easy to modify
Reuse Application
11. Disadvantage of Using Web Service in
Mobile Application
• Internet Connection Required
• Server have to be active 24/7
12. Working with Web Service in iOS
(WSDL)
WSDL is an XML format for describing network
services as a set of endpoints operating on
messages containing either document-oriented
or procedure-oriented information. The
operations and messages are described
abstractly, and then bound to a concrete
network protocol and message format to define
an endpoint. Related concrete endpoints are
combined into abstract endpoints (services)
14. Steps of Implementing XML Service in
IOS
• Create a XML Parser file as NSObject type.
• Write relevant code in the files.
• Call the XML Parser class in a View Controller
Class and load XML by url .
• Parse the data and load in the containers or
view components. Example : Table View,
Picker View, Labels, Text Field etc.
19. Call the XML Parser class in a View
Controller Class and load XML by url .
-(void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:YES];
teamImageParser = [[TeamParser alloc]
loadXMLByURL:@"http://www.amarhost.info/sabbir/iOS/AsiaCup/Services/teamlog
o.xml"];
imageNameArray=teamImageParser.imageArray;
teamNameArray=teamImageParser.nameArray;
for(int i=0;i<[imageNameArray count];i++)
{
NSLog(@"%@",[imageNameArray objectAtIndex:i]);
}
for(int i=0;i<[teamNameArray count];i++)
{
NSLog(@"%@",[teamNameArray objectAtIndex:i]);
20. Plot Parsed Data in the TableView
- (NSInteger)numberOfSectionsInTableView:(UITableView
*)tableView
{
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView
numberOfRowsInSection:(NSInteger)section
{
return [[teamImageParser imageArray] count];
}
21. Plot Parsed Data in the TableView
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath
*)indexPath
{
static NSString *CellIdentifier = @"TeamCustomCell";
TeamCustomCell *cell = (TeamCustomCell*)[teamTableView
dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
NSArray *topLabelObject = [[NSBundle mainBundle]
loadNibNamed:@"TeamCustomCell" owner:self options:nil];
for (id currentObject in topLabelObject)
{
if ([currentObject isKindOfClass:[UITableViewCell class]])
{
cell = (TeamCustomCell*) currentObject;
break;