SlideShare ist ein Scribd-Unternehmen logo
1 von 40
Web Services 
WCF and SOAPUI
OverView 
What is a Web Service ? 
Web Service Technology Stack 
WhyWeb Services? 
How to create , consume and publish a web service? 
What is the difference betweenWeb Services and WCF ? 
WCF in detail 
SOAPUI
What is a Web Service ? 
Web service is a means by which computers talk to each 
other over the web using HTTP and other universally 
supported protocols. 
A Web service is an application that: 
 Runs on a Web server ; 
 Exposes Web methods to interested callers ; 
 Listens for HTTP requests representing 
commands to invoke Web methods ; 
 Executes Web methods and returns the result.
Web Service Technology Stack 
Web Services are based on: 
 HTTP (Hypertext Transport Protocol) 
 SOAP (Simple Object Access Protocol) 
 UDDI (Universal Description, Discovery and 
Integration) 
 WS-POLICY (Web Services Policy) 
Most Web services expect their Web methods to be 
invoked using HTTP requests containing SOAP messages. 
SOAP is an XML-based vocabulary for performing 
remote procedure calls using HTTP and other protocols.
Why using web services ? 
The benefits of using Web Services: 
 Exposing the existing function on to network: 
Web Services allows you to expose the functionality of your 
existing code over the network. 
 Connecting Different Applications ie 
Interoperability: 
Web Services allows different applications to talk to each other 
and share data and services among themselves. Other 
applications can also use the services of the web services. 
 Standardized Protocol: 
Web Services uses standardized industry standard protocol for 
the communication. 
 Low Cost of communication: 
Web Services uses SOAP over HTTP protocol for the 
communication.
How to create a web service? 
When creating a New Project, under the language of your 
choice, select "Web" and then change to .NET Framework 3.5 
and you will get the option to create an ASP.NET WEB 
Service Application.
How to create a web service?
How to create a web service?
How to create a web service?
How to consume a web service?
How to publish a web service?
What is the difference between web 
services and WCF? 
WCF Service supports both http and tcp protocol while 
web services support only http protocol 
WCF service can be hosted in many ways like on 
windows service and self hosting apart from IIS hosting 
while web service can be hosted in IIS 
WCF has more options for security than web services
What is the difference between web 
services and WCF? 
A WCF service can have one or more WCF endpoints thus 
one address for each end point . An endpoint is defined by 
an address, a binding and a service contract. but a Web 
service can have only one address at one point of time 
WCF Service is more flexible than web service because it 
can very easily change add interfaces end points thus 
interacting with a wide range of applications
WCF 
Windows Communication Foundation
• Introduction of WCF 
• Discussion about SOA & WCF 
• When you should use it. 
• What software you need to create a WCF service 
• Advantages & Disadvantages of WCF 
• Architecture of .Net 3.0 & WCF 
• Programming with WCF 
• Services (Service Execution Boundaries, WCF & Location Transparencies) 
• Contracts (Service, Data, Fault and Message) 
• Addresses (TCP, HTTP, IPC, MSMQ and P2P) 
• Hosting (IIS, VS2005, Web.Config, Self, Self * Base Addresses, Advanced, ServiceHost<T> and WAS) 
• Bindings 
• End Points 
• Example of WCF & Implementations
Introduction of WCF 
• WCF is a set of .NET technologies (Web services ,.Net Remoting and 
enterprises services) for building and running connected systems. 
• WCF provides secure, reliable, and transacted messaging along with 
interoperability 
• WCF applications can be developed in any language which can target the .NET 
runtime 
• System.ServiceModel is the assembly that contains core functionality for WCF. 
• A service is a Common Language Runtime (CLR) type that encapsulates 
business functionality and exposes a set of methods that can be accessed by 
remote clients.
When you should use it 
• When your business logic has to interact with a variety of client applications. 
• When client apps, which are going to use your service, may be written in Java 
or .Net. 
• You are targeting a distributed computing architecture.
What software you need to create a WCF service 
• Visual studio 2005 
• .Net Framework 3.0 
• Microsoft Windows Software Development Kit (SDK) 
• Visual studio extensions for WCF and WPF
Advantages of WCF 
Known Advantages: 
• Makes UI programming & distributed programming very easy. 
Reduce complexity by allowing us to focus on single programming model rather than 
learn multiple programming models. 
• Helps us talk to various applications written in various languages with ease which 
means more probable revenues as various applications can start using your core 
services with ease. 
• Helps us forget about interoperability between various underlying web service 
technologies in the past, present and future. 
• With WCF, a single service can be defined and exposed over multiple endpoints to 
support multiple protocols at the same time.
Discussion about SOA & WCF 
1. What is SOA 
SOA is the practice of sequestering the core business functions into independent 
services that don’t change frequently. These services are glorified functions that are 
called by one or more presentation programs. The presentation programs are volatile 
bits of software that present data to, and accept data from, various users. 
SOA is nothing more than separating changeable elements from unchangeable 
elements.
1. Services in WCF 
Description 
The WCF applications expose the functionality through services. A Service is a Common Language 
Runtime(CLR) type that encapsulate business functionality and exposes a set of methods that can be 
accessed by remote clients. 
A service contract is defined by applying the ServiceContractAttribute to a class or interface. When 
applied to a class, the class becomes a service type. When applied to an interface, any class that 
implements the interface becomes a service type. In either case, methods exposed by the class or 
interface must be decorated with the OperationContractAttribute to be considered part of the service 
contract. Methods with this attribute are considered service operations. 
A service type must be hosted before clients can invoke service operations. 
a) Services' Execution Boundaries 
WCF allows the client to communicate with the service across all execution boundaries. 
On the same machine , the client can consume services in the same app domain, 
across app domains in the same process, or across processes.
b) WCF & Location Transparency 
WCF takes the remote programming model of instantiating and using a proxy and uses 
it even in the most local case. Because all interactions are done via a proxy, requiring 
the same configuration and hosting ,WCF maintains the same programming model for 
the local and remote cases; thus it not only enables you to switch locations without 
affecting the client, but also significantly simplifies the application programming 
model.
2. Addresses 
Description: 
In WCF, every service is associated with a unique address. The address provides two important 
elements: the location of the service and the transport protocol or transport schema used to 
communicate with the service. The location portion of the address indicates the name of the target 
machine, site, or network; a communication port, pipe, or queue; and an optional specific path or 
URI. 
a) TCP Addresses 
Ex. net.tcp://localhost:8002/MyService. 
b) HTTP Addresses 
Ex. http://localhost:8001 
c) IPC Addresses 
Ex. net.pipe://localhost/MyPipe 
d) MSMQ Addresses 
Ex. net.msmq://localhost/MyService 
e) Peer Network Addresses 
Peer network addresses use net.p2p for transport, to indicate the use of the Windows peer 
network transport. You must specify the peer network name as well as a unique path and port.
3. Contracts 
Description: 
In WCF, all services expose contracts. The contract is a platform-neutral and standard way of 
describing what the service does. WCF defines four types of contracts. 
a) Service Contracts 
Describe which operations the client can perform on the service. 
b) Data Contracts 
Define which data types are passed to and from the service. WCF defines implicit contracts for 
built-in types such as int and string, but you can easily define explicit opt-in data contracts for 
custom types 
c) Fault Contracts 
Define which errors are raised by the service, and how the service handles and propagates errors 
to its clients 
d) Message Contracts 
Allow the service to interact directly with messages. Message contracts can be typed or untyped, 
and are useful in interoperability cases and when there is an existing message format you have to 
comply with.
4. Hosting 
Description: 
Every WCF service must be hosted in a Windows process called the host process. A single host 
process can host multiple services, and the same service type can be hosted in multiple host 
processes. The host can be provided by IIS, by the Widows Activation Service (WAS) on 
Windows Vista, or by the developer as part of the application. 
So each .NET host process can have many app domains. Each app domain can have zero or more 
service host instances. However, each service host instance is dedicated to a particular service 
type. When you create a host instance, you are in effect registering that service host instance with 
all the endpoints for that type on the host machine that correspond to its base addresses. Each 
service host instance has zero or more contexts.
a) IIS Hosting 
Hosting in IIS is very similar to hosting a classic ASMX web service. You need to create a virtual 
directory under IIS and supply a .svc file. The .svc file functions similar to an .asmx file, and is 
used to identify the service code behind the file and class. 
b) Using VS 2005 
You can use Visual Studio 2005 to generate a boilerplate IIS-hosted service. From the File menu, 
select New Website and then select WCF Service from the New Web Site dialog box. This causes 
Visual Studio 2005 to create a new web site, service code, and matching .svc file. You can also use 
the Add New Item dialog to add another service later on. 
c) Web.Config file 
The web site config file (Web.Config) must list the types you want to expose as services. You need 
to use fully qualified type names, including the assembly name. 
<system.serviceModel> <services> <service name = "MyNamespace.MyService"> ... </service> 
</services> </system.serviceModel> 
d) Self Hosting 
Self-hosting is the name for the technique used when the developer is responsible for providing 
and managing the life cycle of the host process. Self-hosting is used both in the case of wanting a 
process (or machine) boundary between the client and the service, and when using the service in-proc— 
that is, in the same process as the client.
e) Self Hosting & Base Addresses 
You can launch a service host without providing any base address by omitting the base 
addresses altogether. 
f) Advanced Hosting Features 
The ICommunicationObject interface supported by ServiceHost offers some advanced 
features. 
g) ServiceHost<T> Class 
You can improve on the WCF-provided ServiceHost class by defining the 
ServiceHost<T> class. 
h) WAS Hosting 
The Windows Activation Service (WAS) is a system service available with Windows 
Vista. WAS is part of IIS7, but can be installed and configured separately. To use the 
WAS for hosting your WCF service, you need to supply a .svc file, just as with IIS. The 
main difference between IIS and WAS is that the WAS is not limited to HTTP and can be 
used with any of the available WCF transports, ports, and queues.
5. Bindings 
Description 
WCF groups together a set of communication aspects in bindings. A binding is 
merely a consistent, canned set of choices regarding the transport protocol, 
message encoding, communication pattern, reliability, security, transaction 
propagation, and interoperability. You can use the WCF-provided bindings as is, you 
can tweak their properties, or you can write your own custom bindings from scratch. 
A single service can support multiple bindings on separate addresses. 
a) Standard Bindings 
WCF defines nine standard bindings: 
• Basic Binding 
• TCP Binding 
• P2P Binding 
• IPC Binding 
• WS Binding 
• Federated WS Binding 
• Duplex WS Binding 
• MSMQ Binding 
• MSMQ Integration Binding
A binding describes the protocols supported by a particular endpoint, specifically, the 
following: 
• The transport protocol, which can be TCP, named pipes, HTTP, or MSMQ 
• The message encoding format, which determines whether messages are serialized 
as binary or XML, for example 
• Other messaging protocols related to security and reliability protocols, plus any 
other custom protocols that affect the contents of the serialized message
6. End Points 
 Every service is associated with an address that defines where the service is, a binding that 
