Copyright © 2005 newtelligence® AG. All rights reserved
Daniel Fisher
Software Engineer, newtelligence® AG
danielf@newtelligence.com
Web Development
IIS & ASP.NET Webservices
© 2005 newtelligence Aktiengesellschaft. All rights reserved
Agenda
 ASP.NET in …
 Process model
 State Management
 Service Tiers & Provider model
 Languages & File Extensions
 Coding model
•WebForms
•Codebehind
•Compilation
© 2005 newtelligence Aktiengesellschaft. All rights reserved
ASP.NET in .NET
SystemServices
Common Language Runtime
Services Framework
ASP.NET
(Web Forms & Web Services)
Windows Forms
Base Data Debug ...
© 2005 newtelligence Aktiengesellschaft. All rights reserved
ASP.NET in IIS
Internet Information Server
InetInfo
HTTP.SYS
kernel mode HTTPlistener
W3SVC App Pool App Pool
Metabase
ConfigMgr
ProcessMgr
W3wp.exe
WebApp
W3wp.exe
WebApp
WebApp
© 2005 newtelligence Aktiengesellschaft. All rights reserved
ASP in IIS (Windows 2003)
Internet Information Server
HTTP.SYS
kernel mode HTTPlistener
App Pool
W3wp.exe
Web Application
CacheHttpModules
HttpHandler
© 2005 newtelligence Aktiengesellschaft. All rights reserved
Process 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
© 2005 newtelligence Aktiengesellschaft. All rights reserved
Languages
 VB
 C#
 J#
 C++
 COBOL
 PHP
 etc…
© 2005 newtelligence Aktiengesellschaft. All rights reserved
File 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
© 2005 newtelligence Aktiengesellschaft. All rights reserved
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
Runtime
Compiled
Runtime
Compiled
Pre-
Compiled
© 2005 newtelligence Aktiengesellschaft. All rights reserved
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
Runtime
Compiled
Runtime
Compiled
© 2005 newtelligence Aktiengesellschaft. All rights reserved
Coding 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
© 2005 newtelligence Aktiengesellschaft. All rights reserved
Codebehind
 Enable separation of code from content
•Developers and designers can work
independently
WebService.asmx
WebService.asmx.cs
© 2005 newtelligence Aktiengesellschaft. All rights reserved
ASP.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";
}
}
}
© 2005 newtelligence Aktiengesellschaft. All rights reserved
ASP.NET 2.0 CodeBehind
using 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";
}
}
© 2005 newtelligence Aktiengesellschaft. All rights reserved
Runtime compilation
 Inline Code
 The Code Directory
•holds uncompiled classes
•Compilation at runtime
 %SystemRoot%Microsoft.NETFramework
X.X.XXX
Temporary ASP.NET Files
© 2005 newtelligence Aktiengesellschaft. All rights reserved
Runtime Compilation Explained
Request
Parse Generate
Response
Request
Instantiate
Response
Codebehind
Instantiate,
Process and
Render
Compile
* .ASMX
* .ASMX
© 2005 newtelligence Aktiengesellschaft. All rights reserved
Thank You
 © 2005 newtelligence® Aktiengesellschaft
newtelligence® AG
Gilleshütte 99
D-41352 Korschenbroich
http://www.newtelligence.com
info@newtelligence.com
 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.

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

  • 1.
    Copyright © 2005newtelligence® AG. All rights reserved Daniel Fisher Software Engineer, newtelligence® AG danielf@newtelligence.com Web Development IIS & ASP.NET Webservices
  • 2.
    © 2005 newtelligenceAktiengesellschaft. All rights reserved Agenda  ASP.NET in …  Process model  State Management  Service Tiers & Provider model  Languages & File Extensions  Coding model •WebForms •Codebehind •Compilation
  • 3.
    © 2005 newtelligenceAktiengesellschaft. All rights reserved ASP.NET in .NET SystemServices Common Language Runtime Services Framework ASP.NET (Web Forms & Web Services) Windows Forms Base Data Debug ...
  • 4.
    © 2005 newtelligenceAktiengesellschaft. All rights reserved ASP.NET in IIS Internet Information Server InetInfo HTTP.SYS kernel mode HTTPlistener W3SVC App Pool App Pool Metabase ConfigMgr ProcessMgr W3wp.exe WebApp W3wp.exe WebApp WebApp
  • 5.
    © 2005 newtelligenceAktiengesellschaft. All rights reserved ASP in IIS (Windows 2003) Internet Information Server HTTP.SYS kernel mode HTTPlistener App Pool W3wp.exe Web Application CacheHttpModules HttpHandler
  • 6.
    © 2005 newtelligenceAktiengesellschaft. All rights reserved Process 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
  • 7.
    © 2005 newtelligenceAktiengesellschaft. All rights reserved Languages  VB  C#  J#  C++  COBOL  PHP  etc…
  • 8.
    © 2005 newtelligenceAktiengesellschaft. All rights reserved File 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
  • 9.
    © 2005 newtelligenceAktiengesellschaft. All rights reserved 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 Runtime Compiled Runtime Compiled Pre- Compiled
  • 10.
    © 2005 newtelligenceAktiengesellschaft. All rights reserved 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 Runtime Compiled Runtime Compiled
  • 11.
    © 2005 newtelligenceAktiengesellschaft. All rights reserved Coding 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
  • 12.
    © 2005 newtelligenceAktiengesellschaft. All rights reserved Codebehind  Enable separation of code from content •Developers and designers can work independently WebService.asmx WebService.asmx.cs
  • 13.
    © 2005 newtelligenceAktiengesellschaft. All rights reserved ASP.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"; } } }
  • 14.
    © 2005 newtelligenceAktiengesellschaft. All rights reserved ASP.NET 2.0 CodeBehind using 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"; } }
  • 15.
    © 2005 newtelligenceAktiengesellschaft. All rights reserved Runtime compilation  Inline Code  The Code Directory •holds uncompiled classes •Compilation at runtime  %SystemRoot%Microsoft.NETFramework X.X.XXX Temporary ASP.NET Files
  • 16.
    © 2005 newtelligenceAktiengesellschaft. All rights reserved Runtime Compilation Explained Request Parse Generate Response Request Instantiate Response Codebehind Instantiate, Process and Render Compile * .ASMX * .ASMX
  • 17.
    © 2005 newtelligenceAktiengesellschaft. All rights reserved Thank You  © 2005 newtelligence® Aktiengesellschaft newtelligence® AG Gilleshütte 99 D-41352 Korschenbroich http://www.newtelligence.com info@newtelligence.com  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.

Editor's Notes

  • #9 <number>
  • #10 difficulties related to the way code-behind was synchronized with ASPX page. ASPX page inherited from the code-behind file in a programming sense.
  • #11 Partial class, new keyword (Expands in Visual Basic, or Partial in C#) code in the class should be merged with another class at runtime. ASPX page uses a new directive called compilewith to indicate its association with the code-behind file.