22
Web Services: the next Web Services: the next generation web application generation web application Ekaraj Ekaraj Kongswangwongsa Kongswangwongsa Developer Evangelist Developer Evangelist Microsoft (Thailand) Limited Microsoft (Thailand) Limited

Web Services: the next generation web applicationdownload.microsoft.com/.../web_services.pdf · Web Services: the next generation web application Ekaraj Kongswangwongsa Developer

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Web Services: the next generation web applicationdownload.microsoft.com/.../web_services.pdf · Web Services: the next generation web application Ekaraj Kongswangwongsa Developer

Web Services: the next Web Services: the next generation web application generation web application

EkarajEkaraj KongswangwongsaKongswangwongsa

Developer EvangelistDeveloper Evangelist

Microsoft (Thailand) LimitedMicrosoft (Thailand) Limited

Page 2: Web Services: the next generation web applicationdownload.microsoft.com/.../web_services.pdf · Web Services: the next generation web application Ekaraj Kongswangwongsa Developer

AgendaAgenda

�� OverviewOverview

�� Building a Web ServiceBuilding a Web Service

�� Creating Web Service ClientsCreating Web Service Clients

�� Beyond the basicsBeyond the basics

Page 3: Web Services: the next generation web applicationdownload.microsoft.com/.../web_services.pdf · Web Services: the next generation web application Ekaraj Kongswangwongsa Developer

1st & 2nd Generation Web Apps1st & 2nd Generation Web Apps

1-1 correspondence of page to file

Browser

Web ServerWeb Server

File

“Dynamic Pages”

Browser

File

Web Server

DB In-housesystems

Page 4: Web Services: the next generation web applicationdownload.microsoft.com/.../web_services.pdf · Web Services: the next generation web application Ekaraj Kongswangwongsa Developer

3rd Generation Web 3rd Generation Web

File DB

“Dynamic Pages”

Browser

Web Server

InIn--househousesystemssystems

“The F

irew

all”

Web site

Web site

Web site

Accessing another site today = HTML “screen scraping”or “your architect calls my architect”

Tomorrow, external Web sites become building blocks using XML Web Services

Web service

Web service

Web service

Page 5: Web Services: the next generation web applicationdownload.microsoft.com/.../web_services.pdf · Web Services: the next generation web application Ekaraj Kongswangwongsa Developer

Overview of Web ServicesOverview of Web ServicesThe .NET VisionThe .NET Vision

Web Web SiteSiteWeb Web

ServiceServiceWeb Web

ServiceService

XMLXML

““BuildingBuilding--Block Block

ServicesServices””HTMLHTML

ClientClient

XML

XML

ClientClientXMLXML

Web Web ServiceService

XML

XML

Web Web ServiceService

XMLXML

XM

LXM

L

XML

XML

ClientClientXMLXML

Web Web ServiceService

XML

XML

Web Web ServiceService

XMLXML

XM

LXM

L

Page 6: Web Services: the next generation web applicationdownload.microsoft.com/.../web_services.pdf · Web Services: the next generation web application Ekaraj Kongswangwongsa Developer

What is a Web Service?What is a Web Service?

�� A web service is programmable A web service is programmable application logic accessible via application logic accessible via standard Web protocolsstandard Web protocols

�� Available to a variety of clients (platform Available to a variety of clients (platform independent)independent)

�� Examples: stock quote, weather, and work Examples: stock quote, weather, and work flow, team collaborationflow, team collaboration

�� Makes building distributed applications Makes building distributed applications easyeasy

�� A web application without a user A web application without a user interfaceinterface

Page 7: Web Services: the next generation web applicationdownload.microsoft.com/.../web_services.pdf · Web Services: the next generation web application Ekaraj Kongswangwongsa Developer

Foundation for Web ServicesFoundation for Web Services

Service Interaction:Service Interaction: SOAPSOAP

Data Format:Data Format: XMLXML

Format Description: Format Description: XML SchemaXML Schema

Service Directory:Service Directory: UDDIUDDI

Service Description:Service Description: WSDLWSDL

Communication Network: Communication Network: InternetInternet

Communication Protocol: Communication Protocol: HTTPHTTP

WSDL: Web Services Description Language

Page 8: Web Services: the next generation web applicationdownload.microsoft.com/.../web_services.pdf · Web Services: the next generation web application Ekaraj Kongswangwongsa Developer

Let me talk to you (SOAP)Let me talk to you (SOAP)

Web Services (In Practice)Web Services (In Practice)

DesignDesign--Time or DynamicTime or Dynamic RuntimeRuntime

How do we talk? (WSDL)How do we talk? (WSDL)http://http://yourservice.comyourservice.com/?WSDL/?WSDL

XML with service descriptionsXML with service descriptions

http://yourservice.com/svc1http://yourservice.com/svc1

XML/SOAP BODYXML/SOAP BODY

Web Web ServiceService

WebWebService Service

ConsumerConsumer

UDDIUDDI

Find a ServiceFind a Servicehttp://http://www.uddi.orgwww.uddi.org

Link to WSDL documentLink to WSDL document

Page 9: Web Services: the next generation web applicationdownload.microsoft.com/.../web_services.pdf · Web Services: the next generation web application Ekaraj Kongswangwongsa Developer

AgendaAgenda

�� OverviewOverview

�� Building a Web ServiceBuilding a Web Service

�� Creating Web Service ClientsCreating Web Service Clients

�� Beyond the basicsBeyond the basics

Page 10: Web Services: the next generation web applicationdownload.microsoft.com/.../web_services.pdf · Web Services: the next generation web application Ekaraj Kongswangwongsa Developer

Web ServicesWeb Services

.ASMX.ASMX.ASMX

Class CoursewareClass CoursewareClass CoursewareClass Courseware

WebMethodWebMethodWebMethodWebMethod

GetPriceGetPriceGetPriceGetPrice

PurchasePurchasePurchasePurchase

Class CoursewareClass CoursewareClass CoursewareClass Courseware

WebMethodWebMethodWebMethodWebMethod

GetPriceGetPriceGetPriceGetPrice

PurchasePurchasePurchasePurchase

Source codeSource code

Page 11: Web Services: the next generation web applicationdownload.microsoft.com/.../web_services.pdf · Web Services: the next generation web application Ekaraj Kongswangwongsa Developer

Web ServicesWeb Services

.ASMX.ASMX.ASMX

TestingTesting

Courseware.asmxCourseware.asmx

Test HTML PageTest HTML Page

Page 12: Web Services: the next generation web applicationdownload.microsoft.com/.../web_services.pdf · Web Services: the next generation web application Ekaraj Kongswangwongsa Developer

demodemo

Building Web ServiceBuilding Web Service

Page 13: Web Services: the next generation web applicationdownload.microsoft.com/.../web_services.pdf · Web Services: the next generation web application Ekaraj Kongswangwongsa Developer

AgendaAgenda

�� OverviewOverview

�� Building a Web ServiceBuilding a Web Service

�� Creating Web Service ClientsCreating Web Service Clients

�� Beyond the basicsBeyond the basics

Page 14: Web Services: the next generation web applicationdownload.microsoft.com/.../web_services.pdf · Web Services: the next generation web application Ekaraj Kongswangwongsa Developer

Web ServiceWeb ServiceCreating a Web Service ClientCreating a Web Service Client

SOAP proxySOAP proxy

codecode

Web serviceWeb service

the Internet

Page 15: Web Services: the next generation web applicationdownload.microsoft.com/.../web_services.pdf · Web Services: the next generation web application Ekaraj Kongswangwongsa Developer

Web ServicesWeb Services

.ASMX.ASMX.ASMX

Courseware.asmx?WSDLCourseware.asmx?WSDL

Service Definition(XML)Service Definition(XML)

Proxy

DLL

Proxy Proxy

DLLDLL

Generating a proxy from WSDLGenerating a proxy from WSDL

Page 16: Web Services: the next generation web applicationdownload.microsoft.com/.../web_services.pdf · Web Services: the next generation web application Ekaraj Kongswangwongsa Developer

Web ServicesWeb Services

.ASMX.ASMX.ASMXProxy

DLL

Proxy Proxy

DLLDLL

Register for CourseRegister for Course Purchase CoursewarePurchase Courseware

Page 17: Web Services: the next generation web applicationdownload.microsoft.com/.../web_services.pdf · Web Services: the next generation web application Ekaraj Kongswangwongsa Developer

Creating ClientsCreating Clients

�� Use either commandUse either command--line tool, or Visual line tool, or Visual Studio.NETStudio.NET

�� Builds proxy source from WSDLBuilds proxy source from WSDL

�� WSDL is platform independentWSDL is platform independent

�� Classes can be created in C#, VB, or Classes can be created in C#, VB, or managed C++managed C++

�� Any .NET language!Any .NET language!

Page 18: Web Services: the next generation web applicationdownload.microsoft.com/.../web_services.pdf · Web Services: the next generation web application Ekaraj Kongswangwongsa Developer

Building a ClientBuilding a Client

demodemo

Page 19: Web Services: the next generation web applicationdownload.microsoft.com/.../web_services.pdf · Web Services: the next generation web application Ekaraj Kongswangwongsa Developer

AgendaAgenda

�� OverviewOverview

�� Building a Web ServiceBuilding a Web Service

�� Creating Web Service ClientsCreating Web Service Clients

�� Beyond the basicsBeyond the basics

Page 20: Web Services: the next generation web applicationdownload.microsoft.com/.../web_services.pdf · Web Services: the next generation web application Ekaraj Kongswangwongsa Developer

Beyond the basicsBeyond the basics

�� Dynamic URL BehaviorDynamic URL Behavior

�� Returning Complex TypesReturning Complex Types

�� Asynchronous Web ServiceAsynchronous Web Service

�� SOAP HeaderSOAP Header

�� StatefulStateful Web ServiceWeb Service

�� Transfer Binary DataTransfer Binary Data

Page 21: Web Services: the next generation web applicationdownload.microsoft.com/.../web_services.pdf · Web Services: the next generation web application Ekaraj Kongswangwongsa Developer

Session SummarySession Summary

�� Web Services Are The Building Blocks Web Services Are The Building Blocks For The Next Generation Of The InternetFor The Next Generation Of The Internet

�� Gives Client Access to any kind of DataGives Client Access to any kind of Data

�� Make BusinessMake Business--toto--Business EasyBusiness Easy

�� Visual Studio .NET Provides Great Visual Studio .NET Provides Great ToolsTools

Page 22: Web Services: the next generation web applicationdownload.microsoft.com/.../web_services.pdf · Web Services: the next generation web application Ekaraj Kongswangwongsa Developer

©© 2001 Microsoft Corporation. All rights reserved.2001 Microsoft Corporation. All rights reserved.