February 24 th -25 th 2004 Daragh Byrne – EPCC Additional.NET Concepts.

Slides:



Advertisements
Similar presentations
Overview Environment for Internet database connectivity
Advertisements

Intesar G Ali IT DepartmentPalestinian Land Authority Web services Prepared by: Intesar Ali IT Department PLA August 2010.
ASP.NET (Active Server Page) SNU OOPSLA Lab. October 2005.
CIM2564 Introduction to Development Frameworks 1 Overview of a Development Framework Topic 1.
Windows Communication Foundation and Web Services.
6/11/2015Page 1 Web Services-based Distributed System B. Ramamurthy.
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 1.1 of…
.NET Deployment Matt Smouse CSE775 – Distributed Objects Spring 2003.
Introducing the Common Language Runtime for.NET. The Common Language Runtime The Common Language Runtime (CLR) The Common Language Runtime (CLR) –Execution.
Introducing the Common Language Runtime. The Common Language Runtime The Common Language Runtime (CLR) The Common Language Runtime (CLR) –Execution engine.
Chapter 12 Extending Web Applications. ASP.NET 2.0, Third Edition2.
Web Services (ASMX 2.0 and WSE 3.0) Mike Taulty Developer & Platform Group Microsoft Ltd
INTRODUCTION TO WEB SERVICES CS 795. What is a Web Service ? Web service is a means by which computers talk to each other over the web using HTTP and.
1 Web Services Visual C# 2008 Step by Step Chapter 30.
Intro to dot Net Dr. John Abraham UTPA – Fall 09 CSCI 3327.
Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College Lecture 8: WebForms — Web-based.
A Free sample background from © 2001 By Default!Slide 1.NET Overview BY: Pinkesh Desai.
1 Lecture 22 George Koutsogiannakis Summer 2011 CS441 CURRENT TOPICS IN PROGRAMMING LANGUAGES.
© 2004 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin Programming the Web Using ASP.Net Chapter 2: The ASP.Net Template Dave.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
A Scalable Application Architecture for composing News Portals on the Internet Serpil TOK, Zeki BAYRAM. Eastern MediterraneanUniversity Famagusta Famagusta.
Introduction to .Net Framework
1 Namespaces and Assemblies © University of Linz, Institute for System Software, 2004 published under the Microsoft Curriculum License.
ASP.NET The.NET Framework. The.NET Framework is Microsoft’s distributed run-time environment for creating, deploying, and using applications over the.
Session 1 - Introduction and Data Access Layer
Integrating CFML with ASP.NET Vince Bonfanti President New Atlanta Communications, LLC.
Introduction to .NET Rui Ye.
Understanding Code Compilation and Deployment Lesson 4.
CIS 375—Web App Dev II Microsoft’s.NET. 2 Introduction to.NET Steve Ballmer (January 2000): Steve Ballmer "Delivering an Internet-based platform of Next.
Introduction to ASP.NET 1www.tech.findforinfo.com.
1 Apache. 2 Module - Apache ♦ Overview This module focuses on configuring and customizing Apache web server. Apache is a commonly used Hypertext Transfer.
CS795/895: Introduction. Topics Distributed Systems –Availability –Performance –Web Services Security –Authentication –Authorization –Confidentiality.
11 Web Services. 22 Objectives You will be able to Say what a web service is. Write and deploy a simple web service. Test a simple web service. Write.
ASP.NET application. Roadmap ASP.NET file types Bin directory Application updates Simple application from start to finish using a virtual directory Behind.
.NET Framework Danish Sami UG Lead.NetFoundry
The Web Architecture and ASP.NET. Slide 2 Review of the Web (1) It began with HTTP and HTML, which delivers static Web pages to browsers which would render.
Murach’s ASP.NET 4.0/VB, C1© 2006, Mike Murach & Associates, Inc.Slide 1.
1.NET Web Forms Web Services © 2002 by Jerry Post.
Web Services. ASP.NET Web Services  Goals of ASP.NET Web services:  To enable cross-platform, cross- business computing  Great for “service” based.
Introducing ASP.NET 2.0. Internet Technologies WWW Architecture Web Server Client Server Request Response Network HTTP TCP/IP PC/Mac/Unix + Browser (IE,
Intro to dot Net Dr. John Abraham UTPA CSCI 3327.
ASP.NET in Definition: 1.ASP.NET is a web application framework developed and marketed by Microsoft to allow programmers to build dynamic web sites,
Kemal Baykal Rasim Ismayilov
ASP.NET (Active Server Page) SNU OOPSLA Lab. October 2005.
ASP.NET Web Services.  A unit of managed code installed under IIS that can be remotely invoked using HTTP.
.NET Ying Chen Junwei Chen. What is Microsoft.NET. NET is a development platform Incorporated into.NET COM+ component services ASP web development framework.
Week Six : Writing Web Services Aims: Creating and Consuming student’s first Web Services Learning Outcomes: Familiarity with VS.NET for creating and consuming.
Chapter 7: Creating and Consuming XML Web Services Understanding XML Web Services Creating XML Web Services Deploying and Discovering XML Web Services.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Understanding Web Applications Lesson 4. Objective Domain Matrix Skills/ConceptsMTA Exam Objectives Understanding Web Page Development Understand Web.
Intro to Web Services Dr. John P. Abraham UTPA. What are Web Services? Applications execute across multiple computers on a network.  The machine on which.
.NET Mobile Application Development XML Web Services.
Text Introduction to.NET Framework. CONFIDENTIAL Agenda .NET Training – Purpose  What is.NET?  Why.NET?  Advantages  Architecture  Components: CLR,
Introduction to ASP.NET development. Background ASP released in 1996 ASP supported for a minimum 10 years from Windows 8 release ASP.Net 1.0 released.
Alexey Polovinkin Post graduate student, CMC department.
January 14 th -15 th 2004 OGSI on Microsoft.NET Daragh Byrne – EPCC.
Introduction to Web Services Srinath Vasireddy Support Professional Developer Support Microsoft Corporation.
METADATA IN.NET Presented By Sukumar Manduva. INTRODUCTION  What is Metadata ? Metadata is a binary information which contains the complete description.
January 14 th -15 th 2004 Recap of Day 1 Daragh Byrne – EPCC.
Windows Communication Foundation and Web Services
Jim Fawcett CSE681 – SW Modeling & Analysis Spring 2005
.NET Omid Darroudi.
Using Application Domains Effectively
ASP.NET Web Forms and Web Services
Windows Communication Foundation and Web Services
.NET and .NET Core 2. .NET Runtimes Pan Wuming 2017.
Chapter 23 – ASP.NET Outline 23.1 Introduction NET Overview
.NET and .NET Core 10. Enabling Contracts Pan Wuming 2017.
Serpil TOK, Zeki BAYRAM. Eastern MediterraneanUniversity Famagusta
Distributed System using Web Services
Presentation transcript:

February 24 th -25 th 2004 Daragh Byrne – EPCC Additional.NET Concepts

2 Purpose  Web Services using ASP.NET –Basis of MS.NETGrid software  Assemblies  Metadata and reflection  Application configuration

3 ASP.NET and Web Services

4 ASP.NET Features  Unified Web Development Platform  Runs under Microsoft Internet Information Services (IIS): –Available on all Windows Platforms better than Win2K –Requires.NET runtime (CLR)  Combines traditional forms-based Web Application development and Web Services  Runs compiled applications so performs better than traditional ASP  Excellent support in Visual Studio.NET  WYSIWYG-based design like designing Windows Forms

5 Reference  Material from this lecture covered in great detail in your “Building Web Services” book: –Chapter 6 in particular

6 Web Applications in ASP.NET  The files present in a virtual directory under IIS comprise a Web Application: –Isolated application domain for each Web application  Can contain both Web pages and Web Services  Lives in own AppDomain: –Memory protected region within a process, a.NET feature –Protects applications from one another  Requests for a page/service are mapped by IIS to the ASP.NET handler: –aspnet_isapi.dll, aspnet_wp.exe Listen for file extensions. aspx,. asmx etc –Work carried out by a recycled process for efficiency and stability  Configuration is handled by Web.config in the root directory: –Web.config is standard ASP.NET application configuration file

7 Request Handling IIS (aspnet_isapi.dll) Request asmx handler aspx handler Response

8 Web Pages in ASP.NET  HTML lives in. aspx files: –Code can be placed here, or –Code in separate file  Presentation layer separated from logic: –A step away from the ugly embedded ASP model  Supports Web controls: –Reusable UI elements, e.g. menus, date-pickers –Can write custom controls  More details available in.NET framework documentation: –We concentrate on the Web Services aspect

9 ASP.NET Request Handling HTTP request to foo.aspx ASP.NET foo.aspx Compile and execute Output (html) HTTP Response to client

10 Web Services in ASP.NET  Write a class that provides the service functionality: –Tag operations with WebMethod attribute –Tag class with WebService attribute to specify default namespace of the service  Write a. asmx file: –References the implementing class  Can separate. asmx file and source code

11 Web Service Request Handling SOAP request to foo.asmx ASP.NET Foo.asmx Execute Output (SOAP) SOAP Response to client

12 Example Web Service // HelloService.asmx // HelloService.cs [WebService( NameSpace=“ )] public class HelloService { [WebMethod] public string SayHello(string name) { return “Hello there, “ + name); } }  Compile and deploy under ASP.NET: –Easiest with Visual Studio.NET  Build a client

13 Useful Attributes  WebServiceAttribute –BufferResponse –Description –MessageName  Can use WebServiceAttribute to set properties of the service: –[WebService( Namespace=“someURI”, Description=“Some text describing the service”)]

14 Automatic WSDL Generation  ASP.NET will automatically generate WSDL service descriptions  Send WSDL on the query string to see this: –e.g. service at  Reflection on service type to generate this document: –Uses e.g. WebMethod attributes to generate operation elements  Can control contents of WSDL document with attributes: –e.g. SoapDocumentMethodAttribute  Can suppress WSDL generation and do custom generation

15 Building Web Service Clients  Idea is that accessing a Web Service is as simple as making method call  Use the WSDL description to auto-generate client ‘proxy’ classes .NET Framework provides wsdl.exe tool: –wsdl /o:ServiceProxy.dll –Examines a WSDL document –Outputs a DLL with a class that represents the service: Derived from SoapHttpClientProtocol class, which handles serialization, invocation, etc –Highly integrated with Visual Studio.NET: Does wsdl.exe behind the scenes, adds proxy stub to project automatically

16 Web Services Enhancements  SDK to support emerging W3C Web Services protocols that address: –Security (WS-Security) –Policy –Routing –Custom SOAP Attachments –Reliable messaging  Now at version 2.0: –

17 Assemblies

18 Assemblies  Assemblies are the unit of code distribution in.NET  May be independently versioned  May be digitally signed  Scope the types within them  Are the basis of Code Access Security: –Code from an assembly can do certain things based on level of trust of assembly provider

19 Working with Assemblies  Logical assembly consists of a number of modules (files): –Primary module references the other modules –Primary module identifies assembly –Most cases only one module  Assemblies contain code, data and/or resources: –e.g icon byte streams.  Assemblies scope the types and data within them: –public, private, internal (package level in Java) modifiers apply to types at assembly level –Same type defined in different assemblies == different types  Assembly names are resolved by the runtime before loading: –Must reside in APPBASE or subdirectory: APPBASE is standard location off application directory, usually /bin APPBASE can be changed using configuration files

20 Assembly Identification  Assemblies may be strongly-named or weakly-named: –Weakly-named just identified by the name of the primary module, minus the.dll or.exe –Strongly-named have version, culture, public key as well  Concurrent versions of an assembly stored in the Global Assembly Cache: –Can only store strongly-named  Can specify dependence of application on particular assembly in configuration file

21 Dynamic Assembly Loading  Can work with Assemblies programmatically: –Members on the System.Reflection.Assembly class –Assembly.Load –Assembly.LoadFrom –Assembly.CreateInstance(string typeName) –Assembly.GetCustomAttributes()  Important to know about assemblies for our OGSI implementation

22 Using Metadata

23 Attributes  Attributes allow you to add metadata to your types: –Enables a declarative style of programming  Can use framework-supplied or custom attributes  Information from attributes are stored in metadata for that type  Example: public class MyClass { [System.Obsolete(“Will be removed next release”)] public void SomeObsoleteMethod() { } }

24 Common Attribute Uses  Conditional compilation/calling: [Conditional(“DEBUG”)] public void myDebugMethod(string s) { }  XML serialisation: [XmlElement(“name”, someNameSpace) public string name_;  Web Service operations: [WebMethod] public string MyWebMethod() { }

25 Custom Attributes  Can define own attribute: –Inherit from System.Attribute –Define usage using – you guessed it – an attribute!  Example: [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)] public class SomeUsefulAttribute : System.Attribute { public SomeUsefulAttribute(string s) { } } // Use like [SomeUseful(“Hello”)] public class SomeClass { }

26 The Reflection API  Can get access to your attributes using this API: public void SomeCode() { object [] customAttributes = someObject.GetType().GetCustomAttributes( typeof(SomeUsefulAttribute)); foreach(SomeUsefulAttribute attr in customAttributes) { //process } }  Can get attributes on methods, fields, etc in a similar manner: –See the.NET documentation for System.Reflection namespace

27 Application Configuration

28 Application Configuration  Previously ad-hoc, comma-separated value files, language-specific etc: –Lots of different standards .NET aims to provide consistent configuration for every application: –XML file-based –XML file in same directory as application usually  System.Configuration namespace provides API for doing this: –Extensible to use your own configuration schema  Web applications use the Web.config file as default

29 Example Configuration File......

30 Other.NET Topics of Interest  Win32/COM interoperation: –Legacy integration  WinForms: –Smart clients, href-exes (executables over HTTP)  Asynchronous execution: –Threads, delegates  Support for event-driven programming in C#  ADO.NET  XML Libraries