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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T19:53:23+00:00 2026-06-05T19:53:23+00:00

I have a Silverlight project calling a WCF service. The service method GetData has

  • 0

I have a Silverlight project calling a WCF service. The service method GetData has one parameter, dataID, and is called through GetDataAsync and is handled by the autocreated classes with functions BeginGetData and EndGetData. In some cases the call will throw a TimeoutException in EndGetData (which is fine, the WCF service it self calls some third party services and sometimes they might be down or have problems, so I do not want to increase the timeout values).

What I would like to do is be able to take action using the dataID sent to GetDataAsync (for instance schedule a new call to GetData or showing an appropriate error message to the user indicating what data stream failed). How can this be done?
If I set a breakpoint in EndGetData, the result parameter of type IAsyncResult will be a System.ServiceModel.Channels.ServiceChannel.SendAsyncResult object, which has a RPC property that I can find the parameter in when debugging, but this class is not available from code because it is declared Friend.

Is this at all possible or does someone have ideas for how to implement the behaviour I want in another fashion?

  • 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-05T19:53:24+00:00Added an answer on June 5, 2026 at 7:53 pm

    Rather implement the Completed EventHandler that should have been auto generated by Visual Studio. You can also invoke using your own userState value.

    void GetData(int dataID)
    {
      client.GetDataCompleted += GetDataCompleted;
      client.GetDataAsync(dataID, dataID); //the 2nd param being the userState object
    }
    
    void GetDataCompleted(object sender, GetDataCompletedEventArgs e)
    {
      var dataId = (int)e.UserState;
    }
    

    If an error occurred, the EventArgs will also contain the exception:

    if (e.Error != null)
      throw e.Error;
    

    Avoid changing/using the auto generated methods.

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

Sidebar

Related Questions

I have a Silverlight project that uses a WCF service that I created. My
I have a Silverlight project (in VB), which uses a (WCF RIA) Domain Service,
I have a project in two parts: a Silverlight front end and a WCF
I have a Silverlight 4 user control that calls a WCF service residing within
I have a Silverlight project which takes some encrypted string thru its Service Reference:
I have a silverlight application which has a class library project in it. th
I have a Silverlight 3 project. When one of the pages is loaded, a
I have a silverlight 4 project that uses wcf ria services to connect to
I have a Silverlight project where functionality is segregated across multiple Silverlight libraries due
I have a Silverlight ModelViewViewModel project that I would like to expose a property

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.