ASP.NET Web API Udaiappa Ramachandran NHDN-Nashua.NET/Cloud Computing UG Lead Blog:

Slides:



Advertisements
Similar presentations
Pierre-Johan CHARTRE Java EE - JAX-RS - Pierre-Johan CHARTRE
Advertisements

What Is Microsoft Marketplace DataMarket What Is Microsoft Marketplace DataMarket? Michael Stiefel
Introduction to Web Services
1 Euro-VO Technology Forum, 23 September 2009, Annotations at the CDS Web 2.0: annotations at the CDS Brice GASSMANN Sébastien DERRIERE Thomas BOCH.
Server Access The REST of the Story David Cleary
OASIS OData Technical Committee. AGENDA Introduction OASIS OData Technical Committee OData Overview Work of the Technical Committee Q&A.
#spsevents #spsphx SPS EVENTS PHX Know REST for the Query AN INTRODUCTION TO REST FOR SHAREPOINT 2013 ERIC J OSZAKIEWSKI, MCTS, MS, MCPS.
Web API for Mobile JaxARCSIG April About Me David Fekke L.L.C. Mobile apps for iOS Regular presenter at JaxDUG, JSSUG and JaxFusion Writing Web.
.NET Framework V3.5+ & RESTful web services Mike Taulty Developer & Platform Group Microsoft Ltd
RESTful Services with ASP.NET Web API Vladimir Georgiev Technical Trainer & Software Developer
06 | Implementing Web APIs Jon Galloway | Tech Evangelist Christopher Harrison | Head Geek.
Microsoft ® Official Course Interacting with the Search Service Microsoft SharePoint 2013 SharePoint Practice.
Windows.Net Programming Series Preview. Course Schedule CourseDate Microsoft.Net Fundamentals 01/13/2014 Microsoft Windows/Web Fundamentals 01/20/2014.
Ori Calvo, 2010 “If people want to have maximum reach across *all* devices then HTML will provide the broadest reach” Scott Guthrie,
OAuth-as-a-service using ASP.NET Web API and Windows Azure Access Control Maarten
NextGen Technology upgrade – Synerizip - Sandeep Kamble.
Configuration Management and Server Administration Mohan Bang Endeca Server.
Creating Web Services with C#
REST.  REST is an acronym standing for Representational State Transfer  A software architecture style for building scalable web services  Typically,
ASP.NET + jQuery + Odata = Goodness Stephen Walther Superexpert.com
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.
ADO.NET DATA SERVICES Mike Taulty Developer & Platform Group Microsoft UK
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.
Introduction to ASP.NET MVC Information for this presentation was taken from Pluralsight Building Applications with ASP.NET MVC 4.
Open Data Protocol * Han Wang 11/30/2012 *
REST - Introduction Based on material from InfoQ.com (Stefan Tilkov) And slides from MindTouch.com (Steve Bjorg) 1.
Introduction to the SharePoint 2013 REST API. 2 About Me SharePoint Solutions Architect at Sparkhound in Baton Rouge
ASP.Net, Web Forms and Web Controls 1 Outline Session Tracking Cookies Session Tracking with HttpSessionState.
Building a Web API for browser/JSON clients.
1 ADO.NET Data Services Mike Taulty Developer & Platform Group Microsoft Ltd
WORKING WITH THE “CALL HTTP WEB SERVICE” WORKFLOW ACTIVITY Derek Nishino Nishino Consulting
06 | HTTP Services with Web API Bruno Terkaly | Technical Evangelist Bret Stateham | Technical Evangelist.
RESTful Web Services What is RESTful?
Lecture IV: REST Web Service
Virtual techdays INDIA │ 9-11 February 2011 SESSION TITLE Kamala Rajan S │ Technical Manager, Marlabs.
WEB-API & MVC5 - Identity & Security Mait Poska & Andres Käver, IT Kolledž 2014.
WebApi: What is it? How can I use it? Guy In Front of the Whittaker.
Modern Development Technologies in SharePoint SHAREPOINT SATURDAY OMAHA APRIL, 2016.
Vladan Strigo CTO NETmedia ASP.NET Web Api Tips & Tricks.
Understanding Dependency Injection… and those pesky containers Miguel A. Castro Architect -
ASP.NET WEB API Napredne tehnike i mogućnosti RENATO JOVIĆ, Tagit Adriatica d.o.o.
Web Services Essentials. What is a web service? web service: software functionality that can be invoked through the internet using common protocols like.
National College of Science & Information Technology.
Windows Communication Foundation and Web Services
Tiny http client and server
Better RESTFul API – Best Practices
Node.js Express Web Applications
API Security Auditing Be Aware,Be Safe
Node.js Express Web Services
WEB-API & MVC5 - Identity & Security
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.
Windows Communication Foundation and Web Services
MVC in ASP.NET Core: The new kid on the block
Testing REST IPA using POSTMAN
WEB API.
DotnetConf 11/17/ :06 AM © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE.
Controllers.
03 | Web API Configuration
$, $$, $$$ API testing Edition
Building HTTP Services with ASP.NET Web API
Building HTTP services for modern client apps
Building production-ready APIs with ASP.NET Core 2.2
Web API with Angular 2 Front End
WCF Data Services and Silverlight
.NET Framework V3.5+ & RESTful web services
#01# ASP.NET Core Overview Design by: TEDU Trainer: Bach Ngoc Toan
Chengyu Sun California State University, Los Angeles
Presentation transcript:

ASP.NET Web API Udaiappa Ramachandran NHDN-Nashua.NET/Cloud Computing UG Lead Blog:

Agenda  Introduction to Web API  Web API Routing  Web API Pipeline  Dependency Injections and Resolvers  Model Binding and Media Formats  Self Hosting  Deploying Web API into cloud  References

Introduction to Web API  Next iteration of WCF REST  Framework for developing REST Services  Released part of ASP.NET MVC  Uses HTTP protocol  Accessible from wide variety of clients  Http Methods: GET, POST, PUT, DELETE  URLs and Methods

Demo: Web API Basics

Web API Routing  Web API Routing very similar to MVC routing  Action determined using the HTTP method not the URI path  Uses “api” in the rout is to avoid collisons with ASP.NET MVC routing.  Adds “Controller” to the controller part of the URL  Default mapping thru global.asax  Additional URL parameters are mapped as action parameters  Explicitly specify the HTTP methods for an action by decorating the action method with HttpGet, HttpPut, HttpPost or HttpDelete attribute  Action can be defined thru AcceptVerbs as a method attributes  Route by Action Name  Override action name by using ActionName attribute  Ignore action by NoAction Attribute

Demo: Web API Routing

Filtering  Uses OData specific keywords $expand Directs that related records should be retrieved in the record or collection being retrieved. $filter Specifies an expression or function that must evaluate to ‘true’ for a record to be returned in the collection. $orderbyDetermines what values are used to order a collection of records. $selectSpecifies a sub set of properties to return. $skipSets the number of records to skip before it retrieves records in a collection. $topDetermines the maximum number of records to return. Install-Package Microsoft.AspNet.WebApi.OData -Pre

Demo: Web API Filtering

Web API Pipeline  Both Request and Response Model have pipeline  Web API has client and server side pipelines  Both Share the common object HttpMessageHandler  HttpRequestMessage Represents all info about http request such as URL, HTTP Methods and Headers  HttpResponseMessage Represents all the info about the Http Response such as StatusCode, Success Flag, Original Http Request  HttpMessageHandler Common for both Request and Response Most common processing code can be placed here Ideal for authentication Two Scopes: Global and Per-Route  Custom Handlers Inherit DelegatingHandler Custom code to perform any kind of per request functionality

Pipeline Elements

Demo: Web API Pipeline Demo: Custom Handlers

Dependency Resolution  Service Oriented Architecture for Decoupling the object  IoC: The concept of allowing something outside of system to control it.  Often done thru DI frameworks Unity Ninject Castle Windsor Structure Map Spring.net Autofac  Web API provides a hook for us to wire up the complex dependency

Demo: Simple Resolver Demo: Resolve using DI Framework

Data Model and MIME types  Returning JSON Default return format Good for mobile apps does not require any special code  Returning XML No code change Set the request content type as application/xml  Mime Types: return virtually anything that can be sent over the web Inherit from BufferedMediaTypeFormatter Override key methods attach media formatter to configuration

Demo: Data Model Demo: MIME Types

Hosting

Demo: Self Hosting

Resource    Host-30abca12 Host-30abca12   net-web-api-and-httpclient-samples.aspx net-web-api-and-httpclient-samples.aspx

Q & A