SlideShare ist ein Scribd-Unternehmen logo
1 von 34
Services in the Web
REST mit WCF 4, Silverlight und AJAX
Daniel Fisher (lennybacon) | devcoach.com
Lennybacon.com
■ Daniel Fisher | CTO & Software Architect
■
MCP, MCTS, MCPD…
daniel.fisher@devcoach.com
■ Mit-Gründer und Geschäftsführer von devcoach.com
www.devcoach.com
■ Mit-Gründer und Vorstand der
gemeinnützigen www.just community.de e.V.
■ Veranstalter des größten Entwickler & IT-Pro
Community Events in Deutschland: www.nrwconf.de
■ Mit-Gründer und Leiter der
INETA Usergroup Düsseldorf
www.NetUG-NiederRhein.de
■ Mitglied im Microsoft
Community Leader & Insider Program (CLIP)
■ Connected Systems Advisory Board
Expertengruppe für WCF, WF & BizTalk
Efficient Communication…
devcoach.com
■ Leistungen
■ Architektur-Beratung
Strukturierter und effizienter zu einer wartbaren Anwendung.
■ Software-Entwicklung
Team-out-of-the-box (Near-shoring)
Objektmodelle und Datenzugriff
Kommunikations-Infrastrukturen
Identitäts- und Berechtigungsmodelle
Web 2.0 und Rich Internet Applikation
■ Coaching & Training
Technologien schneller verstehen und richtig einsetzen.
■ Technologien
■ Microsoft Windows & .NET Framework
ASP.NET, WCF, WF, WPF, Silverlight & Geneva
■ Kunden
■ Versicherung, Finanzindustrie, Mittelstand, Handel, Kommunikation,
Softwarehersteller u.v.a.
Bundesamt für Sicherheit in der Informationstechnologie,
Microsoft, Dresdner Bank…
Project
Experience
Technology
Know-how
devcoach®
Agenda
• What is REST?
• WCF WebHttp
• Consumer
The WCF Eco System
What is REST?
■ A term coined by Roy Fielding
■ Style of architecture
■ Resource based
■ Cachable
■ NOT SOAP, NOR SESSION
■ Web Standards!
What is WebHttp?
• A Services flavor
• RESTful
• Non-SOAP HTTP services
• Complete control over the
• URI
• Format
• Protocol
WebHttp v 4.0
■ WCF 3.5
■ + WCF REST Starter Kit
■ + .NET 4
■ + new Features
Attribute Inheritance
[ServiceContract]
public interface ISessionPlaner
{
[OperationContract]
[WebGet(UriTemplate = "Sessions")]
List<SessionDetail> GetAllSessions();
}
Attribute Inheritance
[ServiceContract]
public interface ISessionPlaner
{
[WebGet(UriTemplate = "Sessions")]
List<SessionDetail> GetAllSessions();
}
DO NOT REPEAT YOURSELF!
No Routing
Routing
public class Global : System.Web.HttpApplication
{
void Application_Start(
object sender, EventArgs e)
{
RouteTable.Routes.Add(
new ServiceRoute(
string.Empty,
new WebServiceHostFactory(),
typeof(SessionPlanerService)));
}
Configuring the Module
<configuration>
…
<system.web> // <system.webServer> IIS 7
…
<httpModules>
…
<add
name="urlRouting"
type="System.Web.Routing.UrlRoutingModule"/>
</httpModules>
…
ASP.NET Routing
Controller
Model
View
RoutingRule
WCF Routing
ServiceHost
Service
RoutingRule
What about the contract?
Description Attribute
[ServiceContract]
public interface ISessionPlaner
{
[Description("Gets all sessions.")]
[WebGet(UriTemplate = "Sessions")]
List<SessionDetail> GetAllSessions();
}
/help
Consumer
■ .NET
■ WebRequest
■ WebClient
■ HttpClient
■ WebChannelFactory
■ AJAX
■ Silverlight
Explicit Format Selection
if (WebOperationContext.Current.
IncomingRequest.Headers["Accept"] ==
"application/json")
{
WebOperationContext.Current.
OutgoingResponse.Format =
WebMessageFormat.Json;
}
Automatic Format Selection
<system.serviceModel>
<standardEndpoints>
<webHttpEndpoint>
<standardEndpoint
name=""
automaticFormatSelectionEnabled="true">
<security mode="None"/>
Caching
[AspNetCacheProfile("A")]
<system.web>
<caching>
<outputCache enableOutputCache="true"/>
<outputCacheSettings>
<outputCacheProfiles>
<add
name="A"
location="Server"
duration="60"
varyByParam="skip; top; manager"
varyByHeader="Accept"/>
Web Faults
throw new WebFaultException<string>(
string.Format(
CultureInfo.CurrentCulture,
"There is no user with the userName '{0}'.",
userName),
HttpStatusCode.NotFound);
References
■ WCF REST Starter Kit Preview 2
■ http://aspnet.codeplex.com/releases/view/24644
2010 - Basta!: REST mit WCF 4, Silverlight und AJAX

Weitere ähnliche Inhalte

Ähnlich wie 2010 - Basta!: REST mit WCF 4, Silverlight und AJAX

Microservices – die Architektur für Agile-Entwicklung?
Microservices – die Architektur für Agile-Entwicklung?Microservices – die Architektur für Agile-Entwicklung?
Microservices – die Architektur für Agile-Entwicklung?Christian Baranowski
 
HTML5 Offline - Fallstricke für mobile Webseiten und WebApps
HTML5 Offline - Fallstricke für mobile Webseiten und WebAppsHTML5 Offline - Fallstricke für mobile Webseiten und WebApps
HTML5 Offline - Fallstricke für mobile Webseiten und WebAppsUlrich Schmidt
 
Rich Internet Applications mit SharePoint
Rich Internet Applications mit SharePointRich Internet Applications mit SharePoint
Rich Internet Applications mit SharePointbusitec GmbH
 
Rich Internet Applications mit SharePoint
Rich Internet Applications mit SharePointRich Internet Applications mit SharePoint
Rich Internet Applications mit SharePointHenning Eiben
 
Dipl.-Ing. Leopold Peneder (HC Solutions)
Dipl.-Ing. Leopold Peneder (HC Solutions)Dipl.-Ing. Leopold Peneder (HC Solutions)
Dipl.-Ing. Leopold Peneder (HC Solutions)Agenda Europe 2035
 
2009 - DNC: Silverlight ohne UI - Nur als Cache
2009 - DNC: Silverlight ohne UI - Nur als Cache2009 - DNC: Silverlight ohne UI - Nur als Cache
2009 - DNC: Silverlight ohne UI - Nur als CacheDaniel Fisher
 
Ivory Soa Suite
Ivory Soa SuiteIvory Soa Suite
Ivory Soa SuitePredrag61
 
Apple iOS - Webservices
Apple iOS - WebservicesApple iOS - Webservices
Apple iOS - Webservicesmesseb
 
Logstash: Windows und Linux Logmanagement (Webinar vom 07.11.2014)
Logstash: Windows und Linux Logmanagement (Webinar vom 07.11.2014)Logstash: Windows und Linux Logmanagement (Webinar vom 07.11.2014)
Logstash: Windows und Linux Logmanagement (Webinar vom 07.11.2014)NETWAYS
 
Webcast SAP Cloud Platform 2 - Developing Tools
Webcast SAP Cloud Platform 2 - Developing ToolsWebcast SAP Cloud Platform 2 - Developing Tools
Webcast SAP Cloud Platform 2 - Developing ToolsPatric Dahse
 
Basta 2016 - Test- und Releaseumgebungen in der Cloud
Basta 2016 - Test- und Releaseumgebungen in der CloudBasta 2016 - Test- und Releaseumgebungen in der Cloud
Basta 2016 - Test- und Releaseumgebungen in der CloudMarc Müller
 
2007 - Basta!: Nach soa kommt soc
2007 - Basta!: Nach soa kommt soc2007 - Basta!: Nach soa kommt soc
2007 - Basta!: Nach soa kommt socDaniel Fisher
 
MEAN SCS in der Cloud
MEAN SCS in der CloudMEAN SCS in der Cloud
MEAN SCS in der CloudTorsten Fink
 
Bernhard Wick - appserver.io - code.talks 2015
 Bernhard Wick - appserver.io - code.talks 2015 Bernhard Wick - appserver.io - code.talks 2015
Bernhard Wick - appserver.io - code.talks 2015AboutYouGmbH
 
Mobile Development mit ASP.NET MVC 4
Mobile Development mit ASP.NET MVC 4Mobile Development mit ASP.NET MVC 4
Mobile Development mit ASP.NET MVC 4Digicomp Academy AG
 
Extend Workflows to the cloud and beyond - Office 365 Conference (DE)
Extend Workflows to the cloud and beyond - Office 365 Conference (DE)Extend Workflows to the cloud and beyond - Office 365 Conference (DE)
Extend Workflows to the cloud and beyond - Office 365 Conference (DE)Patrick Hosch
 
XAML UI DEVELOPMENT BEST PRACTICES 2.0
XAML UI DEVELOPMENT BEST PRACTICES 2.0XAML UI DEVELOPMENT BEST PRACTICES 2.0
XAML UI DEVELOPMENT BEST PRACTICES 2.0thoemmes
 
Wozu Portlets – reichen HTML5 und Rest nicht aus für moderne Portale?
Wozu Portlets – reichen HTML5 und Rest nicht aus für moderne Portale?Wozu Portlets – reichen HTML5 und Rest nicht aus für moderne Portale?
Wozu Portlets – reichen HTML5 und Rest nicht aus für moderne Portale?adesso AG
 

Ähnlich wie 2010 - Basta!: REST mit WCF 4, Silverlight und AJAX (20)

Net@night asp.net mvc
Net@night asp.net mvcNet@night asp.net mvc
Net@night asp.net mvc
 
Microservices – die Architektur für Agile-Entwicklung?
Microservices – die Architektur für Agile-Entwicklung?Microservices – die Architektur für Agile-Entwicklung?
Microservices – die Architektur für Agile-Entwicklung?
 
HTML5 Offline - Fallstricke für mobile Webseiten und WebApps
HTML5 Offline - Fallstricke für mobile Webseiten und WebAppsHTML5 Offline - Fallstricke für mobile Webseiten und WebApps
HTML5 Offline - Fallstricke für mobile Webseiten und WebApps
 
Rich Internet Applications mit SharePoint
Rich Internet Applications mit SharePointRich Internet Applications mit SharePoint
Rich Internet Applications mit SharePoint
 
Rich Internet Applications mit SharePoint
Rich Internet Applications mit SharePointRich Internet Applications mit SharePoint
Rich Internet Applications mit SharePoint
 
Dipl.-Ing. Leopold Peneder (HC Solutions)
Dipl.-Ing. Leopold Peneder (HC Solutions)Dipl.-Ing. Leopold Peneder (HC Solutions)
Dipl.-Ing. Leopold Peneder (HC Solutions)
 
2009 - DNC: Silverlight ohne UI - Nur als Cache
2009 - DNC: Silverlight ohne UI - Nur als Cache2009 - DNC: Silverlight ohne UI - Nur als Cache
2009 - DNC: Silverlight ohne UI - Nur als Cache
 
Ec2009 Templates
Ec2009 TemplatesEc2009 Templates
Ec2009 Templates
 
Ivory Soa Suite
Ivory Soa SuiteIvory Soa Suite
Ivory Soa Suite
 
Apple iOS - Webservices
Apple iOS - WebservicesApple iOS - Webservices
Apple iOS - Webservices
 
Logstash: Windows und Linux Logmanagement (Webinar vom 07.11.2014)
Logstash: Windows und Linux Logmanagement (Webinar vom 07.11.2014)Logstash: Windows und Linux Logmanagement (Webinar vom 07.11.2014)
Logstash: Windows und Linux Logmanagement (Webinar vom 07.11.2014)
 
Webcast SAP Cloud Platform 2 - Developing Tools
Webcast SAP Cloud Platform 2 - Developing ToolsWebcast SAP Cloud Platform 2 - Developing Tools
Webcast SAP Cloud Platform 2 - Developing Tools
 
Basta 2016 - Test- und Releaseumgebungen in der Cloud
Basta 2016 - Test- und Releaseumgebungen in der CloudBasta 2016 - Test- und Releaseumgebungen in der Cloud
Basta 2016 - Test- und Releaseumgebungen in der Cloud
 
2007 - Basta!: Nach soa kommt soc
2007 - Basta!: Nach soa kommt soc2007 - Basta!: Nach soa kommt soc
2007 - Basta!: Nach soa kommt soc
 
MEAN SCS in der Cloud
MEAN SCS in der CloudMEAN SCS in der Cloud
MEAN SCS in der Cloud
 
Bernhard Wick - appserver.io - code.talks 2015
 Bernhard Wick - appserver.io - code.talks 2015 Bernhard Wick - appserver.io - code.talks 2015
Bernhard Wick - appserver.io - code.talks 2015
 
Mobile Development mit ASP.NET MVC 4
Mobile Development mit ASP.NET MVC 4Mobile Development mit ASP.NET MVC 4
Mobile Development mit ASP.NET MVC 4
 
Extend Workflows to the cloud and beyond - Office 365 Conference (DE)
Extend Workflows to the cloud and beyond - Office 365 Conference (DE)Extend Workflows to the cloud and beyond - Office 365 Conference (DE)
Extend Workflows to the cloud and beyond - Office 365 Conference (DE)
 
XAML UI DEVELOPMENT BEST PRACTICES 2.0
XAML UI DEVELOPMENT BEST PRACTICES 2.0XAML UI DEVELOPMENT BEST PRACTICES 2.0
XAML UI DEVELOPMENT BEST PRACTICES 2.0
 
Wozu Portlets – reichen HTML5 und Rest nicht aus für moderne Portale?
Wozu Portlets – reichen HTML5 und Rest nicht aus für moderne Portale?Wozu Portlets – reichen HTML5 und Rest nicht aus für moderne Portale?
Wozu Portlets – reichen HTML5 und Rest nicht aus für moderne Portale?
 

Mehr von Daniel Fisher

MD DevdDays 2016: Defensive programming, resilience patterns & antifragility
MD DevdDays 2016: Defensive programming, resilience patterns & antifragilityMD DevdDays 2016: Defensive programming, resilience patterns & antifragility
MD DevdDays 2016: Defensive programming, resilience patterns & antifragilityDaniel Fisher
 
NRWConf, DE: Defensive programming, resilience patterns & antifragility
NRWConf, DE: Defensive programming, resilience patterns & antifragilityNRWConf, DE: Defensive programming, resilience patterns & antifragility
NRWConf, DE: Defensive programming, resilience patterns & antifragilityDaniel Fisher
 
.NET Developer Days 2015, PL: Defensive programming, resilience patterns & an...
.NET Developer Days 2015, PL: Defensive programming, resilience patterns & an....NET Developer Days 2015, PL: Defensive programming, resilience patterns & an...
.NET Developer Days 2015, PL: Defensive programming, resilience patterns & an...Daniel Fisher
 
2015 - Basta! 2015, DE: JavaScript und build
2015 - Basta! 2015, DE: JavaScript und build2015 - Basta! 2015, DE: JavaScript und build
2015 - Basta! 2015, DE: JavaScript und buildDaniel Fisher
 
2015 - Basta! 2015, DE: Defensive programming, resilience patterns & antifrag...
2015 - Basta! 2015, DE: Defensive programming, resilience patterns & antifrag...2015 - Basta! 2015, DE: Defensive programming, resilience patterns & antifrag...
2015 - Basta! 2015, DE: Defensive programming, resilience patterns & antifrag...Daniel Fisher
 
2015 - Network 2015, UA: Defensive programming, resilience patterns & antifra...
2015 - Network 2015, UA: Defensive programming, resilience patterns & antifra...2015 - Network 2015, UA: Defensive programming, resilience patterns & antifra...
2015 - Network 2015, UA: Defensive programming, resilience patterns & antifra...Daniel Fisher
 
2011 - Dotnet Information Day: NUGET
2011 - Dotnet Information Day: NUGET2011 - Dotnet Information Day: NUGET
2011 - Dotnet Information Day: NUGETDaniel Fisher
 
2011 - DNC: REST Wars
2011 - DNC: REST Wars2011 - DNC: REST Wars
2011 - DNC: REST WarsDaniel Fisher
 
2011 - DotNetFranken: ASP.NET MVC Localization
2011 - DotNetFranken: ASP.NET MVC Localization2011 - DotNetFranken: ASP.NET MVC Localization
2011 - DotNetFranken: ASP.NET MVC LocalizationDaniel Fisher
 
2011 NetUG HH: ASP.NET MVC & HTML 5
2011 NetUG HH: ASP.NET MVC & HTML 52011 NetUG HH: ASP.NET MVC & HTML 5
2011 NetUG HH: ASP.NET MVC & HTML 5Daniel Fisher
 
2010 - Basta!: IPhone Apps mit C#
2010 - Basta!: IPhone Apps mit C#2010 - Basta!: IPhone Apps mit C#
2010 - Basta!: IPhone Apps mit C#Daniel Fisher
 
2010 - Basta: ASP.NET Controls für Web Forms und MVC
2010 - Basta: ASP.NET Controls für Web Forms und MVC2010 - Basta: ASP.NET Controls für Web Forms und MVC
2010 - Basta: ASP.NET Controls für Web Forms und MVCDaniel Fisher
 
2010 Basta!: Massendaten mit ADO.NET
2010 Basta!: Massendaten mit ADO.NET2010 Basta!: Massendaten mit ADO.NET
2010 Basta!: Massendaten mit ADO.NETDaniel Fisher
 
2010 - Basta!: REST mit ASP.NET MVC
2010 - Basta!: REST mit ASP.NET MVC2010 - Basta!: REST mit ASP.NET MVC
2010 - Basta!: REST mit ASP.NET MVCDaniel Fisher
 
2009 - Microsoft Springbreak: IIS, PHP & WCF
2009 - Microsoft Springbreak: IIS, PHP & WCF2009 - Microsoft Springbreak: IIS, PHP & WCF
2009 - Microsoft Springbreak: IIS, PHP & WCFDaniel Fisher
 
2009 - NRW Conf: (ASP).NET Membership
2009 - NRW Conf: (ASP).NET Membership2009 - NRW Conf: (ASP).NET Membership
2009 - NRW Conf: (ASP).NET MembershipDaniel Fisher
 
2009 Dotnet Information Day: More effective c#
2009 Dotnet Information Day: More effective c#2009 Dotnet Information Day: More effective c#
2009 Dotnet Information Day: More effective c#Daniel Fisher
 
2009 - Basta!: Url rewriting mit iis, asp.net und routing engine
2009 - Basta!: Url rewriting mit iis, asp.net und routing engine2009 - Basta!: Url rewriting mit iis, asp.net und routing engine
2009 - Basta!: Url rewriting mit iis, asp.net und routing engineDaniel Fisher
 
2009 - Basta!: Agiles requirements engineering
2009 - Basta!: Agiles requirements engineering2009 - Basta!: Agiles requirements engineering
2009 - Basta!: Agiles requirements engineeringDaniel Fisher
 
2008 - TechDays PT: Modeling and Composition for Software today and tomorrow
2008 - TechDays PT: Modeling and Composition for Software today and tomorrow2008 - TechDays PT: Modeling and Composition for Software today and tomorrow
2008 - TechDays PT: Modeling and Composition for Software today and tomorrowDaniel Fisher
 

Mehr von Daniel Fisher (20)

MD DevdDays 2016: Defensive programming, resilience patterns & antifragility
MD DevdDays 2016: Defensive programming, resilience patterns & antifragilityMD DevdDays 2016: Defensive programming, resilience patterns & antifragility
MD DevdDays 2016: Defensive programming, resilience patterns & antifragility
 
NRWConf, DE: Defensive programming, resilience patterns & antifragility
NRWConf, DE: Defensive programming, resilience patterns & antifragilityNRWConf, DE: Defensive programming, resilience patterns & antifragility
NRWConf, DE: Defensive programming, resilience patterns & antifragility
 
.NET Developer Days 2015, PL: Defensive programming, resilience patterns & an...
.NET Developer Days 2015, PL: Defensive programming, resilience patterns & an....NET Developer Days 2015, PL: Defensive programming, resilience patterns & an...
.NET Developer Days 2015, PL: Defensive programming, resilience patterns & an...
 
2015 - Basta! 2015, DE: JavaScript und build
2015 - Basta! 2015, DE: JavaScript und build2015 - Basta! 2015, DE: JavaScript und build
2015 - Basta! 2015, DE: JavaScript und build
 
2015 - Basta! 2015, DE: Defensive programming, resilience patterns & antifrag...
2015 - Basta! 2015, DE: Defensive programming, resilience patterns & antifrag...2015 - Basta! 2015, DE: Defensive programming, resilience patterns & antifrag...
2015 - Basta! 2015, DE: Defensive programming, resilience patterns & antifrag...
 
2015 - Network 2015, UA: Defensive programming, resilience patterns & antifra...
2015 - Network 2015, UA: Defensive programming, resilience patterns & antifra...2015 - Network 2015, UA: Defensive programming, resilience patterns & antifra...
2015 - Network 2015, UA: Defensive programming, resilience patterns & antifra...
 
2011 - Dotnet Information Day: NUGET
2011 - Dotnet Information Day: NUGET2011 - Dotnet Information Day: NUGET
2011 - Dotnet Information Day: NUGET
 
2011 - DNC: REST Wars
2011 - DNC: REST Wars2011 - DNC: REST Wars
2011 - DNC: REST Wars
 
2011 - DotNetFranken: ASP.NET MVC Localization
2011 - DotNetFranken: ASP.NET MVC Localization2011 - DotNetFranken: ASP.NET MVC Localization
2011 - DotNetFranken: ASP.NET MVC Localization
 
2011 NetUG HH: ASP.NET MVC & HTML 5
2011 NetUG HH: ASP.NET MVC & HTML 52011 NetUG HH: ASP.NET MVC & HTML 5
2011 NetUG HH: ASP.NET MVC & HTML 5
 
2010 - Basta!: IPhone Apps mit C#
2010 - Basta!: IPhone Apps mit C#2010 - Basta!: IPhone Apps mit C#
2010 - Basta!: IPhone Apps mit C#
 
2010 - Basta: ASP.NET Controls für Web Forms und MVC
2010 - Basta: ASP.NET Controls für Web Forms und MVC2010 - Basta: ASP.NET Controls für Web Forms und MVC
2010 - Basta: ASP.NET Controls für Web Forms und MVC
 
2010 Basta!: Massendaten mit ADO.NET
2010 Basta!: Massendaten mit ADO.NET2010 Basta!: Massendaten mit ADO.NET
2010 Basta!: Massendaten mit ADO.NET
 
2010 - Basta!: REST mit ASP.NET MVC
2010 - Basta!: REST mit ASP.NET MVC2010 - Basta!: REST mit ASP.NET MVC
2010 - Basta!: REST mit ASP.NET MVC
 
2009 - Microsoft Springbreak: IIS, PHP & WCF
2009 - Microsoft Springbreak: IIS, PHP & WCF2009 - Microsoft Springbreak: IIS, PHP & WCF
2009 - Microsoft Springbreak: IIS, PHP & WCF
 
2009 - NRW Conf: (ASP).NET Membership
2009 - NRW Conf: (ASP).NET Membership2009 - NRW Conf: (ASP).NET Membership
2009 - NRW Conf: (ASP).NET Membership
 
2009 Dotnet Information Day: More effective c#
2009 Dotnet Information Day: More effective c#2009 Dotnet Information Day: More effective c#
2009 Dotnet Information Day: More effective c#
 
2009 - Basta!: Url rewriting mit iis, asp.net und routing engine
2009 - Basta!: Url rewriting mit iis, asp.net und routing engine2009 - Basta!: Url rewriting mit iis, asp.net und routing engine
2009 - Basta!: Url rewriting mit iis, asp.net und routing engine
 
2009 - Basta!: Agiles requirements engineering
2009 - Basta!: Agiles requirements engineering2009 - Basta!: Agiles requirements engineering
2009 - Basta!: Agiles requirements engineering
 
2008 - TechDays PT: Modeling and Composition for Software today and tomorrow
2008 - TechDays PT: Modeling and Composition for Software today and tomorrow2008 - TechDays PT: Modeling and Composition for Software today and tomorrow
2008 - TechDays PT: Modeling and Composition for Software today and tomorrow
 

2010 - Basta!: REST mit WCF 4, Silverlight und AJAX