/// <summary> /// Finishes an asynchronous invocation of the _NAME_ service. /// </summary> void EndAsyncCall() { _NAME_Response response = null; try { if (UseTransportChannel) { IServiceResponse genericResponse = TransportChannel.EndSendRequest(result); if (genericResponse == null) { throw new ServiceResultException(StatusCodes.BadUnknownResponse); } ValidateResponse(genericResponse.ResponseHeader); response = (_NAME_Response)genericResponse; } else { _NAME_ResponseMessage responseMessage = InnerChannel.End_NAME_(result); if (responseMessage == null || responseMessage._NAME_Response == null) { throw new ServiceResultException(StatusCodes.BadUnknownResponse); } response = responseMessage._NAME_Response; ValidateResponse(response.ResponseHeader); } // ResponseParameters } finally { RequestCompleted(null, response, "_NAME_"); } return(response.ResponseHeader); }