Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Importance of WCF in Web Applications For Searching Products

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Importance of WCF in Web Applications for Searching Products

Dr. SamratVivekanand O Khanna


Institute of Sci. & Tech. for Adv Std & Res. sonukhanna@yahoo.com
Abstract This paper shows the weightage of WCF services into the real applications. In some complex scenario it is not possible to update the data in time, so that would cost more damage compare to other situations. To address this type of issues WCF is useful and the WCF services available into.net framework which perform an important job to overcome such type of situations. WCF services are different compare to standard web services. The interoperability, Security and transactions can be easily achieved by WCF services. It is helpful in establishing message communication between varied systems and to gain performance benefits of different systems. The most important use of WCF services are in heterogeneous environment. Keywords- Web, Web Application, Services, Searching, SOAP WCF, WCF

Mijal Mistry
Institute of Sci. & Tech. for Adv Std & Res. mijalmistry@rediffmail.com Services (ASMX) along with the Web Service Enhancements (WSE) extensions, the Microsoft Message Queue (MSMQ), the Enterprise Services/COM+ runtime environment, and .NET Remoting are the foundation for countless successful applications. So is there anything fundamentally broken or wrong about these technologies that would prompt Microsoft to replace them all? No, except that there are too many of them. [1] The goals of WCF are that you no longer have to make such technology choices upfront and that you can implement any combination of such requirements on a single technology platform and without friction. If you want to build a Web service with reliable communication that supports sessions and transaction flow and extend it to let you inspect the raw messages as they flow into the system, it will be very easy to do so in WCF. [1] Fig. 1 shows the WCF model which can be used in .net framework. It is divided into three major portions like Programming model, Service model and Channel model. Each model has their different work and job to perform Following is list of options available into each model. Programming Model: SOAP Services RIA Services Web HTTP Services Data Services

I.

INTRODUCTION

WCF is Microsoft's next-generation programming platform and runtime system for building, configuring and deploying network-distributed services. The WCF runtime and its System.ServiceModel namespace that represents its primary programming interface, is nothing less than the successor and unification of most distributed systems technologies that developers have successfully used to build distributed applications on the Windows platform over the past decade. [1] Let's start with the following important observation: The current distributed systems technologies, most prominently ASP.NET Web

2011, IJARCSSE All Rights Reserved

Page 1

WorkFlow Services

Service Model: Data Contract Service Contract Service Behaviour Channel Model: Formats (JSON, XML) Transports (HTTP, TCP) Protocols (SOAP, HTTP)

A chat service that allows two people to communicate or exchange data in real time. A dashboard application that polls one or more services for data and presents it in a logical presentation. Exposing a workflow implemented using Windows Workflow Foundation as a WCF service. A Silverlight application to poll a service for the latest data feeds. While creating such applications was possible prior to the existence of WCF, WCF makes the development of endpoints easier than ever. In summary, WCF is designed to offer a manageable approach to creating Web services and Web service clients. II. FEATURES OF WCF

There are several features of WCF services are there but here we are going to see the important one. Service Orientation One consequence of using WS standards is that WCF enables you to create service oriented applications. Service-oriented architecture (SOA) is the reliance on Web services to send and receive data. The services have the general advantage of being loosely-coupled instead of hard-coded from one application to another.

Interoperability
WCF implements modern industry standards for Web service interoperability.
Fig. 1 WCF Model

Multiple Message Patterns


Messages are exchanged in one of several patterns. The most common pattern is the request/reply pattern, where one endpoint requests data from a second endpoint. The second endpoint replies. There are other patterns such as a one-way message in which a single endpoint sends a message without any expectation of a reply.

A service endpoint can be part of a continuously available service hosted by IIS, or it can be a service hosted in an application. An endpoint can be a client of a service that requests data from a service endpoint. The messages can be as simple as a single character or word sent as XML, or as complex as a stream of binary data. A few sample scenarios include: [2] A secure service to process business transactions. A service that supplies current data to others, such as a traffic report or other monitoring service.

Service Metadata
WCF supports publishing service metadata using formats specified in industry standards such as WSDL, XML Schema and WS-Policy. This metadata

2011, IJARCSSE All Rights Reserved

Page 2

can be used to automatically generate and configure clients for accessing WCF services.

Security
Messages can be encrypted to protect privacy and you can require users to authenticate themselves before being allowed to receive messages. Security can be implemented using well-known standards such as SSL or WS-SecureConversation.

Transactions
WCF also supports transactions using one of three transaction models: WS-AtomicTtransactions, the APIs in the System.Transactions namespace, and Microsoft Distributed Transaction Coordinator. III. HOSTING OF WCF SERVICES The relationship between processes and application domains is similar to the relationship between applications and application domains and the WCF ServiceHost. As Figure 2 illustrates, every process has at least one application domain, and each application domain can host zero or more WCF ServiceHost instances. WCF requires at least an application domain hosted inside a Windows process. [3] Service can be hosted self or we can use the environment. Both ways comes with advantages and disadvantages. Following code snippet gives the information regarding the service hosting. <%@ServiceHost Language="C#" Service="SearchProducts.Searchin.SubstituteService. SearchProduct" %>

Fig. 2 Processes, application domains, and WCF Service Host relationship

IV. DEVELOPED SYSTEM We have developed a system which can show the benefits of WCF services in the web domains. For developing the system we have .net framework 4.0 and C#.net for coding. Here we have taken the finding and shopping products online. Sometimes it happens that we are navigating products and we want to select the products and store at some place and again we go back for searching. Once we finish with the searching we want our old selected searched information and the new searched selected items information. Once we have both the items we can process the search items and purchase the items. Sometime it also happens that we create our session for selected items and we can process the store information on next day. It that time it is sometimes difficult to store all the things. WCF services came to sort out this problem. Here we have developed one class with properties which stores the necessary information. [DataContract] public class ShowFlightsResults { [DataMember] public string ProductID; [DataMember] public string ProductName; [DataMember] public string ProductQuantity; [DataMember]

2011, IJARCSSE All Rights Reserved

Page 3

public string ProductPrice; [DataMember] public string UserID; [DataMember] public string ProductDescription; [DataMember] public string ProductStatus; [DataMember] public string ProductKeywords; } The above mentioned properties are used to store the records information. We can retrieve the information by writing following function. public List GetProductInformation (string keywrods) Microsoft BizTalk Server R2 Microsoft Silverlight Windows Workflow Foundation (WF) REFERENCE [1] http://msdn.microsoft.com/en-us/library/aa480190.aspx
[2] http://msdn.microsoft.com/en-us/library/ms731082.aspx [3] http://msdn.microsoft.com/en-us/library/bb332338.aspx [4] http://s.codeproject.com/KB/WCF/WCF-Service-CreateConfig.aspx [5]http://www.openajax.org/whitepapers/Introducing%20Aj ax%20and%20OpenAjax.php

{
// statements

}
This function will return the values into list format. The values can be searched by keywords for e.g. if we want to search for mobiles then we can write mobiles not the product item except we know about it. The system.serviceModel/services tag contains the classes, enumerations, and interfaces necessary to build service and client applications that can be used to build widely distributed applications. [4] By combining WCF and Ajax and using set of techniques we can deliver a highly interactive, desktop-like user experience for Web applications in popular HTML browsers. [5] V. IMPORTANCE

The promise is that WCF will make developers more productive, because they will only have to master a single programming model that unifies the feature wealth of ASMX, WSE, Enterprise Services, MSMQ, and Remoting. [1] WCF is a flexible platform. Because of this extreme flexibility, WCF is also used in several other Microsoft products. For E.g

2011, IJARCSSE All Rights Reserved

Page 4

You might also like