Tải bản đầy đủ (.pdf) (19 trang)

Microsoft .NET and XML Web Services Kimmo Bergius

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (767.08 KB, 19 trang )

10/22/2002 2:24 PM

Microsoft .NET and
XML Web Services
Kimmo Bergius
Product Marketing Manager
Microsoft Oy


1


10/22/2002 2:24 PM

Agenda
l

Microsoft .NET
Ø

l
l
l

l

l

The what
what,, why
why,, and how


how?
?

XML in .NET
Web Services in .NET
Wrap -up
Slides available at Microsoft Finland
presentation archive
()
For questions

Technology requirements
l

Computing power
Ø
Ø

l

Everyhting is networked
Ø
Ø

l

Cheap and available Internet
Wireless

Multitude of devices

Ø

l

Doubles in 18 months
Scalability of Intel/PC Servers

PDA, mobile phone, PC, laptop,
TV, toaster, gas pump…

Internet Standards
Ø

XML, …

2


10/22/2002 2:24 PM

What is .NET?

l

l

.NET is Microsoft’s new architecture for
developing applications on top of
Windows and the Microsoft product line
.NET is the new implementation of

Windows DNA

.NET – Why ?
l

Technology requirements
Ø
Ø
Ø

l

Developer requirements
Ø
Ø
Ø

l

Integration
New application types
New user interfaces
RAD – ease of app development
Support for many languages
languages…

…but – shared features and the same deve
environment

Windows DNA

Ø
Ø

Has been developed furing a long time
Lots of features == Complex
Complex?
?

3


10/22/2002 2:24 PM

Microsoft .NET
New application development environment

l

Windows Apps (PC/other devices)
Web/Internet/intranet
Web Services

Ø
Ø
Ø

Standards in a central role

l


XML etc.
Web Services

Ø
Ø

Enhance developer productivity

l

Choose any language
Shared libraries
Shared dev environment

Ø
Ø
Ø

Language neutral
All development in the same

§
§

§language
§class library
§dev tool

.NET Framework
VB


C++

C#

Perl Python

Web Service
ASP.NET



Shared class libraries

UI

u

ADO.NET: storage and XML
u

Base Class Library

u

Common Language Runtime

u
MSMQ
(Message

Queuing)

COM+
(Transactions, Partitions,
Object Pooling)

IIS

Same programming
model from one
language to the other
Integration between
languages
Extensibility
Tools

WMI

Win32

ASP.NET

Common Language Runtime

u

u

Web Services and Web UI’s


Basic functionality: program
compilation and execution,
memory management, security

4


10/22/2002 2:24 PM

Execution model
VB

Native
Code

VC

Install

...

Perl

IL

Common Language Runtime
JIT compilation

Native
Code


• Code verification
• Security
• Compilation
• Execution
• Threads

Support for many languages
l

.NET is language neutral
Ø
Ø
Ø

l

Microsoft languages
Ø

l

All .NET languages are equal
Integration between languages
One dev environment
Visual Basic®, C++, C#, J#, JScript®

Third parties
Ø


APL, COBOL, Eiffel, Fortran, Haskell, ML,
Perl,, Python, RPG, Scheme, Smalltalk, …
Perl

5


10/22/2002 2:24 PM

.NET Framework class library
l Used

in all .NET languages

Ø Even

though the class library is mostly
written in C#…
Ø …it can be used in any .NET language
l Shared

between dev environments
l Arranged in a single namespace
Ø (Almost)

all under System.

l Contains:
Ø ASP.NET
Ø ADO.NET

Ø Windows

Forms

Ø etc…

User Interfaces
l

Four different .NET UI’s
1.
2.
3.
4.

l

”Traditional
Traditional”” Windows App
”Mobile” Windows App
”Traditional
Traditional”” Web UI
”Mobile” Web UI

Others
Ø
Ø

Functionality through Web Services
Services…


…and the UI can be almost anything and
anywhere,, on any device
anywhere
device!!

6


10/22/2002 2:24 PM

.NET

Internet

.NET

Framework

Microsoft
Mobile Information
Server

Compact
Framework

New User Interfaces

Windows Forms
ADO.NET


SQL Server CE

MSMQ

Internet

ASP.NET + Mobile
Internet Toolkit
ADO.NET

High Mileage Club Services

Web Services

.NET Framework
Data
l

ASP.NET
Web Forms Web Services
Mobile Devices

Windows
Forms

l

ADO.NET and XML
l


Base Class Library

ADO.NET
Ø

Fastest way to use SQL Data

Ø

Support for XML

Ø

Managed Providers

System.Xml
Ø

XSLT 1.0, XPath 1.0, XSD 1.0,
DOM2

Ø

Extensible

XSLT/XPath
XSLT/
XPath
Ø


Relational data transformation

Ø

W3C compliant

Common Language Runtime

7


10/22/2002 2:24 PM

.NET Supports XML!
l XML
§

l XML
§

l XML
§
§

