Presentation is loading. Please wait.

Presentation is loading. Please wait.

Web Services from 10,000 feet Part I Tom Perkins NTPCUG CertSIG XML Web Services.

Similar presentations


Presentation on theme: "Web Services from 10,000 feet Part I Tom Perkins NTPCUG CertSIG XML Web Services."— Presentation transcript:

1 Web Services from 10,000 feet Part I Tom Perkins NTPCUG CertSIG XML Web Services

2 03/23/2007tom perkins2 What is an XML Web Service XML Web Service black box a software component has a global reach Consumer An interface Exposes well-defined methods Call using std Internet protocols Pass parameters in XML format Receive responses in XML format Consumer’s view Can be application specific, in-house Usually available over Internet Examples: Microsoft.NET Passport Google Web Services Amazon Web Services B2B, B2C(onsumer) apps

3 03/23/2007tom perkins3 SOAP Simple Object Access Protocol (Industry Standard) Used by consumers of web services –Send requests to –Receive response from Protocol - Built on top of HTTP It defines an XML grammar used to –Specify names/methods user wants to invoke –Define parameters and return values –Describing types of parameters and return values Calls to web service must use SOAP grammar to specify method and parameters 5

4 03/23/2007tom perkins4 What is WSDL? Body of SOAP message is XML – a set of tags for encoding the parameters for the message How does the client know how to set up the XML schema? Ans: Web service supplies a description of itself Request: http://localhost/NorthwindServices/ProductService.asmx?wsdl Web service sends back a description (Web Service Description); schema defined by Web Service Description Language (WSDL) Client can construct a SOAP request Visual Studio tools –Parses WSDL –Creates proxy object –Client can use the proxy object to convert method calls into SOAP requests. 8

5 03/23/2007tom perkins5 More SOAP Use SOAP to transfer complex data structures between client and web service –Input parameters –Output parameters –Return values Example –Class holds info re products in NorthWind –Many properties – ProductID, Product Name, etc –We’ll create web method to return an instance of this class

6 03/23/2007tom perkins6 SOAP Serialization Converts class to XML Sends serial string across the network Class reconstructed from serial string at the consumer (marshalling) Serialization is automatic, largely transparent Only public fields and properties can be marshalled Each marshalled item must have both get and set accesssors Class must have a default (no parameters) constructor 7

7 03/23/2007tom perkins7 DEMO Web Service Web Consumer to follow Uses Northwind database Exposes 2 web methods –Given Product Name and quantity, calculate the cost of buying quantity –Given Product Name, return the details for that product


Download ppt "Web Services from 10,000 feet Part I Tom Perkins NTPCUG CertSIG XML Web Services."

Similar presentations


Ads by Google