Skip to main content
Home Forums General Silverlight Getting Started svc file does select items but it doesnt receive in silverlight
0 replies. Latest Post by Jelmer850i on November 26, 2009.
(0)
Jelmer850i
Member
4 points
99 Posts
11-26-2009 9:33 AM |
I've made a function in silverlight:
public partial class MainPage : UserControl { private string filename; private string new_filename; private Uploader _uploader = new Uploader(SilverlightUploadApplication.App._BasePath); GetMoviesClient proxy = new GetMoviesClient(); #region Bind private void Bind() { proxy.getMovieCategoriesCompleted += new EventHandler (proxy_GetCategorieCompleted); proxy.getMovieCategoriesAsync(); } void proxy_GetCategorieCompleted(object sender, getMovieCategoriesCompletedEventArgs e) { drpCategory.ItemsSource = e.Result.ToList(); }
The meaning is that he goes to my asp.net site, and gets some data.the function getMovieCategories works, and returns correct data.But after that i can wait a long time, till i get a timeout.So the data doesnt received by Silverlight.Why not? and what can i change?
[ServiceContract(Namespace = "")] [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] public class GetMovies { [OperationContract] public void DoWork() { // Add your operation implementation here return; } // Add more operations here and mark them with [OperationContract] [OperationContract] public IEnumerable getMovieCategories() { dfcenterDataContext dbtv = new dfcenterDataContext(); var query = (from c in dbtv.tblMovieCategories select c); return query; }
My clientaccesspolicy.xml:
<?xml version="1.0" encoding="utf-8"?><access-policy> <cross-domain-access> <policy> <allow-from http-request-headers="*"> <domain uri="*"/> </allow-from> <grant-to> <resource path="/" include-subpaths="true"/> </grant-to> </policy> </cross-domain-access></access-policy>
And my crossdomein.xml:
Clientaccesspolicy:
And my ServiceReferences.ClientConfig file: