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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:33:53+00:00 2026-06-13T01:33:53+00:00

I have an asyncronous WCF service, that uses a client proxy to call an

  • 0

I have an asyncronous WCF service, that uses a client proxy to call an 2nd SOAP WCF service. I have no control of the SOAP Java service, but i can set the configuration on the service reference to run Asyncronously.

How would i get a result from the 2nd Async Service, to pass values back to the 1st down to the Client??

public class AddService : IAddService
{
    // SOAP Java service reference

    ResultServiceClient proxy = new ResultServiceClient();

    public int AddNumbers(int x, int y)
    {

        // Am i on the right track here to use BeginXXX, EndXXX?
        proxy.BeginGetResult(x, y, new AsyncCallback(OnEndAdd), null);

        /// how to return a result here.??????
        return result;
    }

    void OnEndAdd(IAsyncResult result)
    {
        int result = proxy.EndGetResult(result);
    }
}
  • 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-13T01:33:54+00:00Added an answer on June 13, 2026 at 1:33 am
       [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)] 
        public class AddService : IAddService 
        { 
            // SOAP Java service reference 
            ManualReseEvent _resetEvent=new ManualResetEvent(false); 
            ResultServiceClient proxy = new ResultServiceClient(); 
            private int _result=-1;
    
            public int AddNumbers(int x, int y) 
            { 
    
                // Am i on the right track here to use BeginXXX, EndXXX? 
                proxy.BeginGetResult(x, y, new AsyncCallback(OnEndAdd), null); 
                _resetEvent.WaitOne(TimeSpan.FromSeconds(10);
                return _result; 
            } 
    
            void OnEndAdd(IAsyncResult result) 
            { 
                _result = proxy.EndGetResult(result); 
                _resetEvent.Set();
            } 
        } 
    

    What’s going on here?

    We make the call and then we use the ManualResetEvent to pause the thread and wait for the callback to be made. The ManualResetEvent is told to wait 10 seconds and then continue executing.

    ManualResetEvent has multiple overloads for the Wait method, from infinite – Wait() – to the one I’m using, which takes a TimeSpan. _result is now a member variable so we can access the value from the initial calling method. I’ve also marked the service with a “PerCall” service behaviour. This means that a new instance of this object is instantiated per call to it. I do this because we’ve got an up-to 10 second delay while we call the Java service and we don’t want to block other calls to this service by other users.

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

Sidebar

Related Questions

I have a light Client application, that makes Asyncronous WCF calls to a IIS
In my WPF client, I have a loop that calls a WCF service to
I have a control that uploads 1..n files in chunks to a WCF service
I have a WCF service that I call from a windows service. The WCF
I have a WCF service that provides a couple of methods. A Windows Forms
I am writing the client side for a WCF service that supports both synchronous
I have inherited some code that queries a DB over a WCF service and
I have a WCF service and I am creating the client using the Add
I have wcf .net client to a webservice. I am trying to ensure that
I have a Silverlight 2 application that is consuming a WCF service. As such,

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.