Congratulations to all monthly winners of May 2013 !!! They have won INR 2900 cash and INR 27497 worth prize.
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 5701 |  Welcome, Guest!   Register  Login
 Home > Interview Questions > WCF Interview Questions > Can you show a sample of Duplex Contract ...

Can you show a sample of Duplex Contract in WCF ?

Interview question and answer by: Akiii | Posted on: 5/18/2012 | Category: WCF Interview questions | Views: 936 | | Points: 40
Ads
Ads


Answer:


[ServiceContract(Namespace = "http://www.Microsoft.com",
SessionMode = SessionMode.Required,
CallbackContract = typeof(IDuplexCallBack) )]

public interface IService1
{
[OperationContract(IsOneWay = true)]
void getData();
}

public interface IDuplexCallBack
{
[OperationContract(IsOneWay = true)]
void filterData(DataSet Output);
}


In the above code, getData() is a method which will be called by the client on the Service. This getdata() is implemented in the server side.

filterData() is a method which will be called by the server on the Client. This method is implemented in the client side.

CallbackContract is the name of the contract which will be called by the server on the client to raise an event or to get some information from the client.



Thanks and Regards
Akiii

Found interesting? Add this to:


>> Write Response - Respond to this post and get points

Even more ... | Submit Interview Questions and win prizes!

More Interview Questions from Akiii

Even more ... | Submit Interview Questions and win prizes!


About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 6/18/2013 6:44:30 PM