defines how to communicate with the service, and a contract that defines what the service 
does. The endpoint is the fusion of the address, contract, and binding (ABC) 
 Address :- The address is obviously the location of the service, such as 
‘net.pipe://localhost/LocalTimeService’ 
 Binding:- The binding specifies security options, encoding options, and transport 
options. 
 Contract:- the contract is the actual interface that the service implements. 
 Every endpoint must have all three elements, and the host exposes the endpoint. Logically 
 Every service must expose at least one business endpoint and each endpoint has exactly 
one contract. All endpoints on a service have unique addresses, and a single service can 
expose multiple endpoints. These endpoints can use the same or different bindings and can 
expose the same or different contracts. There is absolutely no relationship between the 
various endpoints a service provides.
Example :- 
<endpoint name ="LocalTimeService“ 
address="net.pipe://localhost/LocalTimeService" binding="netNamedPipeBinding“ 
contract="ILocalTime" />
soapUI
What is soapUI? 
• SoapUI is a free and open source cross-platform Functional Testing solution. 
With an easy-to-use graphical interface, and enterprise-class features, SoapUI 
allows you to easily and rapidly create and execute automated functional, 
regression, compliance, and load tests. In a single test environment, SoapUI 
provides complete test coverage and supports all the standard protocols and 
technologies. There are simply no limits to what you can do with your tests.
Features: 
• Functional Testing 
• Security Testing 
• Load Testing 
• Technology Support 
• Automation 
• Analytics 
• Recording
Functional Testing 
• Drag and Drop Test Creation 
• Data-Driven Testing 
• Multi Environment Support
Security Testing 
• Test Generator 
• SQL Injection 
• XML Bomb
Load Testing 
• Real-Time, Interactive Distributed Testing 
• Drag and Drop Test Creation 
• Integrated Analytics
Technology Support 
• SOAP/WSDL 
• AMF 
• JDBC
Automation 
• JUnit 
• ANT 
• Bamboo
Presented by:

Weitere ähnliche Inhalte

Was ist angesagt?

WCF tutorial
WCF tutorialWCF tutorial
WCF tutorialAbhi Arya
 
Wcf architecture overview
Wcf architecture overviewWcf architecture overview
Wcf architecture overviewArbind Tiwari
 
REST, JSON and RSS with WCF 3.5
REST, JSON and RSS with WCF 3.5REST, JSON and RSS with WCF 3.5
REST, JSON and RSS with WCF 3.5Rob Windsor
 
Enjoying the Move from WCF to the Web API
Enjoying the Move from WCF to the Web APIEnjoying the Move from WCF to the Web API
Enjoying the Move from WCF to the Web APIKevin Hazzard
 
1. WCF Services - Exam 70-487
1. WCF Services - Exam 70-4871. WCF Services - Exam 70-487
1. WCF Services - Exam 70-487Bat Programmer
 
Interoperability and Windows Communication Foundation (WCF) Overview
Interoperability and Windows Communication Foundation (WCF) OverviewInteroperability and Windows Communication Foundation (WCF) Overview
Interoperability and Windows Communication Foundation (WCF) OverviewJorgen Thelin
 
Windows Communication Foundation (WCF) Service
Windows Communication Foundation (WCF) ServiceWindows Communication Foundation (WCF) Service
Windows Communication Foundation (WCF) ServiceSj Lim
 
Web services, WCF services and Multi Threading with Windows Forms
Web services, WCF services and Multi Threading with Windows FormsWeb services, WCF services and Multi Threading with Windows Forms
Web services, WCF services and Multi Threading with Windows FormsPeter Gfader
 
