Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9162091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:07:55+00:00 2026-06-17T14:07:55+00:00

I have a problem with a self-hosted wcf duplex callback service. I get an

  • 0

I have a problem with a self-hosted wcf duplex callback service. I get an InvalidOperationException with message:

This operation would deadlock because the reply cannot be received
until the current message completes processing. If you want to allow
out-of-order message processing, specify ConcurrencyMode of Reentrant
or Multiple on CallbackBehaviorAttribute.

Here is my service behavior:

[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode =  ConcurrencyMode.Reentrant, UseSynchronizationContext = true)]

Here is my service contract:

 [ServiceContract(SessionMode = SessionMode.Required, CallbackContract = typeof(IClientCallback))]

[ServiceContract]
public interface IClientToService
{
    [OperationContract(IsOneWay = false)]
    LVSSStatus GetLvssStatus();

    [OperationContract(IsOneWay = true)]
    void PickSpecimen(long trackingNumber, int destCode);

    [OperationContract(IsOneWay = true)]
    void CancelCurrentPickTransaction();
}

Here is my callback interface:

public interface ILvssClientCallback
{
    [OperationContract(IsOneWay = true)]
    void SendClientCallback(LvssCallbackMessage callbackMessage);

    [OperationContract(IsOneWay = false)]
    List<SpecimenTemplateDescriptor> GetTemplateDescriptorList(DrawerLayout drawerLayout);

    [OperationContract(IsOneWay = false)]
    SpecimenTemplate SelectSpecimenTemplate(string templateName, int version);

    [OperationContract]
    void SpecimenStoredInContainer(string containerID, bool isValidRackID, int rackRow, int rackCol, int deckRow, int deckCol,
     int drawerRow, int drawerCol, long trackingNumber, RobotErrors robotError);

    [OperationContract]
    void LvssRobotStatusChange(LVSSStatus status);
}

I understand that the InvalidOperationException is caused when a callback operation is invoked on the client, the service is already locked for the processing of a current operation. So, a deadlock occurs.

I have tried changing my ConcurrencyMode to multiple, and UseSynchronizationContext to false.

I still see two problems with my service:

First: The following service operation freezes my client wpf application when GetLvssStatus() is called rapidly (by clicking the UI button rapidly). This method is not one way, and returns an enumerated type from the service back to the client synchronously.

    [OperationContract(IsOneWay = false)]
    LVSSStatus GetLvssStatus();

* What causes my wpf application to freeze in this case?
*
What can I do to prevent the application from freezing?
If I use backgroundworker thread as an asynchronous call, the application does not freeze. I really need this method to work synchronously.

Second: When I assign the callback method LvssRobotStatusChange to IsOneWay = true, I get an ObjectDisposedException: Cannot access a disposed object. Object name: 'System.ServiceModel.Channels.ServiceChannel'.

    [OperationContract(IsOneWay = true)]
    void LvssRobotStatusChange(LVSSStatus status);

* What causes this ObjectDisposedException?
*
Is it okay to omit the IsOneWay assignment in this case? Omitting IsOneWay in this case allows the callback to complete without any exceptions.

* Could these issues be a result of a lack of thread safe code?
*
If so, what is the best practice to make a ConcurrencyMode.Multiple service behavior thread safe?

Any help with these questions is much appreciated.

* FIRST EDIT
A little more information regarding creation of my duplex channel. My wpf view model creates a proxy object that is responsible for handling creation of my channel. Any attempts so far to set my channel on a new thread on the client side result in an ObjectDisposedException when the service attempts to use the callback object.

* SECOND EDIT
I believe my service should work if I can get the operation contracts with void method to set IsOneWay = true. With concurrency of reentrant, the main channel thread should let these methods pass through regardless of any locking.
Here is my callback interface:

public interface ILvssClientCallback
{
    [OperationContract(IsOneWay = true)]
    void SendClientCallback(LvssCallbackMessage callbackMessage);

    [OperationContract]
    List<SpecimenTemplateDescriptor> GetTemplateDescriptorList(DrawerLayout drawerLayout);

    [OperationContract]
    SpecimenTemplate SelectSpecimenTemplate(string templateName, int version);

    [OperationContract(IsOneWay = true)]
    void SpecimenStoredInContainer(string containerID, bool isValidRackID, int rackRow, int rackCol, int deckRow, int deckCol,
     int drawerRow, int drawerCol, long trackingNumber, RobotErrors robotError);

    [OperationContract(IsOneWay = true)]
    void LvssRobotStatusChange(LVSSStatus status);
}

When I set method LvssRobotStatuschange operation contract to IsOneWay = true, my cached callback channel throws a CommunicationObjectAbortedException. For some reason my callback property is being aborted.

***What can cause a callback channel to become aborted?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T14:07:56+00:00Added an answer on June 17, 2026 at 2:07 pm

    I’ve run in to this before, this link should help, which discusses creating channels on a thread other than the applications main thread.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a self-hosted WCF service and I'm having the following problem: 15 minutes
I have a self-hosted WCF service (v4 framework) that is exposed through a HttpTransport
I have an wcf winforms self-hosted app using nettcpbinding.(net.tcp://aaa.homeip.net:9388) The problem is windows 7
We have a self hosted WCF service which receives and processes requests from proprietary
I have a Clustered MSMQ I also have a WCF service app (Self hosted
here's the setup for the project. I have a WCF Service that is hosted
When I do simple HelloWorld app I have problem with [self.tableView insertRowsAtIndexPaths:@[indexPath]withRowAnimation:UITableViewRowAnimationAutomatic] ,this method
I have a WCF rest service using webHttpBinding that returns JSON result. The problem
I am trying to hit a self hosted WCF service I created that uses
I have a WCF Service hosted on IIS. For business reason I cannot post

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.