Presentation is loading. Please wait.

Presentation is loading. Please wait.

Creating & Consuming Web Services MIS 424 MIS 424 Professor Sandvig Professor Sandvig.

Similar presentations


Presentation on theme: "Creating & Consuming Web Services MIS 424 MIS 424 Professor Sandvig Professor Sandvig."— Presentation transcript:

1 Creating & Consuming Web Services MIS 424 MIS 424 Professor Sandvig Professor Sandvig

2 Overview – Web Services What are Web Services? Benefits Who is using them Using in.NET –How to create –How to consume

3 What are Web Services? Web services allow applications to communicate with each other via Internet Islands of data Huge databases –Every large organization –Can’t communicate, share Between organizations Within organizations

4 What are Web Services? Underlying Technologies –XML Defines data content –SOAP Simple object access protocol –Protocol  rules Advantage –HTTP: name-value pairs –SOAP: data relationships Data types Both are W3.org standards –Supported by all major vendors

5 Why Now? Historically –Physical distance –Small data pipelines Now –Internet, fiber optics, … –Distance not a problem Recent: mid-1990’s Limitation –Need common language & protocols Solution –Web Services: XML & Soap

6 Who is using? Amazon –Retrieve shipping info –Expose product database UPS –Shipping status, pricing information, etc. Google –Expose database –Tap creativity of programmers Ideas for free Ideas for free Others?? –Difficult to tell, background process Overstock.com web site

7 Using Web Services in.NET Web Service Namespaces –Implements XML & SOAP technologies –Dozens of classes High level Handle messy details –MSDN Documentation Documentation Heavily promoted functionality of.NET

8 Using Web Services Two roles: –Create Expose your data/application to other –Consume Utilize web services offered by others

9 Creating Web Services Visual Studio: –Add new item: Web Service.asmx file

10 Creating Web Service Default.asmx file:

11 Creating Web Services Example:Testing –Via HTTP Request.asmx file –CreateWebService.asmx, (source.doc) CreateWebService.asmxsourceCreateWebService.asmxsource

12 Consuming Web Service Create proxy –Visual Studio 1. Add service reference… 2. Paste in web service description language (wsdl) –VS creates classes that utilize service 3. Use like any other classes

13 Consuming Web Service Visual Studio Paste web service URL

14 Consuming Web Service WSDL returns service description: –Give descriptive name and click OK

15 Consuming Web Service Visual Studio creates class (proxy) representing web service Adds info to web.config

16 Consuming Web Services Service now represented by class Service methods visible via Intellisense

17 Consuming Web Service Example: –ConsumeWebService.aspx ConsumeWebService.aspx –.asmx files can handle AJAX calls See assignment 4 –ObjectDataSource control: Use VS wizard to select web service class

18 Summary – Web Services Allow applications to communicate –Connect islands of data Based upon W3 standards.NET support –Very easy to publish & consume


Download ppt "Creating & Consuming Web Services MIS 424 MIS 424 Professor Sandvig Professor Sandvig."

Similar presentations


Ads by Google