Web service Introduction
Web service IntroductionWeb service Introduction
Web service IntroductionMadhukar Kumar
 
Web Services - Architecture and SOAP (part 1)
Web Services - Architecture and SOAP (part 1)Web Services - Architecture and SOAP (part 1)
Web Services - Architecture and SOAP (part 1)Martin Necasky
 
WebService-Java
WebService-JavaWebService-Java
WebService-Javahalwal
 
Web API or WCF - An Architectural Comparison
Web API or WCF - An Architectural ComparisonWeb API or WCF - An Architectural Comparison
Web API or WCF - An Architectural ComparisonAdnan Masood
 

Was ist angesagt? (20)

WCF Fundamentals
WCF Fundamentals WCF Fundamentals
WCF Fundamentals
 
WCF tutorial
WCF tutorialWCF tutorial
WCF tutorial
 
Wcf architecture overview
Wcf architecture overviewWcf architecture overview
Wcf architecture overview
 
Wcf
WcfWcf
Wcf
 
Wcf development
Wcf developmentWcf development
Wcf development
 
WCF
WCFWCF
WCF
 
REST, JSON and RSS with WCF 3.5
REST, JSON and RSS with WCF 3.5REST, JSON and RSS with WCF 3.5
REST, JSON and RSS with WCF 3.5
 
Enjoying the Move from WCF to the Web API
Enjoying the Move from WCF to the Web APIEnjoying the Move from WCF to the Web API
Enjoying the Move from WCF to the Web API
 
1. WCF Services - Exam 70-487
1. WCF Services - Exam 70-4871. WCF Services - Exam 70-487
1. WCF Services - Exam 70-487
 
Windows Communication Foundation (WCF) Best Practices
Windows Communication Foundation (WCF) Best PracticesWindows Communication Foundation (WCF) Best Practices
Windows Communication Foundation (WCF) Best Practices
 
Interoperability and Windows Communication Foundation (WCF) Overview
Interoperability and Windows Communication Foundation (WCF) OverviewInteroperability and Windows Communication Foundation (WCF) Overview
Interoperability and Windows Communication Foundation (WCF) Overview
 
Windows Communication Foundation (WCF) Service
Windows Communication Foundation (WCF) ServiceWindows Communication Foundation (WCF) Service
Windows Communication Foundation (WCF) Service
 
WCF And ASMX Web Services
WCF And ASMX Web ServicesWCF And ASMX Web Services
WCF And ASMX Web Services
 
Web services, WCF services and Multi Threading with Windows Forms
Web services, WCF services and Multi Threading with Windows FormsWeb services, WCF services and Multi Threading with Windows Forms
Web services, WCF services and Multi Threading with Windows Forms
 
Web service Introduction
Web service IntroductionWeb service Introduction
Web service Introduction
 
Web service introduction 2
Web service introduction 2Web service introduction 2
Web service introduction 2
 
Web Services - Architecture and SOAP (part 1)
Web Services - Architecture and SOAP (part 1)Web Services - Architecture and SOAP (part 1)
Web Services - Architecture and SOAP (part 1)
 
Understanding Web services
Understanding Web servicesUnderstanding Web services
Understanding Web services
 
WebService-Java
WebService-JavaWebService-Java
WebService-Java
 
Web API or WCF - An Architectural Comparison
Web API or WCF - An Architectural ComparisonWeb API or WCF - An Architectural Comparison
Web API or WCF - An Architectural Comparison
 

Andere mochten auch

Bcs advertise 0531174551
Bcs advertise 0531174551Bcs advertise 0531174551
Bcs advertise 0531174551Zonaeid Zaman
 
CURSO PROPEDEUTICO
CURSO PROPEDEUTICOCURSO PROPEDEUTICO
CURSO PROPEDEUTICOsagittarri
 
Power within the team
Power within the teamPower within the team
Power within the teamdianasc04
 
RA Annual Report 2015_Final
RA Annual Report 2015_FinalRA Annual Report 2015_Final
RA Annual Report 2015_FinalElizabeth Foley
 
Από από την βολτά μας στο Αττικό Πάρκο
Από από την βολτά μας στο Αττικό ΠάρκοΑπό από την βολτά μας στο Αττικό Πάρκο
Από από την βολτά μας στο Αττικό Πάρκο18986486
 
Middlebury Women Leaders Pitch
Middlebury Women Leaders PitchMiddlebury Women Leaders Pitch
Middlebury Women Leaders PitchJialong Wu
 
The effect of phthalate on health
The effect of phthalate on healthThe effect of phthalate on health
The effect of phthalate on healthDec-Lam
 
Ringkasan perkuliahan dasar dasar mipa
Ringkasan perkuliahan dasar dasar mipaRingkasan perkuliahan dasar dasar mipa
Ringkasan perkuliahan dasar dasar mipaPuji Lestari
 
Mazes stem day
Mazes stem dayMazes stem day
Mazes stem daydianasc04
 
