Can someone tell me why I have a wcf contract:
[ServiceContract ] Public Interface IService1 {[OperationContract] String TestGetName (); } and implementation
public string TestGetName () {return "cassia"; } When I try to consume it in a console app, I can:
Service1 client client = new Service1Client (); Console.WriteLine ((client.TestGetName ())); But in Silverlight I have to use it:
Service 1 Client ClientTest = New Service 1 Client (); ClientTest.TestGetName + = new event handler & lt; TestGetNameCompletedEventArgs & gt; (ClientTest_TestGetNameCompleted); ClientTest.TestGetNameAynsync (); Zero ClientTest_StateGetName (Object Sender, TestGetNameCompletedEventArgsE) {this.dataGridChild.DataContext = e.Result; } Why do not I see this first small solution in SL, but only with the event handler? Or better ... In the console app, I can select the sync operation generation and in SL I should generate asynchronous explorer ...:
A synchronous call will stop the Silverlight UI thread and possibly execute the environment, ie the browser. To prevent this, only asynchronous calls are allowed.
Of course this is something unusual for the first time, but in the long run it is really useful to subtract the visual and service level.
Comments
Post a Comment