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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:24:42+00:00 2026-05-30T21:24:42+00:00

OK, so I have no idea why this isn’t working. I’ve found 4 different

  • 0

OK, so I have no idea why this isn’t working. I’ve found 4 different tutorials/examples of calling a JSON web service asynchronously within Silverlight, and all of them use the same format / logic as I am. On the line “using (streamCommunities = request.EndGetRequestStream(asyncResult))” it is throwing the error I attached at the bottom, an ArgumentException saying it doesn’t like the asyncResult. Why is this if every other example I’ve found uses the same logic?

    private void GetSource(object state)
    {
    HttpWebRequest request = (HttpWebRequest)WebRequest.Create(new Uri(MyValidUri));
    request.Method = "POST";
    request.ContentType = "application/json";
    request.BeginGetResponse(new AsyncCallback(ReadCommunityCallBack), request);
    }

    private void ReadCommunityCallBack(IAsyncResult asyncResult)
    {            
        HttpWebRequest request = (HttpWebRequest)asyncResult.AsyncState;

        using (Stream outStream = request.EndGetRequestStream(asyncResult))
        {
          // DO STUFF HERE
        }
    }

And the error is here:

System.ArgumentException was unhandled by user code
Message=Value does not fall within the expected range.
   StackTrace:
   at System.Net.Browser.ClientHttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult)
   at cenTabbedFeed.MainPage.ReadCommunityCallBack(IAsyncResult asyncResult)
   at System.Net.Browser.ClientHttpWebRequest.<>c__DisplayClass1a.<InvokeGetResponseCallback>b__18(Object state2)
   at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

Like I said, I’ve been scouring examples and trying to find an answer on MSDN and I’m stuck and frustrated.

-Thanks in advance
RJ

  • 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-05-30T21:24:43+00:00Added an answer on May 30, 2026 at 9:24 pm

    your request method is POST but you don’t post anything. Either write something to RequestStream or change your method to GET.

    –EDIT–

    You can post some string to server as below

    byte[] buf = Encoding.UTF8.GetBytes("key=value&key2=value2&key3=value3");
    request.ContentType = "application/www-form-urlencoded";
    request.ContentLength = buf.Length;
    request.GetRequestStream().Write(buf,0,buf.Length);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have no idea why this isn't working. I've taken code from a previous
Anyone have any idea why this isn't working? $(function(){ console.log('ready'); $.ajax({ dataType : 'jsonp',
Anybody have any idea why this query isn't working? $result = mysql_query(SELECT * FROM
I have no idea why this isn't working. NSData *data = [NSData dataWithContentsOfURL:place.iconData]; UIImage
I have no idea why this isn't working, but I can't seem to get
For whatever reason, this little piece of dojo isn't working. I have to admit
I have this idea for a free backup application. The largest problem I need
I have no idea why this is happening. I have some very straightforward code,
I have no idea if this is possible, but if it is, what would
I have no idea why this doesn't work, but doing some validation functions and

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.