.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

CommunicationException - WSDualHTTPBinding (duplex)

Posted By:      Posted Date: September 28, 2010    Points: 0   Category :WCF

Hey, I'm having a problem. I'm running a self-hosting console application as a WCF service, which sets up an endpoint configured to use the WSDualHTTPBinding. Whenever a client connects to the service I store the "CallBackChannel" on the server, which I use to call "callback" functions on the client.

However sometimes I suddenly recieve an exception called "CommunicationException" saying "The server did not provide a meaningful reply; this might be caused by a contract mismatch, a premature session shutdown or an internal server error.

How do I proceed on finding the source to this problem? I've made sure the contracts are all ok. But I don't know what to do from here.

Thanks in advance.

View Complete Post

More Related Resource Links

Error : Polling duplex in WCF DotNet4.0


We are making sample polling duplex in .net 4.0.

when ever we are  binding this tag in web.config it shows below error.




Warning    1    The element 'bindings' has invalid child element 'pollingDuplexHttpBinding'. List of possible elements expected: 'basicHttpBinding, customBinding, msmqIntegrationBinding, netPeerTcpBinding, netMsmqBinding, netNamedPipeBinding, netTcpBinding, wsFederationHttpBinding, ws2007FederationHttpBinding, wsHttpBinding, ws2007HttpBinding, wsDualHttpBinding, netTcpContextBinding, wsHttpContextBinding, basicHttpContextBinding, mexHttpBinding, mexHttpsBinding, mexNamedPipeBinding, mexTcpBinding, webHttpBinding'.    D:\DuplexTest\TestPollingDuplexWcf\TestPollingDuplexWcf\TestPollingDuplexWcf\Web.config    9    8    TestPollingDuplexWcf

Duplex contract between web client and server?

Hi, Can duplex contract be implemented between web client and server using http as a transport?   Thanks jagaurg

a very weird error wsDualHttpBinding...HELP !!!!!

hi all, Created a wcf application,and now enhancing its features ,makes me to use wsDualHttpBinding as callbacks are included.Before my application worked well on BasicHttpBinding,but nw on wsDualHttp its giving an old error when i run my client and try to connect or cal a wcf method.. that error is: "HTTP could not register URL http://+:80/Temporary_Listen_Addresses/4f044c47-0774-4358-bfca-7fe1fcbfadf2/ because TCP port 80 is being used by another application." i referred 100 of forums n articles but in vain.I also tried including ClientBaseAddress in app.config on client side.,but no use....i really dnt understand what the problem is n how do i solve it..plz do give me some clear solutions so dat i proceed with my wrk.. Waiting for response Mumtaz Mumtaz Surani

Duplex communication and calling clients from outside the hosted service

Hey,   I am currently building an interface between two applications: One that hosts a WCF service and receives external input (e.g. from a sensory system) and another which subscribes to updates sent by the first.   It is quite easy to call back to the client if I create a ServiceHost and provide it with an instance of my service (using ServiceHost.SingletonInstance). However, if I use a PerSession instance mode, how is it possible to call the clients when I receive an updated from the external sensory system?   Thank you for your time!   Cheers, Till

CommunicationException when serializing my business POCO object

Hi! I'm currently blocked by a strange problem, here is the situation: I've a client and a server, running with .Net 4.0 framework. I'm using Entity Framework server side, and WCF to communicate between client and Server. I use POCO object on my Entity Framework model. One month ago, I had a problem: In some case entity framework has already loaded an object and then want to return it when the WCF service is queried. Example: An User has a collection of Orders, and Orders knows which User handle it---> cyclic references I searched online how to resolve this and I found this: http://chabster.blogspot.com/2008/02/wcf-cyclic-references-support.html It worked like a charmed for me until now. I can get data from the server without server, ... Now I'm trying to call my Save(User) method from the client to the server, and I get this error:   System.ServiceModel.CommunicationException was caught Message=There was an error while trying to serialize parameter http://tempuri.org/:User. The InnerException message was 'Type 'System.DelegateSerializationHolder+DelegateEntry' with data contract name 'DelegateSerializationHolder.DelegateEntry:http://schemas.datacontract.org/2004/07/System' is not expected. Consider using a DataContractResolver or add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribu

Try-Catch block cannot handle exceptions when contacting a Silverlight Client using net.tcp Duplex W

I have created a simple duplex WCF for Silverlight 4 clients, using net.tcp binding (.NET Framework 4.0)  The client interface is declared as <ServiceContract()> _ Public Interface IServiceClient <OperationContract(IsOneWay:=True)> _ Sub SendUpdate(ByVal allRecords As List(Of String)) End Interface while the service interface is declared as <ServiceContract(Namespace:="SilverlightService", CallbackContract:=GetType(IServiceClient))> _ Public Interface IService <OperationContract(IsOneWay:=True)> _ Sub Connect() End Interface The service code is implemented like: <ServiceBehavior(ConcurrencyMode:=ConcurrencyMode.Multiple, InstanceContextMode:=InstanceContextMode.Single)> _ <Activation.AspNetCompatibilityRequirementsAttribute(RequirementsMode:=Activation.AspNetCompatibilityRequirementsMode.Allowed)> _ Public Class Service Implements IService 'Keep the list of all the active/connected clients: Public _clients As List(Of IServiceClient) = New List(Of ITrackServiceClient) Public Sub Connect() Implements IService.Connect Dim client = OperationContext.Current.GetCallbackChannel(Of IServiceClient)() Dim clientExist = From p In _clients _ Where p Is client _ Select p If clientExist.Count() = 0 Then Monitor.Enter(_clients) _clients.Add(client) Monitor.E

