WEB 200 Web Services Introduction Matt Powell And
WEB 200: Web Services: Introduction Matt Powell And Scott Seely MSDN Architectural Samples Team Microsoft Corporation
Agenda l l l What is a Web Service? SOAP, WSDL and other standards Web Services and Real world requirements for business applications Microsoft tools for creating Web Services Scenarios for Web Services
What Is A Web Service? l l “Libraries” providing data and services to other applications Uses standard Web protocols like HTTP, XML and SOAP Combines the best aspects of component –based development and the Web The core of the Microsoft. NET vision
Traditional Approaches Libraries, Classes, and Objects Good § Shared Code Bad § § § Requires redistributing code Network capabilities had to be written into the code Usually OS dependent
Traditional Networking Approaches Winsock, RPC, DCOM Ø Ø Ø Winsock flexible but complicated and requires implementing your own protocol. RPC and DCOM use the NDR protocol which hasn’t proven particularly useful in Internet scenarios. RPC and DCOM are basically OS dependent.
The Web Service Approach l l l Shared Code Network Support built in Uses standard protocols so truly cross-platform Easy to use from your own applications Does not require installation of an application specific DLL or COM component
Temperature Service running on Apache SOAP IIS using ASP and SOAP Toolkit v 2 Favorites Service running on Microsoft SOAP Toolkit v 2 Stock Quote Service running on The Mind Electric’s GLUE News Service running on SQLData Systems’, Inc. SOAP Server
Function Get. Stock. Quote(By. Val symbol As String) _ As Double Dim soap. Obj As New Soap. Client soap. Obj. mssoapinit _ "C: Tech. EdStock. Quote. Service. wsdl", _ "Stock. Quote. Service", "Stock. Quote. Port" Get. Stock. Quote = soap. Obj. get. Quote(symbol) Set soap. Obj = Nothing End Function
Web Service Standards WSDL Client SOAP (XML) HTTP TCP/SSL UDDI DISCO Web Service
What Is SOAP? l l Simple Object Access Protocol (SOAP) XML based message format Among other things, SOAP can represent remote procedure calls and responses Provides a flexible way to express application defined datatypes
SOAP Over HTTP l l l Can work through existing proxies and firewalls Can take advantage of HTTP authentication Support for Secure Socket Layer (SSL) based off underlying HTTP support
A SOAP Request <SOAP-ENV: Envelope xmlns: SOAP-ENV= “http: //schemas. xmlsoap. org/soap/envelope/”> <SOAP-ENV: Header> <Custom. Header TID=“ 011 F 28” /> </SOAP-ENV: Header> <SOAP-ENV: Body> <m: Get. Batting. Average xmlns: m=“http: //www. seattlemariners. org”> <m: Player. Number>11</m: Player. Number> <m: Year>2001</m: Year> </m: Get. Batting. Average> </SOAP-ENV: Body> </SOAP-ENV: Envelope>
A SOAP Response <SOAP-ENV: Envelope xmlns: SOAP-ENV= “http: //schemas. xmlsoap. org/soap/envelope/”> <SOAP-ENV: Header> <Custom. Header TID=“ 011 F 28” /> </SOAP-ENV: Header> <SOAP-ENV: Body> <m: Get. Batting. Average. Response xmlns: m=“http: //www. seattlemariners. org”> <m: Batting. Average> 311 </m: Batting. Average> </m: Get. Batting. Average. Response> </SOAP-ENV: Body> </SOAP-ENV: Envelope>
What is WSDL? l l l Web Services Description Language (WSDL) Provides a contract that defines a Web interface XML based format Can define a schema for any interface (not just SOAP) Defines endpoints
SOAP Interfaces With WSDL l l Defines any custom data types For RPC web services, defines the message format for SOAP requests and responses for all methods exposed by our service Specifies the Protocol Binding (SOAP over HTTP) Specifies the endpoint URL
Inside The WSDL File Custom Data Types <s: complex. Type name="Player"> <s: sequence> <s: element min. Occurs="1" max. Occurs="1" name="Name" nillable="true" type="s: string" /> <s: element min. Occurs="1" max. Occurs="1“ name="Average" type="s: double" /> <s: element min. Occurs="1" max. Occurs="1" name="Year" type="s: long" /> <s: element min. Occurs="1" max. Occurs="1“ name="Number" type="s: short" /> </s: sequence> </s: complex. Type>
Inside The WSDL File SOAP Message Body Formats <s: element name="Get. Batting. Average"> <s: complex. Type> <s: sequence> <s: element min. Occurs="1“ max. Occurs="1" name="player. Number“ type="s: short" /> <s: element min. Occurs="1“ max. Occurs="1" name="year“ type="s: long" /> </s: sequence> </s: complex. Type> </s: element>
Inside The WSDL File Protocol Binding <soap: binding transport= "http: //schemas. xmlsoap. org/soap/http" style="document" /> Endpoints <soap: address location= "http: //localhost/Baseball. Service. asmx" />
SOAP With WSDL l l Cross-platform Easy to Use Discoverable Aggregation
Other Standards l l l DISCO -- Discovery UDDI – Universal Description Discovery Integration XML extensions Ø XML Signature Syntax Ø XML Encryption Direct Internet Message Encapsulation (DIME) Protocols built on SOAP Ø XML for Analysis (Data Access) Ø Others
Business Needs l l l l Security Reliability Performance Availability Scalability Manageability Interoperability
Web Service Security l Authentication Ø Ø l Encryption Ø Ø l HTTP Authentication Schemes: Basic, Integrated, Digest, SSL Client Certificates Application Level Authentication SSL XML Encryption Non-repudiation Ø XML Signature Syntax
Web Farm Deployment
Reliability l WSDL defines exposed interfaces Ø Ø Ø l Only requests that match the defined syntax are allowed in Less variation in inputs to validate Less chance for missing attackable development bugs HTTP SOAPAction header allows for SOAP request restriction at the proxy level
Interoperability l l Use of standards allows for crossplatform support—whether you demand it now or want platform flexibility for the future Using standard protocols means we work on your existing HTTP infrastructure
Microsoft Tools l l ASP. NET Visual Studio. NET Ø Ø l l SOAP Toolkit 2. 0 Office XP IE Web Services Behavior. NET Enterprise Servers Ø Ø l Importing Web Services ATL Server SQL Server Biz. Talk . NET Services (Hailstorm)
Web Service Scenarios l l Free Internet Licensed Internet Business to Business Intranet
Free Web Services On The Internet Educational or Public Service Ex. : Census data online Commercial Internet Site Ex. : Online store Advertising – providing access to data paid for by the person providing the data Ex. : Advertisement Service
Licensed Web Services On The Internet Licensed to End Users Ex. : Stock Market Access Licensed to Portal Sites Ex. : Favorites Service, News Service Licensed to Businesses Ex. : SAP-Like Services
Business To Business Order placement/Billing Ex. : PO purchasing requests Service Requests Ex. : Shipping Requests Content Sharing Ex. : MSDN Online Support Services Ex. : Support Request and Tracking Tool
Intranet Scenarios Different UI for different department needs Ex. : Sales Reporting Cross Platform Ex. : Human Relations management where payroll is on one platform and benefits is on another Aggregation benefits Ex. : Expose 3 rd party service as an Intranet service with company specific data and restrictions
Scenarios Demo
Add. Favorite Portal Angie Web Service (ex. MSN, Earth. Link) (ex. Cold Rooster) Add coldrooster. com Logon(user. Name, pw) Key Add. Favorite(key, “Angie”, “coldrooster. com”) Success
Scenarios Demo
Call To Action l l See the other talks in the Web Services and XML Standards Track See our experiences with the Favorites Service at http: //www. coldrooster. com See the MSDN Web Services Guidance page at http: //msdn. microsoft. com/webservices for content and specifications Create and use Web Services!
- Slides: 37