1 / 20

Introduction to Web Application

Introduction to Web Application. Introduction to Web Services. Topics. Service Oriented Architecture Web Services Architectures and Service-Oriented Architecture Roles in a Web Services Architecture Publish Services SOAP Demo a simple Web Service. Service-Oriented Architecture.

kwein
Télécharger la présentation

Introduction to Web Application

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction to Web Application Introduction to Web Services

  2. Topics • Service Oriented Architecture • Web Services Architectures and Service-Oriented Architecture • Roles in a Web Services Architecture • Publish Services • SOAP • Demo a simple Web Service

  3. Service-Oriented Architecture Service Registry Publish WSDL UDDI Find WSDL UDDI Bind SOAP WSDL Service Provider Service Requester

  4. UDDI SOAP SOAP IIS SOAP Web Service Any Client Web Services As an Implementation of a Service-Oriented Architecture

  5. CASE: An Electronic Funds Transfer Web Service Contoso MicropaymentWeb Service Woodgrove Bank Web Service Firewall Firewall Internet Firewall Northwind Electronic Funds Transfer Web Service Web Service Consumer

  6. Roles in a Web Services Architecture • The Web Service Provider • The Web Service Requester • The Web Service Registry

  7. The Web Service Provider • Web servers • The .NET Common Language Runtime • Examples of Web service providers

  8. The Web Service Requester • Minimum functionality • Service location • Proxies • Asynchronous calls • Examples of Web service consumers

  9. The Web Service Registry • Interactions between brokers and providers • Interactions between brokers and requesters • UDDI registries

  10. Web service developer builds and deploys a pricing Web service 1 5 1 Web service developer registers and categorizes the Web service 2 Pricing Web Service 3 Web service consumer queries UDDI for “pricing” services 3 UDDI Services 2 Web service consumer determines the most appropriate “pricing” service 4 Web service developer builds a solution that directly consumes the Web service data 5 Overview of Using UDDI 4

  11. SOAP Fundamentals • Overview of SOAP • Structure of SOAP Messages

  12. Overview of SOAP • SOAP messages • Parts of a SOAP message • SOAP envelope • SOAP encoding rules • SOAP RPC representation • Protocol bindings for HTTP and HTTP-EF

  13. Structure of SOAP Messages <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi=“…" xmlns:xsd=“…" xmlns:soap="http://schemas.xmlsoap.or g/soap/envelope/"> <soap:Head> <WoodgroveAuthInfo xmlns=“…"> <Username>string</Username> <Password>string</Password> </WoodgroveAuthInfo> </soap:Head> <soap:Body> <ToCelsius xmlns="http://tempuri.org/"> <TF>double</TF> </ToCelsius> </soap:Body> </soap:Envelope> • SOAP Envelope • SOAP Header • SOAP Body • SOAP Fault <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/”> <soap:Body> <soap:Fault> <faultcode>123XYZ</faultcode> <faultstring>Server Error</faultstring> <detail> … </detail> </soap:Fault> </soap:Body> </soap:Envelope>

  14. Create A simple Web Service • TemperatureService [WebMethod] publicdouble ToCelsius(double TF) { Count++; return (5.0/9)*(TF-32); }

  15. Test Web Service

  16. Using Proxy to invoke Web Services Web Service Web Service Consumer • Proxies and WSDL • Generating Proxies Using Wsdl.exe • Configuring Proxies

  17. Generating Proxies Using Wsdl.exe wsdl [options] {URL | Path} • Syntax for invoking Wsdl.exe • Proxy class details Example wsdl  http://localhost/class15/TemperatureService.asmx?wsdl Example wsdl /l:cs /protocol:HttpPost /out:Bank.cs  http://localhost/class15/TemperatureService.asmx?wsdl

  18. Configuring Proxies • Proxy property • AllowAutoRedirect property • Url property • Credentials property • Timeout property Bank theBank = new Bank(); theBank.Url = "http://eastcoast.woodgrovebank.com/Bank.asmx"; ICredentials credentials = new NetworkCredential ("Adam", "ABarr-user", "woodgrovebank.com"); theBank.Credentials = credentials; theBank.Timeout = 20000; IWebProxy proxyObject = new WebProxy("http://proxyserver:80", true); theBank.Proxy = proxyObject; theBank.AllowAutoRedirect = true;

  19. Web Forms Client Web Service Consumer Demonstration: Implementing a Web Forms Client • Create an ASP.NET Web application • Add a Web reference • Invoke the Web service by using the proxy

  20. Review • Service Oriented Architecture • Web Services Architectures and Service-Oriented Architecture • Roles in a Web Services Architecture • Publish Services • SOAP • Demo a simple Web Service

More Related