Intro To WServices
Intro To WServices
Srinath Vasireddy
Support Professional
Developer Support
Microsoft Corporation
Agenda
What is a Web service?
Technologies used
XML, SOAP, WSDL, DISCO, and UDDI
Walkthrough creating a Web service
Walkthrough creating a Web service client
References
Q&A
2
What is a Web Service?
A programmable application component that
is accessible via standard Internet protocols
Web page with functions
Available for a variety of clients
Examples: stock quotes, traffic conditions,
calculators, news, weather, et cetera
3
Technologies Used
Standard way to represent data
XML (and XML schemas)
Common, extensible message format
SOAP
Common, extensible contract language
Web Services Description Language (WSDL)
Way to discover site services
Disco
Way to discover service providers
Universal Description, Discovery, and Integration (UDDI)
4
XML
Extensible Markup Language
Language for describing documents with
structured data
Industry standard
XML Schemas – XSD
XML based
Language for describing data types
For more information, read:
http://msdn.microsoft.com/library/en-us/dnwebsrv/html/xmloverchap2.asp
5
SOAP
A simple, XML-based protocol for exchanging
structured and type information on the Web
Industry standard
Lightweight and XML-based protocol
Can support different protocols and formats:
HTTP, SMTP, and MIME
SOAP message
For more information, read:
http://msdn.microsoft.com/soap/
6
WSDL
It is an XML document describing Web
services
Define data types (XSD)
Define messages in terms of types
Define bindings to transport protocol, message
format
SOAP 1.1, HTTP Get/Post, MIME
Define services as collections of ports
WSDL.exe
For more information read:
http://msdn.microsoft.com/library/en-us/dnwebsrv/html/wsdlexplained.asp
7
DISCO
Document Discovery
A client finds a particular Web services by
discovery
Document discovering services at a
particular URL
Document is in XML format
Document has .disco and .vsdisco
extensions
Disco.exe
8
UDDI
Universal Description, Discovery, and Integration
Enables businesses to publish and discover
information about who provides what services
Specification for distributed Web service
registries: white pages, yellow pages, and
green pages
Builds on HTTP, XML, and SOAP
For more information, read:
http://msdn.microsoft.com/library/en-us/dnexxml/html/xml12182000.asp
http://www.uddi.org/about.html
9
Web Services Platform
ASP.NET
ATL Server
.NET remoting
Microsoft® SOAP Toolkit
10
ASP.NET Web Service
Leveraging existing ASP developers
Easy to build, deploy, and administer as a
Web application
File extension is .asmx
End point is represented by URL
11
Creating a Web Service (1)
Open Microsoft Visual Studio® .NET
Select the language
Select the project type: ASP.NET Web Service
12
Creating a Web Service (2)
.asmx and .asmx.cs
Web.config
Global.asax
WebService1.vsdisco
13
Creating a Web Service (3)
Inside Service1.asmx
14
Creating a Web Service (4)
Inside Service1.asmx.cs
Add WebService attribute’s Namespace
property
[WebService(Namespace="http://localhost/webservice1/")]
public class Service1 : System.Web.Services.WebService
16
Creating a Web Service (6)
Run the Web service
17
Creating a Web Service Client (1)
Create a Microsoft Visual C#™ console application
18
Creating a Web Service Client (2)
Add Web reference (1)
19
Creating a Web Service Client (3)
Add Web reference (2)
20
Creating a Web Service Client (4)
Proxy file is created: Reference.cs
21
Creating a Web Service Client (5)
Client code
using System;
namespace ConsoleApplication1
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
localhost.Service1 wsproxy = new localhost.Service1();
Console.WriteLine(wsproxy.HelloWorld());
}
}
}
22
Creating a Web Service Client (6)
Run the Web service client
23
Summary
What is a Web service?
Technologies used
XML, SOAP, WSDL, DISCO, and UDDI
Walkthrough of creating a Web service
Walkthrough of creating a Web service client
24
References
Programming the Web with XML Web
services
Visual Studio .NET Help
ms-help://MS.VSCC/MS.MSDNVS/vsent7/html/vxconProgrammableWebServices.htm
25
Thank you for joining us for today’s Microsoft Support
WebCast.