2005 - .net summercamp: web developmentwith iis & asp.net webservices

17

Click here to load reader

Upload: daniel-fisher

Post on 20-May-2015

224 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: 2005 - .NET SummerCamp: Web developmentwith IIS & ASP.NET webservices

Copyright © 2005 newtelligence® AG. All rights reserved

Daniel FisherSoftware Engineer, newtelligence® AG

[email protected]

Web DevelopmentWeb Development

IIS & ASP.NET Webservices

Page 2: 2005 - .NET SummerCamp: Web developmentwith IIS & ASP.NET webservices

© 2005 newtelligence Aktiengesellschaft. All rights reserved

AgendaAgenda

ASP.NET in … Process model State Management Service Tiers & Provider model Languages & File Extensions Coding model

•WebForms

•Codebehind

•Compilation

Page 3: 2005 - .NET SummerCamp: Web developmentwith IIS & ASP.NET webservices

© 2005 newtelligence Aktiengesellschaft. All rights reserved

ASP.NET in .NETASP.NET in .NET

System Services

Common Language Runtime

Services Framework

ASP.NET(Web Forms & Web Services) Windows Forms

Base Data Debug ...

Page 4: 2005 - .NET SummerCamp: Web developmentwith IIS & ASP.NET webservices

© 2005 newtelligence Aktiengesellschaft. All rights reserved

ASP.NET in IISASP.NET in IIS

Internet Information Server

InetInfo

HTTP.SYSkernel mode HTTP listener

W3SVC App Pool App Pool

MetabaseConfigMgr

ProcessMgr

W3wp.exe

WebApp

W3wp.exe

WebApp

WebApp

Page 5: 2005 - .NET SummerCamp: Web developmentwith IIS & ASP.NET webservices

© 2005 newtelligence Aktiengesellschaft. All rights reserved

ASP in IIS (Windows 2003)ASP in IIS (Windows 2003)

Internet Information Server

HTTP.SYSkernel mode HTTP listener

App Pool

W3wp.exeWeb Application

CacheHttpModulesHttpHandler

Page 6: 2005 - .NET SummerCamp: Web developmentwith IIS & ASP.NET webservices

© 2005 newtelligence Aktiengesellschaft. All rights reserved

Process ModelProcess Model

New process model for ASP.NET and Indigo Very flexible activation ASP.NET Runtime is managed!

• ISAPI-Filter Runs as ASPNET user account Asynchronous execution of requests

•Own Thread-Pool•Threads are not related to IIS Threads

Multithreaded•No Apartment-Model

Alternative Filtering-Model•HTTP-Modules und -Handlers replace ISAPIFilters

Cache

Page 7: 2005 - .NET SummerCamp: Web developmentwith IIS & ASP.NET webservices

© 2005 newtelligence Aktiengesellschaft. All rights reserved

LanguagesLanguages

VB C# J#

C++ COBOL PHP etc…

Page 8: 2005 - .NET SummerCamp: Web developmentwith IIS & ASP.NET webservices

© 2005 newtelligence Aktiengesellschaft. All rights reserved

File ExtensionsFile Extensions

ASP.NET related files•WebForms: *.aspx

CodeBehind: *.aspx.cs, *.asmx.vb, ... Resources: *.aspx.resx

•WebUserControls: *.ascx

•Code: *.cs, *.vb

•MasterPages: *.master

•Skin: *.skin

•RequestHandler: *.ashx

•WebServices: *.asmx

•Configuration: Web.config

•Application: Global.asax und Global.asax.vb

Page 9: 2005 - .NET SummerCamp: Web developmentwith IIS & ASP.NET webservices

© 2005 newtelligence Aktiengesellschaft. All rights reserved

Coding Models in ASP.NET 1.x Coding Models in ASP.NET 1.x

Code Inline Code Behind

System.Web.Services.WebService

System.Web.Services.WebService

ASMX ASMX ASMX

Temp.dll Temp.dllMyWeb.dll

Inherits Inherits

Inherits

