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

  • Home
  • SEARCH
  • 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 7639349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:23:46+00:00 2026-05-31T08:23:46+00:00

My problem is: My WebClient uses a function in the Cloud (http://127.0.0.1:81/Service1.svc/Data). But it

  • 0

My problem is:

My WebClient uses a function in the Cloud (http://127.0.0.1:81/Service1.svc/Data).

But it is impossible to call several times (for example to make an update).

Here is my code:

private void button_Click(object sender, RoutedEventArgs e)
{
WebClient cnt = new WebClient();
cnt.DownloadStringCompleted += new DownloadStringCompletedEventHandler(cnt_DownloadStringCompleted);
cnt.DownloadStringAsync(new Uri("http://127.0.0.1:81/Service1.svc/Data"));
}

void cnt_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
{
int num = JsonHelper.FromJson<int>(e.Result);
textbox.Dispatcher.BeginInvoke(() => textbox.Text = Convert.ToString(num));
}

After each click, the application goes well in cnt_DownloadStringCompleted but the result (e.Result) never changes after an update in the server.

At the Azure service, I noticed through a break that the function (Data) is called only once (first time).

How can I do to call my service more than once?

  • 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-31T08:23:47+00:00Added an answer on May 31, 2026 at 8:23 am

    Check your server side to make sure that you aren’t allowing caching. If you have the response context in your service, set:

    Response.Cache.SetCacheability(HttpCacheability.NoCache);
    

    Alternatively, if you don’t have the ability to do this, send in a changing nonsense parameter on the querystring, something like:

    http://127.0.0.1:81/Service1.svc/Data?nonsense=190AF142-4341-47DC-9CF5-3BC3ACBD02EE
    

    You can either generate and send in a new guid each time, or even use DateTime.Now.Ticks.ToString(). That being said, if you have control over the server side, eliminate caching, as this way is a serious hack.

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

Sidebar

Related Questions

I want to login to a website ( http://www.orkut.com ) through com.gargoylesoftware.htmlunit.WebClient But when
I have a problem downloading particular file types by WebClient. So there are no
Problem: I have two spreadsheets that each serve different purposes but contain one particular
Problem I have timestamped data, which I need to search based on the timestamp
I am trying to make a basic webclient call to get an xml stream
I would like to use the WebClient (or there is another better option?) but
I am making a call to a page on my site using webclient. I'm
I have an ASP.NET MVC application that currently uses the WebClient class to make
I've got a problem using WebClient.UploadStringAsync method. I've to do a POST request with
everyone. I'm programming with c# language and I have a problem with WebClient class.

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.