/// <summary> /// The client side implementation of the End_NAME_ service contract. /// </summary> public _NAME_ResponseMessage End_NAME_(IAsyncResult result) { try { WcfChannelAsyncResult asyncResult = WcfChannelAsyncResult.WaitForComplete(result); return(asyncResult.Channel.End_NAME_(asyncResult.InnerResult)); } catch (FaultException <ServiceFault> e) { throw HandleSoapFault(e); } }
/// <summary> /// Checks for a valid IAsyncResult object and waits for the operation to complete. /// </summary> /// <param name="ar">The IAsyncResult object for the operation.</param> /// <returns>The oject that </returns> public static new WcfChannelAsyncResult WaitForComplete(IAsyncResult ar) { WcfChannelAsyncResult asyncResult = ar as WcfChannelAsyncResult; if (asyncResult == null) { throw new ArgumentException("End called with an invalid IAsyncResult object.", nameof(ar)); } if (!asyncResult.WaitForComplete()) { throw new ServiceResultException(StatusCodes.BadTimeout); } return(asyncResult); }
/// <summary> /// The client side implementation of the EndInvokeService service contract. /// </summary> public override InvokeServiceResponseMessage EndInvokeService(IAsyncResult result) { WcfChannelAsyncResult asyncResult = WcfChannelAsyncResult.WaitForComplete(result); return(asyncResult.Channel.EndInvokeService(asyncResult.InnerResult)); }