Portfolio document for LinkedIn
Portfolio document for LinkedInPortfolio document for LinkedIn
Portfolio document for LinkedInPaul Gallaher
 

Andere mochten auch (20)

Children of Man
Children of Man Children of Man
Children of Man
 
Bcs advertise 0531174551
Bcs advertise 0531174551Bcs advertise 0531174551
Bcs advertise 0531174551
 
Cv Venkat
Cv VenkatCv Venkat
Cv Venkat
 
You and me (nopriyani anglusia)
You and me (nopriyani anglusia)You and me (nopriyani anglusia)
You and me (nopriyani anglusia)
 
CURSO PROPEDEUTICO
CURSO PROPEDEUTICOCURSO PROPEDEUTICO
CURSO PROPEDEUTICO
 
Power within the team
Power within the teamPower within the team
Power within the team
 
RA Annual Report 2015_Final
RA Annual Report 2015_FinalRA Annual Report 2015_Final
RA Annual Report 2015_Final
 
Tratados
TratadosTratados
Tratados
 
Sd patra mandiri 2 palembang
Sd patra mandiri 2 palembangSd patra mandiri 2 palembang
Sd patra mandiri 2 palembang
 
Από από την βολτά μας στο Αττικό Πάρκο
Από από την βολτά μας στο Αττικό ΠάρκοΑπό από την βολτά μας στο Αττικό Πάρκο
Από από την βολτά μας στο Αττικό Πάρκο
 
physical layer
physical layerphysical layer
physical layer
 
Canasta Básica
Canasta BásicaCanasta Básica
Canasta Básica
 
First-person Shooters
First-person ShootersFirst-person Shooters
First-person Shooters
 
Kill bill
Kill billKill bill
Kill bill
 
Middlebury Women Leaders Pitch
Middlebury Women Leaders PitchMiddlebury Women Leaders Pitch
Middlebury Women Leaders Pitch
 
The effect of phthalate on health
The effect of phthalate on healthThe effect of phthalate on health
The effect of phthalate on health
 
Ringkasan perkuliahan dasar dasar mipa
Ringkasan perkuliahan dasar dasar mipaRingkasan perkuliahan dasar dasar mipa
Ringkasan perkuliahan dasar dasar mipa
 
инвалиды
инвалидыинвалиды
инвалиды
 
Mazes stem day
Mazes stem dayMazes stem day
Mazes stem day
 
Portfolio document for LinkedIn
Portfolio document for LinkedInPortfolio document for LinkedIn
Portfolio document for LinkedIn
 

Ähnlich wie Advancio, Inc. Academy: Web Sevices, WCF & SOAPUI

Dot Net Training Wcf Dot Net35
Dot Net Training Wcf Dot Net35Dot Net Training Wcf Dot Net35
Dot Net Training Wcf Dot Net35Subodh Pushpak
 
Web programming
Web programmingWeb programming
Web programmingsowfi
 
Understanding Web Services by software outsourcing company india
Understanding Web Services by software outsourcing company indiaUnderstanding Web Services by software outsourcing company india
Understanding Web Services by software outsourcing company indiaJignesh Aakoliya
 
WCF (Windows Communication Foundation_Unit_01)
WCF (Windows Communication Foundation_Unit_01)WCF (Windows Communication Foundation_Unit_01)
WCF (Windows Communication Foundation_Unit_01)Prashanth Shivakumar
 
Web services
Web servicesWeb services
Web servicesaspnet123
 
Web service, wcf, web api
Web service, wcf, web apiWeb service, wcf, web api
Web service, wcf, web apiAbdeliDhankot
 
Web Service Implementation Using ASP.NET
Web Service Implementation Using ASP.NETWeb Service Implementation Using ASP.NET
Web Service Implementation Using ASP.NETPonraj
 
Session 1 Shanon Richards-Exposing Data Using WCF
Session 1 Shanon Richards-Exposing Data Using WCFSession 1 Shanon Richards-Exposing Data Using WCF
Session 1 Shanon Richards-Exposing Data Using WCFCode Mastery
 
Web services
Web services Web services
Web services BTailor
 
Advantage of WCF Over Web Services
Advantage of WCF Over Web ServicesAdvantage of WCF Over Web Services
Advantage of WCF Over Web ServicesSiva Tharun Kola
 
Complete Architecture and Development Guide To Windows Communication Foundati...
Complete Architecture and Development Guide To Windows Communication Foundati...Complete Architecture and Development Guide To Windows Communication Foundati...
Complete Architecture and Development Guide To Windows Communication Foundati...Abdul Khan
 
Web Services in Cloud Computing.pptx
Web Services in Cloud Computing.pptxWeb Services in Cloud Computing.pptx
Web Services in Cloud Computing.pptxssuser403d87
 
Basics of WCF and its Security
Basics of WCF and its SecurityBasics of WCF and its Security
Basics of WCF and its SecurityMindfire Solutions
 

Ähnlich wie Advancio, Inc. Academy: Web Sevices, WCF & SOAPUI (20)

Dot Net Training Wcf Dot Net35
Dot Net Training Wcf Dot Net35Dot Net Training Wcf Dot Net35
Dot Net Training Wcf Dot Net35
 
Web programming
Web programmingWeb programming
Web programming
 
SOA & WCF
SOA & WCFSOA & WCF
SOA & WCF
 
web programming
web programmingweb programming
web programming
 
Understanding Web Services by software outsourcing company india
Understanding Web Services by software outsourcing company indiaUnderstanding Web Services by software outsourcing company india
Understanding Web Services by software outsourcing company india
 
WCF (Windows Communication Foundation_Unit_01)
WCF (Windows Communication Foundation_Unit_01)WCF (Windows Communication Foundation_Unit_01)
WCF (Windows Communication Foundation_Unit_01)
 
Web services
Web servicesWeb services
Web services
 
Web service, wcf, web api
Web service, wcf, web apiWeb service, wcf, web api
Web service, wcf, web api
 
Java web services
Java web servicesJava web services
Java web services
 
Web services
Web servicesWeb services
Web services
 
Web Service Implementation Using ASP.NET
Web Service Implementation Using ASP.NETWeb Service Implementation Using ASP.NET
Web Service Implementation Using ASP.NET
 
Web services
Web servicesWeb services
Web services
 
Session 1 Shanon Richards-Exposing Data Using WCF
Session 1 Shanon Richards-Exposing Data Using WCFSession 1 Shanon Richards-Exposing Data Using WCF
Session 1 Shanon Richards-Exposing Data Using WCF
 
Web services
Web servicesWeb services
Web services
 
Web services
Web services Web services
Web services
 
Advantage of WCF Over Web Services
Advantage of WCF Over Web ServicesAdvantage of WCF Over Web Services
Advantage of WCF Over Web Services
 
Complete Architecture and Development Guide To Windows Communication Foundati...
Complete Architecture and Development Guide To Windows Communication Foundati...Complete Architecture and Development Guide To Windows Communication Foundati...
Complete Architecture and Development Guide To Windows Communication Foundati...
 
Web Service Security
Web Service SecurityWeb Service Security
Web Service Security
 
Web Services in Cloud Computing.pptx
Web Services in Cloud Computing.pptxWeb Services in Cloud Computing.pptx
Web Services in Cloud Computing.pptx
 
Basics of WCF and its Security
Basics of WCF and its SecurityBasics of WCF and its Security
Basics of WCF and its Security
 

Advancio, Inc. Academy: Web Sevices, WCF & SOAPUI

  • 1. Web Services WCF and SOAPUI
  • 2. OverView What is a Web Service ? Web Service Technology Stack WhyWeb Services? How to create , consume and publish a web service? What is the difference betweenWeb Services and WCF ? WCF in detail SOAPUI
  • 3. What is a Web Service ? Web service is a means by which computers talk to each other over the web using HTTP and other universally supported protocols. A Web service is an application that:  Runs on a Web server ;  Exposes Web methods to interested callers ;  Listens for HTTP requests representing commands to invoke Web methods ;  Executes Web methods and returns the result.
  • 4. Web Service Technology Stack Web Services are based on:  HTTP (Hypertext Transport Protocol)  SOAP (Simple Object Access Protocol)  UDDI (Universal Description, Discovery and Integration)  WS-POLICY (Web Services Policy) Most Web services expect their Web methods to be invoked using HTTP requests containing SOAP messages. SOAP is an XML-based vocabulary for performing remote procedure calls using HTTP and other protocols.
  • 5. Why using web services ? The benefits of using Web Services:  Exposing the existing function on to network: Web Services allows you to expose the functionality of your existing code over the network.  Connecting Different Applications ie Interoperability: Web Services allows different applications to talk to each other and share data and services among themselves. Other applications can also use the services of the web services.  Standardized Protocol: Web Services uses standardized industry standard protocol for the communication.  Low Cost of communication: Web Services uses SOAP over HTTP protocol for the communication.
  • 6. How to create a web service? When creating a New Project, under the language of your choice, select "Web" and then change to .NET Framework 3.5 and you will get the option to create an ASP.NET WEB Service Application.
  • 7. How to create a web service?
  • 8. How to create a web service?
  • 9. How to create a web service?
  • 10. How to consume a web service?
  • 11. How to publish a web service?
  • 12. What is the difference between web services and WCF? WCF Service supports both http and tcp protocol while web services support only http protocol WCF service can be hosted in many ways like on windows service and self hosting apart from IIS hosting while web service can be hosted in IIS WCF has more options for security than web services
  • 13. What is the difference between web services and WCF? A WCF service can have one or more WCF endpoints thus one address for each end point . An endpoint is defined by an address, a binding and a service contract. but a Web service can have only one address at one point of time WCF Service is more flexible than web service because it can very easily change add interfaces end points thus interacting with a wide range of applications
  • 15. • Introduction of WCF • Discussion about SOA & WCF • When you should use it. • What software you need to create a WCF service • Advantages & Disadvantages of WCF • Architecture of .Net 3.0 & WCF • Programming with WCF • Services (Service Execution Boundaries, WCF & Location Transparencies) • Contracts (Service, Data, Fault and Message) • Addresses (TCP, HTTP, IPC, MSMQ and P2P) • Hosting (IIS, VS2005, Web.Config, Self, Self * Base Addresses, Advanced, ServiceHost<T> and WAS) • Bindings • End Points • Example of WCF & Implementations
  • 16. Introduction of WCF • WCF is a set of .NET technologies (Web services ,.Net Remoting and enterprises services) for building and running connected systems. • WCF provides secure, reliable, and transacted messaging along with interoperability • WCF applications can be developed in any language which can target the .NET runtime • System.ServiceModel is the assembly that contains core functionality for WCF. • A service is a Common Language Runtime (CLR) type that encapsulates business functionality and exposes a set of methods that can be accessed by remote clients.
  • 17. When you should use it • When your business logic has to interact with a variety of client applications. • When client apps, which are going to use your service, may be written in Java or .Net. • You are targeting a distributed computing architecture.
  • 18. What software you need to create a WCF service • Visual studio 2005 • .Net Framework 3.0 • Microsoft Windows Software Development Kit (SDK) • Visual studio extensions for WCF and WPF
  • 19. Advantages of WCF Known Advantages: • Makes UI programming & distributed programming very easy. Reduce complexity by allowing us to focus on single programming model rather than learn multiple programming models. • Helps us talk to various applications written in various languages with ease which means more probable revenues as various applications can start using your core services with ease. • Helps us forget about interoperability between various underlying web service technologies in the past, present and future. • With WCF, a single service can be defined and exposed over multiple endpoints to support multiple protocols at the same time.
  • 20. Discussion about SOA & WCF 1. What is SOA SOA is the practice of sequestering the core business functions into independent services that don’t change frequently. These services are glorified functions that are called by one or more presentation programs. The presentation programs are volatile bits of software that present data to, and accept data from, various users. SOA is nothing more than separating changeable elements from unchangeable elements.
  • 21. 1. Services in WCF Description The WCF applications expose the functionality through services. A Service is a Common Language Runtime(CLR) type that encapsulate business functionality and exposes a set of methods that can be accessed by remote clients. A service contract is defined by applying the ServiceContractAttribute to a class or interface. When applied to a class, the class becomes a service type. When applied to an interface, any class that implements the interface becomes a service type. In either case, methods exposed by the class or interface must be decorated with the OperationContractAttribute to be considered part of the service contract. Methods with this attribute are considered service operations. A service type must be hosted before clients can invoke service operations. a) Services' Execution Boundaries WCF allows the client to communicate with the service across all execution boundaries. On the same machine , the client can consume services in the same app domain, across app domains in the same process, or across processes.
  • 22. b) WCF & Location Transparency WCF takes the remote programming model of instantiating and using a proxy and uses it even in the most local case. Because all interactions are done via a proxy, requiring the same configuration and hosting ,WCF maintains the same programming model for the local and remote cases; thus it not only enables you to switch locations without affecting the client, but also significantly simplifies the application programming model.
  • 23. 2. Addresses Description: In WCF, every service is associated with a unique address. The address provides two important elements: the location of the service and the transport protocol or transport schema used to communicate with the service. The location portion of the address indicates the name of the target machine, site, or network; a communication port, pipe, or queue; and an optional specific path or URI. a) TCP Addresses Ex. net.tcp://localhost:8002/MyService. b) HTTP Addresses Ex. http://localhost:8001 c) IPC Addresses Ex. net.pipe://localhost/MyPipe d) MSMQ Addresses Ex. net.msmq://localhost/MyService e) Peer Network Addresses Peer network addresses use net.p2p for transport, to indicate the use of the Windows peer network transport. You must specify the peer network name as well as a unique path and port.
  • 24. 3. Contracts Description: In WCF, all services expose contracts. The contract is a platform-neutral and standard way of describing what the service does. WCF defines four types of contracts. a) Service Contracts Describe which operations the client can perform on the service. b) Data Contracts Define which data types are passed to and from the service. WCF defines implicit contracts for built-in types such as int and string, but you can easily define explicit opt-in data contracts for custom types c) Fault Contracts Define which errors are raised by the service, and how the service handles and propagates errors to its clients d) Message Contracts Allow the service to interact directly with messages. Message contracts can be typed or untyped, and are useful in interoperability cases and when there is an existing message format you have to comply with.
  • 25. 4. Hosting Description: Every WCF service must be hosted in a Windows process called the host process. A single host process can host multiple services, and the same service type can be hosted in multiple host processes. The host can be provided by IIS, by the Widows Activation Service (WAS) on Windows Vista, or by the developer as part of the application. So each .NET host process can have many app domains. Each app domain can have zero or more service host instances. However, each service host instance is dedicated to a particular service type. When you create a host instance, you are in effect registering that service host instance with all the endpoints for that type on the host machine that correspond to its base addresses. Each service host instance has zero or more contexts.
  • 26. a) IIS Hosting Hosting in IIS is very similar to hosting a classic ASMX web service. You need to create a virtual directory under IIS and supply a .svc file. The .svc file functions similar to an .asmx file, and is used to identify the service code behind the file and class. b) Using VS 2005 You can use Visual Studio 2005 to generate a boilerplate IIS-hosted service. From the File menu, select New Website and then select WCF Service from the New Web Site dialog box. This causes Visual Studio 2005 to create a new web site, service code, and matching .svc file. You can also use the Add New Item dialog to add another service later on. c) Web.Config file The web site config file (Web.Config) must list the types you want to expose as services. You need to use fully qualified type names, including the assembly name. <system.serviceModel> <services> <service name = "MyNamespace.MyService"> ... </service> </services> </system.serviceModel> d) Self Hosting Self-hosting is the name for the technique used when the developer is responsible for providing and managing the life cycle of the host process. Self-hosting is used both in the case of wanting a process (or machine) boundary between the client and the service, and when using the service in-proc— that is, in the same process as the client.
  • 27. e) Self Hosting & Base Addresses You can launch a service host without providing any base address by omitting the base addresses altogether. f) Advanced Hosting Features The ICommunicationObject interface supported by ServiceHost offers some advanced features. g) ServiceHost<T> Class You can improve on the WCF-provided ServiceHost class by defining the ServiceHost<T> class. h) WAS Hosting The Windows Activation Service (WAS) is a system service available with Windows Vista. WAS is part of IIS7, but can be installed and configured separately. To use the WAS for hosting your WCF service, you need to supply a .svc file, just as with IIS. The main difference between IIS and WAS is that the WAS is not limited to HTTP and can be used with any of the available WCF transports, ports, and queues.
  • 28. 5. Bindings Description WCF groups together a set of communication aspects in bindings. A binding is merely a consistent, canned set of choices regarding the transport protocol, message encoding, communication pattern, reliability, security, transaction propagation, and interoperability. You can use the WCF-provided bindings as is, you can tweak their properties, or you can write your own custom bindings from scratch. A single service can support multiple bindings on separate addresses. a) Standard Bindings WCF defines nine standard bindings: • Basic Binding • TCP Binding • P2P Binding • IPC Binding • WS Binding • Federated WS Binding • Duplex WS Binding • MSMQ Binding • MSMQ Integration Binding
  • 29. A binding describes the protocols supported by a particular endpoint, specifically, the following: • The transport protocol, which can be TCP, named pipes, HTTP, or MSMQ • The message encoding format, which determines whether messages are serialized as binary or XML, for example • Other messaging protocols related to security and reliability protocols, plus any other custom protocols that affect the contents of the serialized message
  • 30. 6. End Points  Every service is associated with an address that defines where the service is, a binding that defines how to communicate with the service, and a contract that defines what the service does. The endpoint is the fusion of the address, contract, and binding (ABC)  Address :- The address is obviously the location of the service, such as ‘net.pipe://localhost/LocalTimeService’  Binding:- The binding specifies security options, encoding options, and transport options.  Contract:- the contract is the actual interface that the service implements.  Every endpoint must have all three elements, and the host exposes the endpoint. Logically  Every service must expose at least one business endpoint and each endpoint has exactly one contract. All endpoints on a service have unique addresses, and a single service can expose multiple endpoints. These endpoints can use the same or different bindings and can expose the same or different contracts. There is absolutely no relationship between the various endpoints a service provides.
  • 31. Example :- <endpoint name ="LocalTimeService“ address="net.pipe://localhost/LocalTimeService" binding="netNamedPipeBinding“ contract="ILocalTime" />
  • 33. What is soapUI? • SoapUI is a free and open source cross-platform Functional Testing solution. With an easy-to-use graphical interface, and enterprise-class features, SoapUI allows you to easily and rapidly create and execute automated functional, regression, compliance, and load tests. In a single test environment, SoapUI provides complete test coverage and supports all the standard protocols and technologies. There are simply no limits to what you can do with your tests.
  • 34. Features: • Functional Testing • Security Testing • Load Testing • Technology Support • Automation • Analytics • Recording
  • 35. Functional Testing • Drag and Drop Test Creation • Data-Driven Testing • Multi Environment Support
  • 36. Security Testing • Test Generator • SQL Injection • XML Bomb
  • 37. Load Testing • Real-Time, Interactive Distributed Testing • Drag and Drop Test Creation • Integrated Analytics
  • 38. Technology Support • SOAP/WSDL • AMF • JDBC
  • 39. Automation • JUnit • ANT • Bamboo