Page 1 of 1

WCF service method call 'Completed' event

Posted: Fri Jan 13, 2017 12:58 am
by njs123

WCF service method call 'Completed' event is not available in CSHTML5

how do I use it?

Re: WCF service method call 'Completed' event

Posted: Fri Jan 13, 2017 7:35 am
by JS-Support @Userware

You can either call the web service synchronously, or you can use the async/await pattern.

For the synchronous call, please refer to the SOAP tutorial at: ... rials.aspx

For the asynchronous version, please check the sample Showcase application (in VS, click File => New => Project => C#/XAML for HTML5 => Sample Showcase)


Re: WCF service method call 'Completed' event

Posted: Wed Feb 15, 2017 1:51 am
by njs123

In current large scale enterprise silverlight application I have service code as follows:

Code: Select all

 UsersService.UsersClient objUserService =
                            new MyApp.UsersService.UsersClient("CustomBinding_Users");
                        objUserService.GetUserAuthenticationCompleted +=
                            new EventHandler<MyApp.UsersService.GetUserAuthenticationCompletedEventArgs>(objIntuitiveEMRService_GetUserAuthenticationCompleted);
                        objUserService.GetUserAuthenticationAsync(txtUserName.Text, txtPassword.Password, ((App)Application.Current).ClientID);

Now in CSHTML syntax to call web service is as follows:

Code: Select all

ServiceReference1.Service1Client _soapClient =
        new ServiceReference1.Service1Client(
            new System.ServiceModel.BasicHttpBinding(),
            new System.ServiceModel.EndpointAddress(
                new Uri("http://localhost:4598/Service1.svc")));

The ServiceNameCompleted event is not available,
If I change the syntax then changes needs to be done in lots of files,
Please provide support to call the wcf web service without affecting the existing syntax?