MobileRemoteStop(MobileRemoteStopRequest Request)

        {
            #region Initial checks

            if (Request == null)
            {
                throw new ArgumentNullException(nameof(Request), "The given MobileRemoteStop request must not be null!");
            }

            Request = _CustomMobileRemoteStopRequestMapper(Request);

            if (Request == null)
            {
                throw new ArgumentNullException(nameof(Request), "The mapped MobileRemoteStop request must not be null!");
            }


            HTTPResponse <Acknowledgement <MobileRemoteStopRequest> > result = null;

            #endregion

            #region Send OnMobileRemoteStopRequest event

            var StartTime = DateTime.UtcNow;

            try
            {
                if (OnMobileRemoteStopRequest != null)
                {
                    await Task.WhenAll(OnMobileRemoteStopRequest.GetInvocationList().
                                       Cast <OnMobileRemoteStopRequestDelegate>().
                                       Select(e => e(StartTime,
                                                     Request.Timestamp.Value,
                                                     this,
                                                     ClientId,
                                                     Request.EventTrackingId,
                                                     Request.SessionId,
                                                     Request.RequestTimeout ?? RequestTimeout.Value))).
                    ConfigureAwait(false);
                }
            }
            catch (Exception e)
            {
                e.Log(nameof(MobileClient) + "." + nameof(OnMobileRemoteStopRequest));
            }

            #endregion


            using (var _OICPClient = new SOAPClient(Hostname,
                                                    URLPathPrefix + MobileAuthorizationURL,
                                                    VirtualHostname,
                                                    RemotePort,
                                                    RemoteCertificateValidator,
                                                    ClientCertificateSelector,
                                                    UserAgent,
                                                    RequestTimeout,
                                                    DNSClient))

            {
                result = await _OICPClient.Query(_CustomMobileRemoteStopSOAPRequestMapper(Request,
                                                                                          SOAP.Encapsulation(Request.ToXML(CustomMobileRemoteStopRequestSerializer))),
                                                 "eRoamingMobileRemoteStop",
                                                 RequestLogDelegate :   OnMobileRemoteStartSOAPRequest,
                                                 ResponseLogDelegate :  OnMobileRemoteStartSOAPResponse,
                                                 CancellationToken :    Request.CancellationToken,
                                                 EventTrackingId :      Request.EventTrackingId,
                                                 RequestTimeout :         Request.RequestTimeout ?? RequestTimeout.Value,

                                                 #region OnSuccess

                                                 OnSuccess : XMLResponse => XMLResponse.ConvertContent(Request,
                                                                                                       (request, xml, onexception) =>
                                                                                                       Acknowledgement <MobileRemoteStopRequest> .Parse(request,
                                                                                                                                                        xml,
                                                                                                                                                        CustomAcknowledgementMobileRemoteStopParser,
                                                                                                                                                        CustomStatusCodeParser,
                                                                                                                                                        onexception)),

                                                 #endregion

                                                 #region OnSOAPFault

                                                 OnSOAPFault : (timestamp, soapclient, httpresponse) => {
                    SendSOAPError(timestamp, this, httpresponse.Content);

                    return(new HTTPResponse <Acknowledgement <MobileRemoteStopRequest> >(

                               httpresponse,

                               new Acknowledgement <MobileRemoteStopRequest>(
                                   Request,
                                   StatusCodes.DataError,
                                   httpresponse.Content.ToString()
                                   ),

                               IsFault: true

                               ));
                },

                                                 #endregion

                                                 #region OnHTTPError

                                                 OnHTTPError : (timestamp, soapclient, httpresponse) => {
                    SendHTTPError(timestamp, this, httpresponse);

                    return(new HTTPResponse <Acknowledgement <MobileRemoteStopRequest> >(

                               httpresponse,

                               new Acknowledgement <MobileRemoteStopRequest>(
                                   Request,
                                   StatusCodes.DataError,
                                   httpresponse.HTTPStatusCode.ToString(),
                                   httpresponse.HTTPBody.ToUTF8String()
                                   ),

                               IsFault: true

                               ));
                },

                                                 #endregion

                                                 #region OnException

                                                 OnException : (timestamp, sender, exception) => {
                    SendException(timestamp, sender, exception);

                    return(HTTPResponse <Acknowledgement <MobileRemoteStopRequest> > .ExceptionThrown(

                               new Acknowledgement <MobileRemoteStopRequest>(
                                   Request,
                                   StatusCodes.ServiceNotAvailable,
                                   exception.Message,
                                   exception.StackTrace
                                   ),

                               Exception: exception

                               ));
                }

                                                 #endregion

                                                 );
            }

            if (result == null)
            {
                result = HTTPResponse <Acknowledgement <MobileRemoteStopRequest> > .OK(
                    new Acknowledgement <MobileRemoteStopRequest>(
                        Request,
                        StatusCodes.SystemError,
                        "HTTP request failed!"
                        )
                    );
            }


            #region Send OnMobileRemoteStopResponse event

            var Endtime = DateTime.UtcNow;

            try
            {
                if (OnMobileRemoteStopResponse != null)
                {
                    await Task.WhenAll(OnMobileRemoteStopResponse.GetInvocationList().
                                       Cast <OnMobileRemoteStopResponseDelegate>().
                                       Select(e => e(Endtime,
                                                     Request.Timestamp.Value,
                                                     this,
                                                     ClientId,
                                                     Request.EventTrackingId,
                                                     Request.SessionId,
                                                     Request.RequestTimeout ?? RequestTimeout.Value,
                                                     result.Content,
                                                     Endtime - StartTime))).
                    ConfigureAwait(false);
                }
            }
            catch (Exception e)
            {
                e.Log(nameof(MobileClient) + "." + nameof(OnMobileRemoteStopResponse));
            }

            #endregion

            return(result);
        }