23
Computer Science 101 Computer Science 101 Web Services Web Services

Computer Science 101

  • Upload
    thuy

  • View
    27

  • Download
    0

Embed Size (px)

DESCRIPTION

Computer Science 101. Web Services. Alsos Search for Niels Bohr. AtomicArchive.Com Article on Niels Bohr. AtomicArchive.Com Article on Niels Bohr (cont.). Produces Alsos Search. Alsos Search for Niels Bohr. A specific reference. That’s what they get, not what they want!. - PowerPoint PPT Presentation

Citation preview

Page 1: Computer Science 101

Computer Science Computer Science 101101

Web ServicesWeb Services

Page 2: Computer Science 101

Alsos Search for Niels BohrAlsos Search for Niels Bohr

Page 3: Computer Science 101

AtomicArchive.Com Article on AtomicArchive.Com Article on Niels BohrNiels Bohr

Page 4: Computer Science 101

AtomicArchive.Com Article on AtomicArchive.Com Article on Niels Bohr (cont.)Niels Bohr (cont.)

Produces Alsos Search

Page 5: Computer Science 101

Alsos Search for Niels BohrAlsos Search for Niels Bohr

Page 6: Computer Science 101

A specific referenceA specific reference

Page 7: Computer Science 101

That’s what they get, not what That’s what they get, not what they want!they want!

We are providing them with a mechanism, We are providing them with a mechanism, “dynamic links”, that enable them to do “live” “dynamic links”, that enable them to do “live” searches into Alsos – not just link to the Alsos searches into Alsos – not just link to the Alsos home page, but …home page, but …

The user ends up in Alsos site, not Atomic The user ends up in Alsos site, not Atomic Archives.Archives.

They would like a way to get data They would like a way to get data (annotations) from Alsos that they could (annotations) from Alsos that they could format within their pages.format within their pages.

Page 8: Computer Science 101

What if we wanted to provide What if we wanted to provide this:this:

Suppose we wanted to provide a mechanism Suppose we wanted to provide a mechanism for developers to get data from us for use on for developers to get data from us for use on their web pages.their web pages.

We would not want them to access our We would not want them to access our database with SQL statementsdatabase with SQL statements– Might change databaseMight change database– Want control of the kind of data we let them Want control of the kind of data we let them

havehave

Would not want to restrict to platform, .NET, Would not want to restrict to platform, .NET, Linux, etc.Linux, etc.

Page 9: Computer Science 101

What if we wanted to provide What if we wanted to provide this:this:

(cont.)(cont.) We would need a platform We would need a platform

independent means of sharing dataindependent means of sharing data

That’s exactly what XML is all about – That’s exactly what XML is all about – it’s text based, marked up data.it’s text based, marked up data.

Web service – software component Web service – software component that you call over the web.that you call over the web.– Accepts and returns XML dataAccepts and returns XML data

Page 10: Computer Science 101

The Big PictureThe Big Picture

Just like HTML provides a standard Just like HTML provides a standard way for marking up text for web way for marking up text for web page display, XML provides a page display, XML provides a standard way for marking up data.standard way for marking up data.

Web services then provide a Web services then provide a standard way for programs to pass standard way for programs to pass this data back and forth to each this data back and forth to each other.other.

Page 11: Computer Science 101

Example – Google ServiceExample – Google Service

Page 12: Computer Science 101

Search ButtonSearch Button

private void btnSearch_Click (Object sender, System.EventArgs e){

GoogleSearchResult result = null;GoogleSearchService google;ResultElement re;google = new GoogleSearchService();this.lstURLs.get_Items().Clear();for (int i = 0; i < 20; i += 10) // get first 20 hits total{ result = google.doGoogleSearch("4a8/TvZQFHID0WIWnL1CMmMx0sNqhG8H",

this.txtSearch.get_Text(), i, 10, false, "", false, "", "", ""); for (int j = 0; j< result.resultElements.length; j++) {

re = result.resultElements[j];this.lstURLs.get_Items().Add(re.URL);

} this.lstURLs.Refresh();}//for-n-hitsthis.lblHits.set_Text( String.valueOf(result.estimatedTotalResultsCount) );

MessageBox.Show("Search complete, first 20 hits are shown!");}

Page 13: Computer Science 101

Item SelectedItem Selected

private void lstURLs_SelectedIndexChanged (Object sender, System.EventArgs e){

java.lang.Object a, b, c, d;a = b = c = d = null; // optional parameters

// navigate to selected site!this.axWebBrowser1.Navigate(this.lstURLs.get_Text(), a, b, c, d);

}

Page 14: Computer Science 101

Terra ServiceTerra Service

Page 15: Computer Science 101

Stock TickerStock Ticker

Page 16: Computer Science 101

Movie TheatersMovie Theaters

Page 17: Computer Science 101

Xmethods.netXmethods.net

Page 18: Computer Science 101

Movie ServiceMovie Service

Page 19: Computer Science 101

Movie Service DescriptionMovie Service Description

Page 20: Computer Science 101

Movie – Code for Find Movie – Code for Find ButtonButton

Page 21: Computer Science 101

Movie – Code for Theater Movie – Code for Theater SelectionSelection

Page 22: Computer Science 101

Industry ScenarioIndustry Scenario

Suppose we have a huge industrial Suppose we have a huge industrial manufacturing company.manufacturing company.

The parts we need are supplied by a The parts we need are supplied by a number of different suppliers.number of different suppliers.

At a given time we may prefer one At a given time we may prefer one supplier over the others based on supplier over the others based on – Current price they offerCurrent price they offer– Adequacy of their inventory relative to our Adequacy of their inventory relative to our

needs.needs.

Page 23: Computer Science 101

Industry Scenario (cont.)Industry Scenario (cont.)

Assuming that all of these suppliers Assuming that all of these suppliers provide web services for our use, our provide web services for our use, our decision and purchase could be decision and purchase could be automated:automated:– Our inventory/purchasing program could Our inventory/purchasing program could

communicate our needs to all of the communicate our needs to all of the supplier web services and receive their supplier web services and receive their price and inventory informationprice and inventory information

– Based on these results, our program Based on these results, our program could choose the lowest price among could choose the lowest price among suppliers with acceptable inventories.suppliers with acceptable inventories.