Skip to main content
Home Forums Silverlight Programming Accessing Web Services with Silverlight Waiting forever after successful read of json service
1 replies. Latest Post by CarlosFigueira on August 26, 2009.
(0)
Frank Mi...
Member
13 points
10 Posts
08-19-2009 8:58 AM |
I have this code:
1 public partial class MainPage : UserControl 2 { 3 List mm; 4 5 public MainPage() 6 { 7 InitializeComponent(); 8 9 mm = new List(); 10 11 MinMaxChart.DataContext = mm; 12 } 13 14 void Page_Loaded(object sender, RoutedEventArgs e) 15 { 16 WebClient mvc = new WebClient(); 17 18 mvc.OpenReadCompleted += new OpenReadCompletedEventHandler(mvc_OpenReadCompleted); 19 20 mvc.OpenReadAsync(new Uri(rootUri + "Chart/MinMaxService")); 21 22 } 23 24 void mvc_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e) 25 { 26 DataContractJsonSerializer json = new DataContractJsonSerializer(typeof(List)); 27 28 /*mm.Add(new MinMaxDTEntry 29 { 30 Date = DateTime.Parse("1.1.2009"), 31 Average = 320, 32 Maximum = 400, 33 Minimum = 200 34 }); 35 mm.Add(new MinMaxDTEntry 36 { 37 Date = DateTime.Parse("1.2.2009"), 38 Average = 420, 39 Maximum = 500, 40 Minimum = 300 41 }); 42 mm.Add(new MinMaxDTEntry 43 { 44 Date = DateTime.Parse("1.3.2009"), 45 Average = 220, 46 Maximum = 300, 47 Minimum = 100 48 });*/ 49 50 51 mm = (List)json.ReadObject(e.Result); 52 53 }
After line 51 after the return of the function the browser (firefox) is still waiting and showing: "transferring data from...."
However the 51 mm assignment works well. mm is filled as should be.
The same problem happens, if I do not assign the stream to mm, but the fixed values from line 28 to 48 that are currently commented out.
Strange things are happening ...
CarlosFi...
113 points
20 Posts
08-26-2009 5:06 PM |
Hello,
If you close the stream after using it, does FF still show the "transferring" status?
52 e.Result.Close();