1.0
/> />xml-- 19980210

Namespaces
/> />xml-- names

names--19990114/

Schemas
/> 1-20010502/
/> />xmlschema-- 2-20010502/

l XPath
§

l XSL/T
§

l DOM
§
§

transformations

/> />xslt-- 19991116

Level 1 and Level 2 Core
/> />Level--1-19981001/
/> />DOM--Level
Level--2-Core
Core--20001113/

l SOAP
§

expressions


/> />xpath--19991116

1.1

/>
XML and data
Controls,
Designers,
Code--gen
Code
gen,, etc

XSL/T, XX-Path,
etc

DataSet
Sync

DataAdapter

DataReader

XmlData-XmlData
Document

XmlReader

Command
Connection


.NET Data Provider

8


10/22/2002 2:24 PM

XML and .NET
l

XML used heavily in .NET
Ø Object
§

serialization format

for example DataSet

Ø .NET

specific, easier API on top of traditional
specific,
XML API
§
§

No support for SAX (MSXML 4.0)
XML DOM (MSXML.DLL) can be used


Ø Remoting
Remoting/RPC
/RPC
§

uses XML

SOAP and XML Web Services

Web Service
l
l
l
l

l

Component call over HTTP
WebApplication = application used by a
user
WebService = application used by
another application
Call to a function/method is packeted as
an XML message that is sent using SOAP
over HTTP or SMTP. Data returned
packeted and sent the same way
Uses SOAP (Simple Object Access
Protocol )., which is language, OS or
architecture neutral


9


10/22/2002 2:24 PM

Web Service - Protocols
Supplier A
Supplier B
Supplier C

Inventory
Company
Order
processing

Customer

Universal Description Discovery
and Integration (UDDI)
Simple Object Access Protocol (SOAP)
Web Service Description Language (WSDL)
eXtensible Markup Language (XML)
Tietojen välityskanava
välityskanava:: Internet

Web Service 1
l

Web Service (.ASMX files in ASP .NET)
Ø

Ø
Ø

Code for services methods
.NET wizard creates the project, programmer adds the
code
Two files are created - codebehind

<%@ WebService Language="c#" Codebehind
Codebehind="Service1.asmx.cs“
="Service1.asmx.cs“
Class="WebService1.Service1" %>
namespace WebService1 {
public class Service1 : System.Web.Services.WebService {
public Service1() {InitializeComponent
{ InitializeComponent();}
();}
private IContainer components = null
null;;
private void InitializeComponent
InitializeComponent(){}
(){}
protected override void Dispose
Dispose(( bool disposing ) {
if(disposing && components != null
null))
{components.Dispose
components.Dispose();}
();}
base.Dispose(disposing);

base.Dispose(disposing
);
}
[WebMethod
WebMethod]]
public string GetId(string strKey
strKey,, string strType
strType)) {
return strKey.ToUpper
strKey.ToUpper()
() + strType.ToUpper
strType.ToUpper();
();
}}}

ASMX
CS

10


10/22/2002 2:24 PM

Web Service 2
Web Service Description Language (WSDL)
Ø Description of the service
Ø How to call the service
Ø Methods, parameters and return values
Ø XML
Ø .NET environment creates automatically

Ø http://wmli003600/WebService1/Service1.asmx?wsdl

l

ASMX
WSDL
XSD

Web Service 3
l

Discovery Documents (DISCO)
ØPublishes Web Services
ØCan be called directly (.vsdisco
(.vsdisco))
ØDescribes the services in a server
http://wmli003600/focus/WebService1/WebService1.vsdisco

<?xml version="1.0" encoding="utf-8" ?>
-xmlns:xsd= />- xmlns:xsi= />xmlns=" />=http://wmli003600/WebService1/Service1.asmx?wsdl
docRef=
=http://wmli003600/WebService1/Service1.asmx
xmlns=" />
</discovery>
>

ASMX


WSDL
DISCO

WSDL

XSD

11


10/22/2002 2:24 PM

Web Service 3






Universal Description, Discovery and Integration
UDDI describes available services
Yellow pages for Web Services
Can be used externally (uddi.microsoft.com
(uddi.microsoft.com,,
uddi.ibm.com))
uddi.ibm.com
Can also be used internally as a local directory for web
services

ASMX

WSDL
UDDI

DISCO
DISCO

WSDL

XSD

Calling Web Services
l

l

Basic call: HTTP Get and HTTP Post
Ø Basic types (int
(int,, string, jne
jne))
Ø Basic type tables
Ø Can be called in a “traditional” way
Ø http://wmli003600/WebService1/Service1.asmx/GetId?str
Key=s1&strType=as
Default: Simple Object Access Protocol (SOAP)
Ø Structures
Ø Enumerations
Ø Classes
Ø XML DataSets
Ø Arrays
Ø Can contain all kinds of structures


12


10/22/2002 2:24 PM

Web Service
l

l
l
l
l