RuntimeCompiled

RuntimeCompiled

Pre-Compiled

Page 10: 2005 - .NET SummerCamp: Web developmentwith IIS & ASP.NET webservices

© 2005 newtelligence Aktiengesellschaft. All rights reserved

Coding Models in ASP.NET 2.0 Coding Models in ASP.NET 2.0

Code Inline Code Behind

System.Web.Services.WebService

System.Web.Services.WebService

ASMX ASMX

Temp.dll Temp.dll

Inherits Inherits

RuntimeCompiled

RuntimeCompiled

Page 11: 2005 - .NET SummerCamp: Web developmentwith IIS & ASP.NET webservices

© 2005 newtelligence Aktiengesellschaft. All rights reserved

Coding ModelCoding Model

Reduce Inheritance Complexity No need for declaration code Code is linked by Visual Studio and the

runtime Hot Updates (XCopy deployment) Full Integration in the .NET Framework

•Consistent programming model, same tools

Page 12: 2005 - .NET SummerCamp: Web developmentwith IIS & ASP.NET webservices

© 2005 newtelligence Aktiengesellschaft. All rights reserved

CodebehindCodebehind

Enable separation of code from content

•Developers and designers can work independently

WebService.asmxWebService.asmx.cs

Page 13: 2005 - .NET SummerCamp: Web developmentwith IIS & ASP.NET webservices

© 2005 newtelligence Aktiengesellschaft. All rights reserved

ASP.NET 1.x CodebehindASP.NET 1.x Codebehindusing System;

using System.Collections;

using System.ComponentModel;

using System.Data;

using System.Diagnostics;

using System.Web;

using System.Web.Services;

namespace WebApplication1 {

public class Service : System.Web.Services.WebService{

public Service()

{

InitializeComponent();

}

private IContainer components = null;

private void InitializeComponent()

{

}

protected override void Dispose( bool disposing )

{

if(disposing && components != null)

{

components.Dispose();

}

base.Dispose(disposing);

}

[WebMethod]

public string HelloWorld()

{

return "Hello World";

}

}

}

Page 14: 2005 - .NET SummerCamp: Web developmentwith IIS & ASP.NET webservices

© 2005 newtelligence Aktiengesellschaft. All rights reserved

ASP.NET 2.0 CodeBehindASP.NET 2.0 CodeBehindusing System;

using System.Web;

using System.Web.Services;

using System.Web.Services.Protocols;

[WebService(Namespace = "http://tempuri.org/")]

[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]

public class Service : System.Web.Services.WebService

{

[WebMethod]

public string HelloWorld() {

return "Hello World";

}

}

Page 15: 2005 - .NET SummerCamp: Web developmentwith IIS & ASP.NET webservices

© 2005 newtelligence Aktiengesellschaft. All rights reserved

Runtime compilationRuntime compilation

Inline Code The Code Directory

•holds uncompiled classes

•Compilation at runtime

%SystemRoot%\Microsoft.NET\Framework\X.X.XXX\Temporary ASP.NET Files\

Page 16: 2005 - .NET SummerCamp: Web developmentwith IIS & ASP.NET webservices

© 2005 newtelligence Aktiengesellschaft. All rights reserved

Runtime Compilation ExplainedRuntime Compilation Explained

Request

Parse Generate

Response

Request

Instantiate

Response

Codebehind

Instantiate, Process and

Render

Compile*.ASMX

*.ASMX

Page 17: 2005 - .NET SummerCamp: Web developmentwith IIS & ASP.NET webservices

© 2005 newtelligence Aktiengesellschaft. All rights reserved

Thank YouThank You

© 2005 newtelligence® Aktiengesellschaft

newtelligence® AGGilleshütte 99D-41352 Korschenbroichhttp://[email protected]

The presentation content is provided for your personal information only. Any commercial or non-commercial use of the presentation in full or of any text or graphics requires a license from newtelligence AG.

This presentation is protected by the German Copyright Act, EU copyright regulations and international treaties.