Free Jobs
Reference




Dot Net Forums: ASPNET (77) C#.NET (39) VB.NET (8) AJAX (21) Silver Light (1) WCF (10) WPF (1) WWF (1) .NET 3.5 (3) SQL SERVER (38) Other (3)

Topic: What is address binding and contract in WCF Service

To get the Posted Questions details daily in your mail Click Here

Share this Post on Facebook/Twitter/Orkut Bookmark and Share





User: rajiv100 Post Date: 07 Nov 2010 03:02

Introduction:
A WCF Service exposes a collection of Endpoints and Each Endpoint is an
interface for communicating with the other WCF Service or Client.A Client
is a program that exchanges messages with one or more Endpoints. A Client
may also expose an Endpoi



Main Content:
WCF Service address components:
Address specifies the information about where can we find my
service.Every WCF enpoint must have an address so that

other end points can start the communication.
A few address formats may be as given below

HTTP Address Format:--> http://localhost:
TCP Address Format:--> net.tcp://localhost:
MSMQ Address Format:--> net.msmq://localhost:



WCF Service Binding components:
Binding describes the information that how can we interact with the
service In other words Binding describes how the endpoints communicate
with the external world Bindings may be as given below:

BasicHttpBinding
NetTcpBinding
WSHttpBinding
NetMsmqBinding



WCF Service Contract components:
Contract describes what the endpoint communicates.
It is actually a collection of messages also Called message exchange(MEX)
Types of Contract May be as given below:
Service Contract
b)Operation Contract
c)Data Contract
d)Message Contract





Example of an end point

<endpoint address="http://localhost:8080/MyService" binding="basicHttpBinding" contract="MyServiceLib.IAnswer"></endpoint>

Conclusion:
Thus we learned the three main important components of WCF service.



About Writer:
Hi,I am .NET Developer From Bangaloret


Writer's Link:

Writer's Email:







Comments:
  • User: manishav3388 Post Date:   13 May 2012 08:39

    To Call WCF service SampleService from c# Project :

    1.Add the proxy file SampleService.cs

    after creating proxy folder in root of c# project.

    Suppose namespave in proxy is its namespace is Company.Project.Module.ApplicationHost.Proxy

    Suppose you have to call the SampleService from SampleCodeBehine.cs file

    add the below line in the using block.

    using Sample_Proxy = Company.Project.Module.ApplicationHost.Proxy;


    Note that in proxy there will be one class where you

    will have all the service methods like as below

    public partial class SampleServiceClient

    Sample_Proxy.SampleServiceClient EPASclient = null;

    Sample_Proxy.SampleMethodResponse SampleMethod_resp = new Sample_Proxy.SampleMethodResponse();

    Sample_Proxy.SampleMethodRequest SampleMethod_Req = new Sample_Proxy.SampleMethodRequest();

    Sampleclient = new

    Sample_Proxy.SampleServiceClient(SecurityScenario.Custom,"BasicHttpBinding_IS

Post Comment





Similar Articles Top ArticlesLatest Articles Other Articles by this Author







www.freejobsreference.com Copyright © 2009-2011 | All Rights Reserved
All content of this website is protected by copyright laws and should not be reproduced in any form or by any means without written permission
(Best viewed in IE 8.0+ or Firefox 3.0+ at resolution of 1024 * 768 or higher)