WSDualHttpBinding Callback in cocurrent mode

Hi, Would it be possible to make the callback in cocurrent mode when the server calls the clients through callback interface? We are using WSDualHttpBinding between Server and Client. At this moment, when the server sends a message throught the callback interface to the client while client is busying with processing some data, client will keep processing data until finish then responds to the call from the server. We would like as soon as the server calls using the callback, the client need to respond immediately. Is it possible?   The reason we need this is we want to add the ability to issue a Cancel command for the long progressing work on client from the server. The client is is checking a flag regularly to determine whether to continue work during the processing. The callback from the server to client will need to set the flag as soon as the message is send out. Thanks  

Setting printer duplex programatically

How do you programmatcally set a printer to duplex?   The information I've found online indicates that GetPrinter/SetPrinter should do the trick, but so far I've had mixed results.    I'm automating Microsoft Word to print documents.  Some of the documents required to be duplexed.  So far in my research I've found the following web pages that provide somewhat helpful information. http://support.microsoft.com/default.aspx/kb/315720 How to enable and disable a printer by using the SetPrinter function in Visual C# http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/q140/2/85.asp&NoWebContent=1 How To Modify Printer Settings by Using SetPrinter http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/q167/3/45.asp&NoWebContent=1 How To Modify Printer Settings with the DocumentProperties() Function http://support.microsoft.com/kb/828638  How to set duplex printing for Microsoft Word Automation clients (This article appears to be starting pointing for the CodeProject article) http://www.codeproject.com/dotnet/NET_Printer_Library.asp  Changing printer settings using C# I've included the code I'm using now.  I don't get any errors and everything appears to work, but the Duplex setting on the printer is not set reliably.  My check is to open the printer's properties and the "Pr

Duplex CallContract Issue.

Hi All, I am implimenting Duplex CallBack Contract for my Service. I am giving my Callback Interface Below.   public interface IAsyncCallbackInterface { [ OperationContract(IsOneWay = true)]   void GetTheCurrentChannel(DuplexChannelFactory<IAsyncInterface> factory); } So when i am trying to open the host i am getting following error Type 'System.ServiceModel.DuplexChannelFactory`1[IAsyncInterface]' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute.  See the Microsoft .NET Framework documentation for other supported types. Here the IAsyncInterface is my ServiceContract. Since it is an interface how can i mark it as DataContract? Can any one plse tell me what is the issue here? Thanks Lijo

WCF Duplex Communication



   I have a question on duplex communication. When we request a from a client to the service and if the service do not respond back to the client with in the timeout period. The communication between client and service will be broken. Then how can i make the client to continue the communication with the service. Please help me how can i handle this type of situations.

Thanks in Advance.

Is WCF Duplex Service scalable?

Hi all, I would please like to know if the WCF Duplex service can be used to push data e.g. realtime prices to thousands of silverlight clients. I have read this article (http://dotnetaddict.dotnetdevelopersjournal.com/sl_polling_duplex.htm) that says that it isn't scalable. I know there are several commercial platforms as described in this article (http://blog.programmableweb.com/2010/09/14/client-push-services-open-up-real-time-to-everyone/) that can provide real time push services but I'd like to know if there are any other options I could consider other than using a commercial platform? Thanks.

Full duplex pc to half duplex serial communication with SerialPort class in C++ (but any language wi


Hello.  I am a bit new to the .NET environment, and though I feel I was able to get a good handle on most of the basics of .NET, I believe I've encountered a problem beyond the basics.  I am trying to talk with a device called a ColorPAL that uses asynchronous serial communication, but it is half-duplex instead of full-duplex.  I am able to send it the hex string commands that it wants just fine with the TX line.  However, I find myself unable to read because the RX isn't connected to anything.  Basically what I want to do is that I want to be able to swap the TX line to become a RX line so that I can then read line of the half-duplex.  I read that there is a PinChanged event, so it lead me to believe there is a way to change pins??   If the RX line is very high impedance I could connect it to the TX line, but I have no idea about that.


How can I get a full duplex to read a half-duplex using the visual studio software?


Here is the code I'm using, in case that helps.

#include "stdafx.h"
#include <Windows.h>

using namespace System;
using namespace 

future of wcf duplex


hi experts,

 i want to know the future of wcf duplex.

wsDualHttpBinding service without security



I have a dual service with wsDualHttpBinding. It is possible to have the cliente outside a domain accessing the service inside a (windows) domain without submit any security?

I also try message security with client UserName credentials but errors occoured... probably wrong configuration...



Run Service wsDualHttpBinding with Callback and Clients without


It is possible to run a service wsDualHttpBinding with Callback and configure Clients without a call back(e.g wsHttpBinding) and without the callback contract.

The scenario is to have a callback host and both clients can connect with and without callback.



if (callback)


CallbackHandler myCallBack = new CallbackHandler();

DuplexChannelFactory<ICalculatorDuplex> channel

How to delect unexpected dead client in wcf duplex


Dear all.

At present, I have chat project using WCF duplex. But I have issue related to callback which is implemented in client side. When client hit disconnect button, it works well, but in case, client crashed for some resaons as disconnecting network, shutdown... After that, service dont know client disconnected and remove it form list of online clients.

Now I want to detect disconnected client as fast as possible for any reasons.

Any body help me .


Thank so much.


Duplex Contract using WebHttpBinding



I would like to implement a service that supports bidirectional duplex sessions using http. I would also like to avoid SOAP envelopes in the data transfer. I believe I should be using the WebHttpBinding; however, that does not natively support duplex contracts.

I would appreciate any guidance on how to construct a CustomBinding (the binding elements I need, and the order in which they should be stacked) that will give me what I am looking for.


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend