Windows Communication Foundation and Web Services

Slides:



Advertisements
Similar presentations
Michael S. Chan xLM Solutions, LLC
Advertisements

Intesar G Ali IT DepartmentPalestinian Land Authority Web services Prepared by: Intesar Ali IT Department PLA August 2010.
WCF Intro Scott Reed Owner - Brain Hz Software Instructor – DevelopMentor
Web Services Darshan R. Kapadia Gregor von Laszewski 1http://grid.rit.edu.
Web Services Nasrullah. Motivation about web service There are number of programms over the internet that need to communicate with other programms over.
Zoiner Tejada Hershey Technologies. About Zoiner Tejada.
 Introduction  WCF Definition  WCF Architecture  Implementation  WCF Demo Overview.
Windows Communication Foundation and Web Services.
The Microsoft Technical Roadshow 2006 Windows Communication Foundation Mike Taulty Developer & Platform Group Microsoft Ltd
1 Web Services Visual C# 2008 Step by Step Chapter 30.
Module 13: WCF Receive Adapters. Overview Lesson 1: Introduction to WCF Receive Adapters Lesson 2: Configuring a WCF Receive Adapter Lesson 3: Using the.
Getting Started with Windows Communication Foundation 4.5 Ed Jones, MCT, MCPD, MCTS Consultant RBA Inc.
Getting Started with WCF Windows Communication Foundation 4.0 Development Chapter 1.
Introduction SOAP History Technical Architecture SOAP in Industry Summary References.
INTRODUCTION TO WEB DATABASE PROGRAMMING
[Title of the course] WCF
Agenda What Is the Windows Communication Foundation? How Does It Work? How Do I Use and Deploy It? Bindings Addresses Contracts How to host WCF services.
Module 14: WCF Send Adapters. Overview Lesson 1: Introduction to WCF Send Adapters Lesson 2: Consuming a Web Service Lesson 3: Consuming Services from.
Microsoft Visual Studio 2010 Muhammad Zubair MS (FAST-NU) Experience: 5+ Years Contact:- Cell#:
James Holladay, Mario Sweeney, Vu Tran. Web Services Presentation Web Services Theory James Holladay Tools – Visual Studio Vu Tran Tools – Net Beans Mario.
Microsoft Visual Studio 2010 Muhammad Zubair MS (FAST-NU) Experience: 5+ Years Contact:- Cell#:
Intro to WCF From the beginning and uses Steve AppRochester.
11 Web Services. 22 Objectives You will be able to Say what a web service is. Write and deploy a simple web service. Test a simple web service. Write.
Random Logic l Forum.NET l Web Services Enhancements for Microsoft.NET (WSE) Forum.NET ● October 4th, 2006.
Mahesh Krishnan, Senior Consultant, Readify Slide 1.
Telerik Software Academy Web Services & Cloud.
Kemal Baykal Rasim Ismayilov
ASP.NET Web Services.  A unit of managed code installed under IIS that can be remotely invoked using HTTP.
Windows Communication Foundation David Anderson Independent Software Developer DCOM Productions.
Presentation 24: Windows Communication Foundation Introduced Objektorienteret Netværkskommunikation.
Agenda What Is the Windows Communication Foundation? How Does It Work? How Do I Use and Deploy It? Bindings Addresses Contracts How to host WCF services.
Web Services An Introduction Copyright © Curt Hill.
.NET Mobile Application Development XML Web Services.
EGEE is a project funded by the European Union under contract IST Introduction to Web Services 3 – 4 June
DEVELOPING WEB SERVICES WITH JAVA DESIGN WEB SERVICE ENDPOINT.
SOAP, Web Service, WSDL Week 14 Web site:
Shani Raba Team Leader & Software Architect
OE-NIK HP Advanced Programming WCF WCF SOAP service, host, client Exception handling (NOT required)
OE-NIK HP Advanced Programming Web services Standards and protocols Using web services Using web services with asynchronous calls.
Introduction to Web Services Srinath Vasireddy Support Professional Developer Support Microsoft Corporation.
The Mechanics of HTTP Requests and Responses and network connections.
1 Chapter 1 INTRODUCTION TO WEB. 2 Objectives In this chapter, you will: Become familiar with the architecture of the World Wide Web Learn about communication.
Java Web Services Orca Knowledge Center – Web Service key concepts.
Windows Communication Foundation
Segments Introduction: slides 2–7 10 minutes
Windows Communication Foundation
Windows Communication Foundation
Sabri Kızanlık Ural Emekçi
WEB SERVICES From Chapter 19 of Distributed Systems Concepts and Design,4th Edition, By G. Coulouris, J. Dollimore and T. Kindberg Published by Addison.
Window Communication Foundation
WEB SERVICES.
Presentation 23 .NET Remoting Introduced
Distribution of functionality Webservice using WCF
Windows Communication Foundation and Web Services
Windows Communication Foundation
Remote Method Invocation
Implementing a service-oriented architecture using SOAP
WEB API.
Web Server Administration
Creating a Distributed System with Remote Procedure Calls and Web Services Ch.5 B.Ramamurthy 2/17/2019 B.Ramamurthy.
WebServices Using JAX-RPC
Student: Popa Andrei-Sebastian
WEB SERVICES From Chapter 19, Distributed Systems
Chapter 42 Web Services.
Distributed System using Web Services
SOAP web services in Microsoft Azure
WCF Data Services and Silverlight
Presentation transcript:

Windows Communication Foundation and Web Services

A Word About Attributes The statements inside the brackets are considered attributes Attributes are declarative information about c# code Don’t confuse the term Attribute here with an HTML attribute

