Web API for Mobile JaxARCSIG April 2012. About Me David Fekke L.L.C. Mobile apps for iOS Regular presenter at JaxDUG, JSSUG and JaxFusion Writing Web.

Slides:



Advertisements
Similar presentations
Building and using REST information services Rion Dooley.
Advertisements

Attie Naude 14 May 2013 Windows Azure Mobile Services.
Hypertext Transfer PROTOCOL ----HTTP Sen Wang CSE5232 Network Programming.
Building RESTful Interfaces
Introduction to Web Services and Web API’s Richard Holowczak Baruch College December, 2014.
Web Services Nasrullah. Motivation about web service There are number of programms over the internet that need to communicate with other programms over.
ADVANTAGE WEBAPI PETER FUNK SOFTWARE ENGINEER, ADVANTAGE R&D MAY 20, 2011.
With jQuery and AJAX Doncho Minkov Telerik Corporation Technical Trainer.
Jax Code Camp 2010 Good morning. iPhone Dev How to develop for the iOS 4.
Client-server interactions in Mobile Applications.
Introduction SOAP History Technical Architecture SOAP in Industry Summary References.
Kay Herzam Herzam IT Consulting What‘s new in ASP.NET MS TechTalk.
SOAP Simple Object Access Protocol by Vinubalaji Gopal (Vinu)
Cloud Computing الحوسبة السحابية. subject History of Cloud Before the cloud Cloud Conditions Definition of Cloud Computing Cloud Anatomy Type of Cloud.
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control Maarten
Beyond the UI Using Tools to Improve Testing Jeremy Traylor
JavaScript & jQuery the missing manual Chapter 11
© 2011 Autodesk Automating Autodesk® Revit® Server Rod Howarth Software Development Manager – Bornhorst + Ward.
ASP.NET Web API Udaiappa Ramachandran NHDN-Nashua.NET/Cloud Computing UG Lead Blog:
Google Data APIs Google Data APIs : Integrando suas aplicações Java com os serviços Google.
Microsoft Visual Studio 2010 Muhammad Zubair MS (FAST-NU) Experience: 5+ Years Contact:- Cell#:
Getting Started with the ASP.NET Web API Dhananjay Kumar Infragistics Consultant Microsoft MVP
Building HTTP Services with ASP.NET Web API Sayed Ibrahim Hashimi Program Manager Microsoft Corporation DEV309.
DP&NM Lab. POSTECH, Korea - 1 -Interaction Translation Methods for XML/SNMP Gateway Interaction Translation Methods for XML/SNMP Gateway Using XML Technologies.
Python and REST Kevin Hibma. What is REST? Why REST? REST stands for Representational State Transfer. (It is sometimes spelled "ReST".) It relies on a.
Microsoft Visual Studio 2010 Muhammad Zubair MS (FAST-NU) Experience: 5+ Years Contact:- Cell#:
ASP.NET Web API. ASP.NET Members MS Open Source ASP.NET MVC 4, ASP.NET Web API and ASP.NET Web Pages v2 (Razor) now all open source ASP.NET MVC 4, ASP.NET.
Or, Hey can’t we just do it using HTTP for the envelope?
Copyright © Cybage Software Pvt. Ltd. All Rights Reserved. Cybage Confidential. Drupal Web Services 1 Authored by: Chaitanya Anil Kulkarni Presented.
RESTful Web Service 2014 년 12 월 한연희
1 Seminar on Service Oriented Architecture Principles of REST.
Android networking 1. Network programming with Android If your Android is connected to a WIFI, you can connect to servers using the usual Java API, like.
HTML5 AND THE FUTURE JAVASCRIPT PLATFORM Marcelo Lopez Ruiz Senior Software Design Engineer Microsoft Corporation.
Building a Web API for browser/JSON clients.
CISC 3140 (CIS 20.2) Design & Implementation of Software Application II Instructor : M. Meyer Address: Course Page:
Introduction to Web Services
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1 Fundamentals.
RESTful Web Services What is RESTful?
Web Technologies Lecture 10 Web services. From W3C – A software system designed to support interoperable machine-to-machine interaction over a network.
Martin Kruliš by Martin Kruliš (v1.1)1.
Welcome to Azure App Services! Amie Seisay
Feeling RESTful? Well, first we’ll define a Web Service –A web page meant to be consumed by a computer via an autonomous program as opposed to a web browser.
WebApi: What is it? How can I use it? Guy In Front of the Whittaker.
Creating REST Services with WCF and EF. About Me: Architect with CEI > concentration is ALM practice. 10 years experience developing with Microsoft Tools.
Couchbase for Mobile Couchbase Lite & Sync Gateway
Using Retrofit framework in implementation of Android REST client David Ante Macan*, Zlatko Stapić, Milan Pavlović* University of Zagreb Faculty of Organization.
Web Development. Agenda Web History Network Architecture Types of Server The languages of the web Protocols API 2.
Rest Services with Play Framework, MySQL, Adding Security with JWT
Rest Services with Play Framework, Adding Security with JWT
Web Services Sisoft Technologies Pvt Ltd
The Client-Server Model
API (Application Program Interface)
RESTful Sevices Distributed Objects Presented by: Shivank Malik
WEB SERVICES.
REST: Web Services Abel Sanchez.
Cosc 5/4730 REST services.
Node.js Express Web Services
Unit – 5 JAVA Web Services
An introduction to REST for SharePoint 2013
What is REST API ? A REST (Representational State Transfer) Server simply provides access to resources and the REST client accesses and presents the.
Testing REST IPA using POSTMAN
WEB API.
$, $$, $$$ API testing Edition
Building HTTP Services with ASP.NET Web API
Secure Web Programming
What’s new in ASP.NET Core and Entity Framework 2.2 (Preview 3)
WCF Data Services and Silverlight
NEECOM – May 22, 2019 Todd L Gould, CEO
#01# ASP.NET Core Overview Design by: TEDU Trainer: Bach Ngoc Toan
Chengyu Sun California State University, Los Angeles
Presentation transcript:

