dot net web services agenda web services discussion quick dot net demo assignment assignment ...

15
DOT NET WEB SERVICES Agenda Web Services Discussion Quick DOT NET DEMO Assignment Lab: Hello World Service/Client Lab: Google Client Lab: Open Search Info Source

Post on 19-Dec-2015

213 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: DOT NET WEB SERVICES Agenda  Web Services Discussion  Quick DOT NET DEMO  Assignment Assignment  Lab: Hello World Service/Client  Lab: Google Client

DOT NET WEB SERVICESAgenda

Web Services Discussion Quick DOT NET DEMO Assignment Lab: Hello World Service/Client Lab: Google Client Lab: Open Search Info Source

Page 2: DOT NET WEB SERVICES Agenda  Web Services Discussion  Quick DOT NET DEMO  Assignment Assignment  Lab: Hello World Service/Client  Lab: Google Client

Importance of Web Services

Larry Page, on why Google introduced its search API:

“Within a few years, there will be more programs (agents) accessing Google than people accessing Google.”

Page 3: DOT NET WEB SERVICES Agenda  Web Services Discussion  Quick DOT NET DEMO  Assignment Assignment  Lab: Hello World Service/Client  Lab: Google Client

Web Services Discussion

1. Define web service2. What is the “problem” that web

services address?3. What are the emerging standards

for web services. Who supports each? What are the advantages of each?

Page 4: DOT NET WEB SERVICES Agenda  Web Services Discussion  Quick DOT NET DEMO  Assignment Assignment  Lab: Hello World Service/Client  Lab: Google Client

What is a web service?

A remote procedure call (RPC) over HTTP.

A web-accessible operation that takes input and returns results in XML.

Like a web page, but just the data with no presentation specifications.

Web definitions

Page 5: DOT NET WEB SERVICES Agenda  Web Services Discussion  Quick DOT NET DEMO  Assignment Assignment  Lab: Hello World Service/Client  Lab: Google Client

Without Web Services:Content and Presentation mixed

Database

Servlet

html

• Data can only be viewed in forms provided by Server.

• Data left hidden in database.

• Scrapers not robust or ethical.

Page 6: DOT NET WEB SERVICES Agenda  Web Services Discussion  Quick DOT NET DEMO  Assignment Assignment  Lab: Hello World Service/Client  Lab: Google Client

Web Services allow 3rd parties to display data how ever they want

Database

Service

Servlet A Servlet CServlet B

xmlxml

xml

html htmlhtml

Page 7: DOT NET WEB SERVICES Agenda  Web Services Discussion  Quick DOT NET DEMO  Assignment Assignment  Lab: Hello World Service/Client  Lab: Google Client

Examples

Bookstores Using Amazon API

If Google Scholar had a service, could develop graph view, etc.

Page 8: DOT NET WEB SERVICES Agenda  Web Services Discussion  Quick DOT NET DEMO  Assignment Assignment  Lab: Hello World Service/Client  Lab: Google Client

Web Services Allow for Aggregators

Database A

Database B Database C

Database D

Service BService A

Service C

Service D

Aggregator Servlethtml

xml

xmlxml xml

Page 9: DOT NET WEB SERVICES Agenda  Web Services Discussion  Quick DOT NET DEMO  Assignment Assignment  Lab: Hello World Service/Client  Lab: Google Client

Competing Web Service Standards

XML-RPC SOAP (along with WSDL, UDDI)

Microsoft and IBM strong backers Popular in B2B More overhead Complex Data types XML spec facilitates automated service discovery Better tool support, currently.

REST Gaining Popularity Hacker/Blogger Crowd Little ovehead, String oriented (no complex data) Automated discovery???

Page 10: DOT NET WEB SERVICES Agenda  Web Services Discussion  Quick DOT NET DEMO  Assignment Assignment  Lab: Hello World Service/Client  Lab: Google Client

WSDL, SOAP, UDDI

WSDL – Web Service Description Language

SOAP – Simple Object Access Protocol

UDDI – Universal Description, Discovery, and Integration

Page 11: DOT NET WEB SERVICES Agenda  Web Services Discussion  Quick DOT NET DEMO  Assignment Assignment  Lab: Hello World Service/Client  Lab: Google Client

IDE Support

• Programmer writes class in favorite language

• Programmer marks as “web service”

• IDE generates wsdl file and soap service

• walla!

Writing a Service

Writing a Client

•Programmer provides uri of some web service

•IDE generates client stub

•Programmer makes calls to service methods.

Page 12: DOT NET WEB SERVICES Agenda  Web Services Discussion  Quick DOT NET DEMO  Assignment Assignment  Lab: Hello World Service/Client  Lab: Google Client

XML is the plumbing

Client Server

Java C#

Generated SOAP

Generated SOAP

Plumbing: programmers need not worry

Page 13: DOT NET WEB SERVICES Agenda  Web Services Discussion  Quick DOT NET DEMO  Assignment Assignment  Lab: Hello World Service/Client  Lab: Google Client

DOT NET DEMO

Service Client Display Code

See Google Client Sample:http://cs.usfca.edu/~wolber/

SoftwareDev/Distributed/WebServices/VisualStudio.Net/GoogleClientForm.aspx.cs

Page 14: DOT NET WEB SERVICES Agenda  Web Services Discussion  Quick DOT NET DEMO  Assignment Assignment  Lab: Hello World Service/Client  Lab: Google Client

Sample Wrappers

A Google Open Search Web Service:http://cs.usfca.edu/~wolber/SoftwareDev/Distributed/WebServices/VisualStudio.Net/GoogleWTService.asmx.cs

A Feedster Wrapper:http://cs.usfca.edu/~wolber/SoftwareDev/Distributed/WebServices/VisualStudio.Net/Feedster.cs

Page 15: DOT NET WEB SERVICES Agenda  Web Services Discussion  Quick DOT NET DEMO  Assignment Assignment  Lab: Hello World Service/Client  Lab: Google Client

Resources

Hello World Tutorial -- http://www.cs.usfca.edu/~wolber/SoftwareDev/Distributed/WebServices/VisualStudio.Net/serviceTutorial3.7.05.htmGoogle API Tutorial -- http://www.cs.usfca.edu/~wolber/SoftwareDev/Distributed/WebServices/VisualStudio.Net/googleClientTutorial3.7.05.html

O'Reilly's Visual Studio .Net Web ServicesO'Reilly's ASP.Net Web Forms

A Directory With Various Notes on Web Services: http://www.cs.usfca.edu/~wolber/SoftwareDev/Distributed/WebServices/

Want to try this in Java? I have a rough draft partial tutorial using the Apache Axis tool: http://www.cs.usfca.edu/~wolber/SoftwareDev/Distributed/WebServices/Axis%20Java%20Web%20Services/tutorial.htm