I need to call the Register() method on a Web service asynchronously (using C#). The implementation of the actual Register method in the Web service does not return any value. But it throws an exception if the method fails. Given this, does the following code look ok please?
public void RegisterProduct(string productName)
{
await RegisterProductAsync();
}
private async static Task RegisterProductAsync(string productName)
{
try
{
await myWebService.Register(productName);
}
catch(Exception ex)
{
LogException(ex);
}
}
Thanks for your help.