Download presentation
Presentation is loading. Please wait.
Published byHilda Gibson Modified over 8 years ago
1
WEB SERVICES Jonas Haustad
2
HOW DOES A WEB SERVICE WORK Client request WSDL from web service Client create client-side code Client sends XML request to server Server responds with XML data Independent of environment C# Web service C# Client WSDL XML response XML request Python Client Java Client...
3
SIMPLE WEB SERVICE EXAMPLE [SERVER] NumberService.asmx: using System; using System.Web.Services; Namespace TestService { [WebService (Namespace = ”http://localhost/Service")] public class NumberService: WebService { [WebMethod] public int AddNumbers (int number1, int number2) { return number1 + number2; }
4
SIMPLE WEB SERVICE EXAMPLE [CLIENT] NumberServiceClient.cs: using System; Class NumberServiceClient { public static void Main(String[] args) { int n; SimpleNumberService ns = new SimpleNumberService(); n = ns.AddNumbers(20, 15); Console.WriteLine(20 + " + " + 15 + " = " + n); }
5
WHY USE WEB SERVICE + Versatility Can be used by many platforms (SOAP/XML) + Easy to use Obtain WSDL and generate code stub - Overhead by using XML
6
PROJECT Create a web service in C# Currency converter Create clients in C#, Java and Python Contact server using xml
7
LINKS http://mono-project.com/Writing_a_WebService http://mono-project.com/Web_Services http://www.ibm.com/developerworks/library/ws- soap/?dwzone=ws http://localhost/w/NumberService.asmx
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.