Web Service is a functional conponent or
program , that offers its functionality
through the Web Service interface
Web Services are used through the
network (Internet/intranet)
Data is transferred through XML
Uses standard protocols, such as SOAP,
HTTP, etc.
Main goal is integration between systems
Ø

Without knowing the architecture behind a
system

Where can Web Services be
used

l

Integration scenarios
Ø
Ø
Ø

l

Service to a user – combining services
(B2C)
Services between organisations (B2B)
Integration of internal systems (EAI, A2A)

Write once – use from anywhere

13


10/22/2002 2:24 PM

Cool – are we done?
l
l

Nope, Web services will evolve
Lots of things coming
Ø
Ø
Ø

Ø
Ø

Security
Routing & Referral
Attachments
Transactions
Reliable messaging

Web Services futures
Implementation
Products,
solutions

XML
Web Services
Integrate systems

Compatability
Industry support

Infrastructure
XML

Protocol development

Integrate data

14



10/22/2002 2:24 PM

Modular: Example
SOAP
Message
Routing

Security

<?xml version="1.0" encoding="utfencoding="utf-8"?>
< S:Envelope xmlns:S
xmlns:S="
="http://

schemas.xmlsoap.org/soap/envelope/
/soap/envelope/""
xmlns:xsd=" />xmlns:xsd
=" />xmlns:xsi =" />=" />S:Header>
>
xmlns:m="http://
=" />schemas.xmlsoap.org/rp">
">
m:action>http://tickers
> />us.org/getQuote
m:action>

>
m:to>soap://tickers
>soap://tickers--r-us.org/stocks
us.org/stocks
m:to>
>
m:from>
>mailto:johnsmith@isps
mailto:
us.com
m:from>
>
m:id>uuid:84b9f5d0
>uuid:84b9f5d0--33fb
33fb--4a81
4a81--b02b
b02b--5b760641c1d65b760641c1d6
m:id>
>
m:path>
>

xmlns:wssec=" />xmlns:wssec
=" />ValueType="wssec:X509v3"
ValueType
="wssec:X509v3"
EncodingType=
EncodingType
=“wssec:Base64Binary">
dWJzY3JpYmVyLVBlc…
dWJzY3JpYmVyLVBlc
…..eFw0wMTEwMTAwMD
wssec:BinarySecurityToken>
>
wssec:Security>
>
S:Header>
>
S:Body>
>
xmlns:app="http://
xmlns:app
="

highwaymon.org/payloads">
/payloads">
<road>520W</road><speed>3MPH</speed>
app:TrafficStatus>
>
S:Body>
>
S:Envelope>
>

.NET and standards
l

C# ja “CLI”: ECMA
Ø
Ø
Ø
Ø

l
l
l

Submitted 2000

Standard approved 2001
ISO standard about to be approved
Used in many projects, other platforms

XML, SOAP, WSDL: W3C, IETF, OASIS
Additional development: WS-I,
standardization bodies
Partners in development: HP, Intel,
IBM, Ariba…

15


10/22/2002 2:24 PM

Existing code
l

Old Windows DNA applications
Ø
Ø

l

Can be called from .NET
.NET components can be called from DNA

Third party applications
Ø
Ø

Ø

Ready- made Interfaces
ReadyDatabase connections
XML:
§
§

Data transfer
transfer,, for example BizTalk
Web Services

.NET - tools
l

Visual Studio .NET
Ø

One programming environmentg
§
§

Ø

Extensible
§
§
§

l


All applications
All languages
Visual Studio is the basic tool
Additional features from partners, such as
Rational, Compuware
New languages, testing, dev project
management

MSDN Universal

16


10/22/2002 2:24 PM

Source Code
l

CE.NET
Ø
Ø
Ø

l

Shared Source CLI beta
Ø
Ø
Ø


l

Download (http://
(
www.microsoft.com//embedded
embedded))
Platform Builder for custom versions
OS Source code
CLI – CLR, basic class library
library,, C# compiler
FreeBSD/Windows
FreeBSD
/Windows NT
Dowload (
))

Windows NT/2000
Ø
Ø
Ø

Source code for research use
Big customers can also obtain source code
Requests => Email (
))

.NET - Benefits
l


Many application types
Ø
Ø
Ø

l

Shared programming model
Ø

l

l
l
l
l
l

All application types

Support for multiple languages
Ø

l

User Interfaces
Traditional applications
Web Services

Investments in training


Easier programming
Protect old investments – integration to existing code
Integration to other worlds and architectures
Performance
Security
Newest technology
technology!!

17


10/22/2002 2:24 PM

How to go forward?
l

Web
Ø
Ø

l

Developer products
Ø
Ø

l

Visual Studio .NET

Microsoft Developer Network – MSDN

Programs
Ø
Ø

l

/>

Developer programs – MSDN
Partner programs
programs–
– Microsoft Certified
Solution Provider program



Kysymyksiä ja vastauksia?

18


10/22/2002 2:24 PM

19




×