A Word About Interfaces An interface contains the signatures of methods, properties, events or indexers A class that implements the interface must implement the members of the interface that are specified in the interface definition The interface name typically start with the letter I (capitalized)

A Word About Interfaces The class named ImplementationClass implements ISampleInterface

WCF (Introduction) It’s Microsoft’s current inter-machine communication foundation used to integrate HTTP requests and responses Web Services Messaging Lower-level TCP/IP Ajax / REST services And everything else

And I’ll start out by saying it’s complicated WCF (Introduction) And I’ll start out by saying it’s complicated

WCF Fundamentals Simply put, it’s a set of APIs used to send messages between services and clients Messages are sent between endpoints using a transport protocol (such as (such as HTTP / TCP and others)

WCF Model (1)

WCF Model (2)

WCF Model (Contracts) Operation contracts belong to a service contract Service contracts describe the precise format of messages This is done using HTTP or another protocol The service contract defines the interface to the outside world Operation contracts belong to a service contract These are really the methods of the contract

WCF Model (Contracts) We are talking about the format of Function calls Parameters Return types These are message signatures The programming model defines how we write the code to do all of this

WCF Model (Contracts)

WCF Model (Contract) Request-Reply Request-Reply services This is the default type of service Clients make a request for service (synchronously or asynchronously) Clients receive a response Duplex services

WCF Model (Contract) One Way In a One-Way service, the client sends a request but does not expect a response To detect errors, create two One-Way service contracts

WCF Model (Contract) Duplex Both endpoints can send messages independently These are implemented using the idea of a callback To implement, create two interfaces The first is the one-way client interface The second is the callback contract Refer to http://msdn.microsoft.com/en-us/library/ms731064(v=vs.110).aspx

WCF Model (Service Runtime) This layer defines the behavior of the runtime service (server configuration) We configure the service runtime using behaviors There is much more detail here beyond the scope of this course

WCF Model (Service Runtime) How many messages are processed at a time InstanceContextMode / ConcurrencyMode How many instances of a server can run (singleton) InstanceContextMode Threading and reentrancy ConcurrencyMode

WCF Model (Messaging) Transport channels are of two types Transport channels send and receive messages TCP, HTTP, MSMQ Protocol channels implement the messaging protocols HTTP

WCF Model (Hosting) Simply put, it’s where the application runs (is hosted) Might be IIS or WAS

WCF Model (Hosting)

WCF Model (Hosting)

WCF Model (Hosting - IIS) This is the easiest way to host your service IIS treats the service as an ASP.NET Web Site If you are using IIS6, then only HTTP and HTTPS are supported You can create a self-hosted console (or forms) application that listens for requests at a particular port We can also host through Azure Services

WCF and Web Services WCF has changed the .net picture of Web Services They used to be a standalone product type etc… They are now just another service within the context of WCF

The Goal of Web Services Supply a standard means for e-commerce applications to communicate using different hardware and software platforms Supply a way for legacy applications to communicate Provide a universal way to discover the available services and the methods supplied by a particular service so that any consumer can call those methods

Logical Web Service Model

Web Service Vendors IBM – WebSphere Studio Application Developer SAP – SAP Web Application Server SUN – Sun ONE Web Services Platform Developer Edition And of course Microsoft and Visual Studio .NET Others are likely to follow No matter the vendor, Web services will always work the same way Any consumer should work with any provider

Web Service Protocols Web services provide a hardware and software agnostic way to call remote functions and return data from those remote functions Protocols HTTP is the message transfer agent Simple Object Access Protocol (SOAP) Web Service Description Language (WSDL)

Creating A Web Service Create a new Web side using the WCF Service project type

Web Service (Steps to Create) Design the service contract Implement the service contract This is done via attributes Configure the service endpoints Host the service Build client applications

Web Service Implementation (Steps) Declare the members of the interface that will be implemented in the .svc file Implement those members in the corresponding class

The Role of App.Config App.Config operates similarly to Web.Config Here, it’s used to configure a Web Service All of this appears inside of <system.serviceModel> We could also hardcode this

App.config (Bindings) Bindings define the transport protocol details needed for a client to communicate with a service Predefined (provided) bindings <BasicHttpBinding> <NetTcpBinding> Custom bindings

App.config (Bindings) Here we bind to three different services

App.config (Endpoints) Endpoints allow clients to access a Web service Consists of An address (URL that points to the service) Name of a binding (how to communicate with the endpoint) The contract defining the methods available

App.config (Endpoints) We communicate with three services

Service Contract A service contract exposes one or more service operations A ServiceContract defines the types of messages used in a conversation A ServiceOperation defines the messages themselves

Service Contract (Example 1)

Service Contract (Example 2) Use a class instead of creating an interface and implementing that interface

Data Contract Simply put, simple types do not require a data contract. Complex types do Serializable parameters do not require a data contract A DataContract describes a type that will be serialized by the service A DataMember describe the members of the DataContract type

Data Contract (Example 1)

Configure Service Endpoints (1) Communication occurs through service endpoints and four properties Address of the endpoint A binding that specifies how a client can communicate with the endpoint A contract the defines the allowable operations Local implementation details

Configure Service Endpoints (2) We can configure endpoints via Code In the config (web.config) file

Configure Service Binding (1) Most bindings are provided with WCF Use BasicHttpBinding for most Web services

Host the Service IIS must be installed on the server

Compiling the Service The service is compiled the same way as any other .NET app. If you run it, you see a “special” test client window The code is generated by .NET itself

Test Service (Illustration 1)

Test Service (Illustration 2)

Creating the Test Client Create a WPF or Windows forms application Insert the template code created by Svcutil.exe into this project While the service is running locally, add a service reference In a production app, you will have this URL Change the name of the endpoint in app.config

Adding the Service Reference (Example)