.Net Framework Overview

sizzledgooseSoftware and s/w Development

Nov 3, 2013 (3 years and 10 months ago)

127 views

1
.Net Framework
Information Integration on the Web
Spring 2002
January 17, 2002
Overview
•.Net framework overview & features
• Web services
• Web services protocols
• Why .Net?
• Develop web services
• Consume web services
2
.Net Framework Overview
• XML web services
– XML, SOAP, UDDI
– ASP.NET
• Common language runtime
– C#, VB.NET, Managed C++
Common Language Runtime
Base Framework Classes
Data and XML Classes
XML Web
Services
Web
Forms
Windows
Forms
ASP.NET
Common Language Runtime
Base Framework Classes
Data and XML Classes
XML Web
Services
Web
Forms
Windows
Forms
ASP.NET
What We Are Not Going to Cover
About .Net
• No Common Language Runtime(CLR)
• We don’t expect you to become experts at
C# or VB.NET
What We Are Going to Cover
About .Net
• Develop Web Services
• Consume Web Services
• Build simple applications with C#, VS.NET
3
.Net Framework Features
• Rapid development
– ASP.NET controls
– Separation of code and control
– Unified programming framework
– Multi-language support
• Simple integration
– XML web services
– Deep SOAP support
– Automatic WSDL generation
– ADO.NET
• Reliable operations
Web Services Defined
• Definition
– According to IBM “web services are self-
contained, modular applications that can be
described, published, located, and invoked over
a network, generally, the world wide web”
– According to Microsoft “a web service is
programmable application logic, accessible
using standard internet protocols”
4
Web Services: Major Protocols
• XML
• SOAP
• WSDL
• UDDI
Why .Net Framework?
• Small details that count
– Automatic WSDL generation
– Automatic SOAP and HTTP support
– Inherent support for XML
– Programmer-friendly
– Support for multiple languages
– Microsoft designed it !!
5
Small Details: Examples
• Sample WSDL
– http://www.w3.org/2001/04/wsws-proceedings/uche/wsdl.html
• Sample SOAP message
– http://www.soapclient.com/whois.html
Where am
I missing a
“>”
????…???
Developing .Net Framework Web
Service
Hands on Lab
Create Hello World Web Service
Develop a simple web service that
sends a message Hello World.
6
Creating Hello World Web
Service
When VS.NET comes up click on new project to begin
Tip: VS.NET can make machine run really slow, be patient
Creating Hello World Web
Service (Cont’d)
Pick Visual C# projects and select ASP.NET Web Service
Tip: Remember the location of your web service, also make sure IIS
is running on the machine.
7
Creating Hello World Web
Service (Cont’d)
You will see the standard VS.NET IDE, click on switch to code view
to see the code behind the web service
Creating Hello World Web
Service (Cont’d)
Uncomment the four lines that have code for Hello World method.
8
Developing .Net Framework Web
Service
Hands on Lab
Create Hello World Web Service
Let’s See Web Service in Action
Hello World Web Service
• What just happened?
– VS.NET created test page for hello world
– VS.NET also created WSDL for hello world
– VS.NET also enabled hello world to ‘talk’
SOAP, WSDL and XML over HTTP
• Why do we care about WSDL?
– WSDL can be used by programs like VS.NET
or users to integrate our web service with their
apps or web services
9
Web Services
• Building blocks for building applications
that integrate information
Geocoded
Restaurant List
with Ratings
Name, Address,
Lat, Long, Rating
Ratings
Rating
Geocoded
Restaurant List
Name, Address,
Lat, Long
Restaurant List
Name, Address
City, State
Geocode
Lat, Long
Address
Integrating Web Services Using
Visual Studio.Net
Hands on Lab
Get Imagery by Using Terraservice
Develop a windows application that
takes a latitude and longitude and
provides satellite image of the area by
querying
TerraService
.
10
Building Application Using
TerraService Web Service
Pick Visual C# projects and select Windows Application
Building Application Using
TerraService Web Service
From the toolbox click on button and drag a button on the form.
Tip: If there is no toolbox use view --> toolbox
11
Building Application Using
Terraservice(cont’d)
From the toolbox click on picturebox and drag a picturebox on the
form, set the properties for height and width to 400.
Building Application Using
Terraservice(cont’d)
Follow similar techniques and drag three labels and two textboxes
and set their properties.
12
Building Application Using
Terraservice(cont’d)
Double click on the Submit button to see the action related to the
submit button.
Building Application Using
Terraservice(cont’d)
Right click on the name of the project and select Add Web Reference
13
Building Application Using
Terraservice(cont’d)
In the address bar type
http://terraservice.net/TerraService.asmx?wsdl
and click on the
green arrow, then click Add Reference
Building Application Using
Terraservice(cont’d)
Type in highlighted code in the function submitbutton_click, next
slide describes what the code does.
14
Building Application Using
Terraservice(cont’d)
//variable declaration
double lat = 0;
double lon = 0;
bool flag = false;
//simple try catch to make sure that user puts in latitude and longitude
try
{
lat = System.Convert.ToDouble(lattext.Text);
lon = System.Convert.ToDouble(lontext.Text);
flag = true;
}
catch (Exception exp)
{
label3.Text = "Please input latitude and longitude first";
flag = false;
}
Building Application Using
Terraservice(cont’d)
if (flag)
{
//initialize new latitude, longitude point from the lat long given by user
net.terraservice.LonLatPt lp = new net.terraservice.LonLatPt();
lp.Lat = lat;
lp.Lon = lon;
//initialize new terraservice object
net.terraservice.TerraService ts = new net.terraservice.TerraService();
//get a bounding box around area of interest
net.terraservice.AreaBoundingBox abb =ts.GetAreaFromPt(lp,net.terraservice.Theme.Photo,
net.terraservice.Scale.Scale1m, 400, 400);
//build URL to send to terraservice
net.terraservice.TileId tid = abb.NorthWest.TileMeta.Id;
tid.Theme = (net.terraservice.Theme)1;
String URL = "http://terraservice.net/gettile.ashx?t=" + (Int32)tid.Theme +"&s=" +
(Int32)tid.Scale +
"&x=" +tid.X + "&y=" +tid.Y + "&z=" +tid.Scene;
//get imagery from terraservice using the url
pictureBox1.Image = getImageFromTerraServer(URL);
}
15
Integrating Web Services Using
Visual Studio.Net
Hands on Lab
Get Imagery by Using Terraservice
Let’s See the Application in Action
Conclusion
• Issues
– Web services discovery
– Object identification
– Web service content description
• Solutions
– Web services discovery
• Directory services, e.g. UDDI
– Web service content description
• Resource Description Framework(RDF), Semantic web ??
– Object identification
• Active learning techniques ??
16
Conclusion (Cont’d)
• More Information on .Net framework
– http://msdn.microsoft.com/library/
Click on
.Net development
– http://www.gotdotnet.com
• Questions, comments?
– Email : thakkar@isi.edu
• Office Hours on Tuesday in Sal200c