Web API for Mobile JaxARCSIG April 2012

About Me David Fekke L.L.C. Mobile apps for iOS Regular presenter at JaxDUG, JSSUG and JaxFusion Writing Web Services for over 10 years

History of Web Services Tim Berners-Lee invents HTTP/HTML XML 1.0, SOAP begins ratification SOAP standard Fielding dissertation on REST

SOAP Simple Object Access Protocol Uses a standard XML Schema over HTTP Extremely cross platform compatible Extremely Slow

REST Representable State Transfer Uses standard HTTP Can use any text format including XML

XML vs JSON XML tag based document formatting Javascript Notation by Douglas Crockford JSON less verbose than XML, more lightweight Mobile devices have limited bandwidth

Public APIs Twitter Facebook Flickr Amazon iTunes

WebAPI Available now as Nuget Package Built-in as part of MVC 4 Take advantage of HTTP features directly

HTTP methods as Actions Default route will use http method for action Controller/action/id API/Controller/id GET/POST/PUT/DELETE

HTTP Method meanings Get - Return an existing document Post - Create a new document Put - Update a document Delete - Self explanatory

Configure Transport Set Xml or JSON based on Content-Type or Accept header Accept: application/xml Can also use Odata

Return Codes Now have the ability to specify return codes beside 200 HttpResponseMessage<YourEntity> HttpStatusCode.Created 201 response.Headers.Location = new Uri()

Http Status codes 201 Created 200 Success/204 Success but No Content 403 Not authorized 404 Does not exist 500 Server Error 301 Uri Moved

Security [Authorize()] https over port 443 Security Tokens OAuth

Testing WebAPI Download Fiddler2 Firebug (Firefox) Chrome On Mac use CocoaRestClient

Consuming WebAPI Web Apps (ASP.NET, MVC, PHP, Java, ColdFusion, Ruby(Rails), Python, Perl(if you are masochistic)) JavaScript/JQuery Mobile (iOS, Android, WP7, Blackberry OS)

Develop WebAPI and iOS on Same Computer Parallels or VMWare Set Network Adapter to Bridged Run Visual Studio as Administrator Host on IIS (do not use IIS Express or Casini)

Consuming WebAPI in iOS Use NSURLConnection delegate or GCD Show progress while waiting on response Use JSON over XML NSJSONSerialization class (new in iOS 5)

XML Parsing in iOS NSXMLParser (Slowest) libxml2 (C api) TBXML (DOM, Fastest, no write or xpath) TouchXML (DOM supports xpath, no write) KissXML (based on Touch, can write) GDataXML (DOM, from Google) RaptureXML (DOM, supports xpath)

Call WebAPI from Android Create DefaultHttpClient(); Create request with HttpGet(Url); Create response handler BasicResponseHandler(); httpClient.execute(request, handler);

JSON in Android use the JSONObject to parse JSONObject jo = new JSONObject(jString); jo.getJSONObject(“car”); jo.getJSONArray(“cars”);

XML Parsing in Android DOM, SAX and Pull W3C Dom parser Standard Java Sax Parser SJXP (Pull parser)

WebAPI as persistence Don’t use WebAPI as default persistence on Mobile Both Android and iOS have device persistence local storage, CoreData and SQLite iCloud to sync between iOS devices

Demo

Questions

Contact Info David Fekke fekke.com/blog david fekke at gmail dot com aim: davefekke