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 8246761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T22:36:46+00:00 2026-06-07T22:36:46+00:00

I am programming a WCF service on Azure. In my Service, I need to

  • 0

I am programming a WCF service on Azure.

In my Service, I need to invoke callback during the execution of a contract operation. When I attempt to do that, an exception will throw and the client will locked. I think it is caused by that the channel is opened for contract operation, invoking callback in current channel will lock the thread, am I right? I want to get solution for this scenario.

here is the timeout exception message:

This request operation sent to
net.tcp://127.255.0.0:8000/MytestWCFService did not receive a reply
within the configured timeout (00:00:59.9889989). The time allotted
to this operation may have been a portion of a longer timeout. This
may be because the service is still processing the operation or
because the service was unable to send a reply message. Please
consider increasing the operation timeout (by casting the
channel/proxy to IContextChannel and setting the OperationTimeout
property) and ensure that the service is able to connect to the
client.

Edit: code sample

[ServiceContract(Namespace="testnamespace")]   
public interface ICallback   
{   
    [OperationContract(IsOneWay=true)]   
    void Callbackmethod();   
}  

Then I implement IContract in service side:

[ServiceBehavior(InstanceContextMode=InstanceContextMode.Single,   
    ConcurrencyMode=ConcurrencyMode.Reentrant,   
    AddressFilterMode=AddressFilterMode.Any)]   
public class WCFService : IContract   
{      
   public int Add(int a, int b)   
   {   
       int result = a + b;  
       ICallback callback = OperationContext.Current.GetCallbackChannel<ICallback>();   
       callback.Callbackmethod();   
       return result;   
   }   
}   

I am calling back in current channel, it is a duplex channel.

  • 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-07T22:36:48+00:00Added an answer on June 7, 2026 at 10:36 pm

    If your operation and callback are two-ways you most probably have a deadlock issue. Mark your service class with this attribute:

    [ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Reentrant)]
    public class MyService : IMyServiceContract { ... }
    

    Edit:

    Also in your WPF application add this to implementation of the callback implementation:

    [CallbackBehavior(UseSynchronizationContext = false)]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using the WCF web programming model one can specify an operation contract like so:
Created a WCF service that is being called by a Silverlight app. Both reside
Can we do Socket Programming in ASP.NET/WCF? Like the service listens on a port
I'm just getting into WCF programming. I've set up a self-hosted test web service
I'm programming my first Silverlight app and it uses a Silverlight-enabled WCF service to
I'm programming a service for a program that uses HTTP post/get requests, so I
Programming language: Java Ok, so I want to have a BufferedImage that keeps rotating
Programming language books usually explain that value types are created on the stack, and
I got a lot of theoretical answers from Google that WCF is better than
My company is planning to implement a solution in multiple applications that will help

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.