Some important question on WCF


What is the service?
Services are a group of methods that share a common set of requirements and functional goals. They are called by other parts that need to execute its logic, depending on the outcome (such as data, results of calculations, and so on).

Service is the combination of Channel, Protocol, Message, Policy, Schema and Contract

What is SOA ?
SOA is service oriented architecture. It is style of programming, an architectural approach in software development, where the application is organized in functional units of code with a given behavior called services.

SOA is a way to build distributed systems where autonomous logic is called using loosely coupled messages via a well defined interface.

Four Tenets of SOA
1. Boundaries are explicit

Boundaries are explicit means client only needs to be aware of the existence of function in the service that can only be executed via the contract.

2. Services are autonomous

Services are autonomous means
• Services should not dependent on the behavior of the other service.
• Services should be deployed and versioning independently.
• Service shouldn’t be coupled to each other as classes are coupled.

3.Services share schema and contract, not class

Schema is the definition of service operation and describes the signature of function. I.e. the name of function, type of parameters, and the type of return values. Service should not share the code of class to other parties.

4.Service compatibility is based on policy

A policy is used to negotiate elements in communication, such as message format and security requirement

Message Exchange pattern in WCF ?

These are the message pattern in WCF
1. Request-Response
The most commonly used pattern. The client request message from service by sending a request message and expect the response message from service. This means the service has to be reachable and
the client waits for the answer for a defined time.

2. One way

Messages are sent from client to server in one direction. The client sends a message but doesn’t expect an answer back.

3. Duplex Messaging

In the duplex pattern, client and server exchange messages without a predefined pattern. The client sends an initial request to the service waiting for a response but allows the service that sends the response to call back to the client to ask for more information. The service can call back to the client dynamically and possibly multiple times before sending the response to the initial request.

4. Streaming
In the streaming pattern the client initiates a request to get a very large set of data. The service chunks up the data in smaller pieces and sends them to the client one by one. The data is so big that the service has to read this data from a file system or database in chunks. The data chunks are sent to the client in an ordered way as the receiver wants to consume them in that same ordered way. This would be the case in streaming video.

5. Pub-Sub

In the pub – sub pattern the publisher is typically unaware who the subscribers are and what they are doing with the received data. The publisher doesn’t even care whether there are subscribers.
The publisher just cares about sending data out of its system.

Advertisements
Posted in WCF. 5 Comments »

5 Responses to “Some important question on WCF”

  1. chakri Says:

    Hi,Chandra

    How are u?,I have completed all cources related to .net except wcf,wpf but i have a plan to come bangloure next month what will you suggest me.

    Thanks
    Chakri.

  2. Chandra Dev Says:

    Hi
    I m fine. That is good. I wish you all the best.

  3. Shashi Bhushan Kumar Says:

    Hi,

    This is Shashi Bhushan Kumar. I want to use auto Complete control of Ajax for TextBox1 in asp.net 3.5. for this Web service is necessary. How to use web service and how to call in other Project. In Text Box if i press A . Then all related Name of A should come in popup . Please solve this query. Thanks

    • Chandra Dev Says:

      Hi

      We can solve this problem using so many ways like using Webservive,WCF,Jquery. But still now i have written article using Webserive and WCF
      Please go through this URL
      https://chandradev819.wordpress.com/2011/04/06/how-to-create-auto-complete-textbox-extender-using-%E2%80%9Cajax-enabled-wcf%E2%80%9D/

      Regards
      chandradev

  4. kinjal Says:

    Hello,

    I read u r blog ..it’s nice..i think that u r the person who help me to find out the solution about this..
    I have XML files in my one of the project and I have another project in which I have to add the path of that XML Files in web.config file. When we use the path of our local machine its working fine. But for the deployment of the project in the cloud I need to use a relative path.

    What I want to do is add the relative path of the XML files in web.config file of WCF service.and Fetch From there in Class library

    i used
    AppDomain.CurrentDomain;
    Which get the Service path bcoz i add the class library refrence into service

    HttpContext.GetAppConfig(“XmlFiles”);
    ConfigurationManager.AppSettings[“XmlFiles”];
    HostingEnvironment.MapPath(“~/EmployeeManagement.xml”);

    I used All Above..But in o/p i get the relative path of Service not Class..I refer almost post from internet related to relative path but don’t get proper solution.For Last 3 days i m searching about this..

    Will it work in the cloud? How to add the relative path of the file???

    Is there any other way to access those Xml files in cloud ??

    please help me.

    Thanks in advance for your help..


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: