public void CallTheDataProvider(ICollection<IPointToLaceProvider> response)
        {
            try
            {
                _certificate =
                    new CoOrdinateCertificateFactory(
                        new CoOrdinateCertificateRequest(GetValidLatitudeCoordinate(_dataProvider.GetRequest<IAmJisRequest>().Latitude),
                            GetValidLongitudeCoordinate(_dataProvider.GetRequest<IAmJisRequest>().Latitude)),
                        _repository);

                _logCommand.LogConfiguration(new {Certficate = _certificate}, null);

                if (!_certificate.IsSuccessfull || _certificate.Certificate == null || string.IsNullOrEmpty(_certificate.Certificate.Endpoint))
                    throw new Exception("Certificate for JIS request could not be generated");

                var proxy = new JisWsInterfaceSoapClient(_certificate.Certificate.Endpoint);
                if (proxy.State == CommunicationState.Closed)
                    proxy.Open();

                proxy.Connect();

                var session = new SessionManager(proxy, _log, _dataProvider.GetRequest<IAmJisRequest>()).Build().SessionManagement;
                var request = new BuildJisRequest(_dataProvider.GetRequest<IAmJisRequest>()).JisRequest;

                _logCommand.LogRequest(new ConnectionTypeIdentifier(proxy.Endpoint.Address.Uri.ToString()).ForWebApiType(), new {request, session});

                _jisResponse = proxy.DataStoreQuery(session.Id, request, _dataProvider.GetRequest<IAmJisRequest>().UserName.Field);

                if (_jisResponse.IsHot)
                {
                    _sightingUpdate =
                        new SightingUpdate(_dataProvider.GetRequest<IAmJisRequest>(), _jisResponse).BuildRequest()
                            .Update(proxy, session)
                            .SightingUpdateResult;
                }

                proxy.Close();

                _logCommand.LogResponse(_jisResponse != null ? DataProviderState.Successful : DataProviderState.Failed,
                    new ConnectionTypeIdentifier(proxy.Endpoint.Address.Uri.ToString()).ForWebApiType(), new {_jisResponse});

                TransformResponse(response);

            }
            catch (Exception ex)
            {
                _log.ErrorFormat("Error calling Jis Web Service {0}",ex, ex.Message);
                _logCommand.LogFault(new {ex.Message}, new {ErrorMessage = "Error calling JIS Web Service"});
                JisResponseFailed(response);
            }
        }
 public IUpdateSighting Update(JisWsInterfaceSoapClient jisClient, SessionManagementResult session)
 {
     SightingUpdateResult = jisClient.UpdateSighting(session.Id, _sightingUpdate, _request.UserName.Field);
     return this;
 }
 public SessionManager(JisWsInterfaceSoapClient jisClient, ILog log, IAmJisRequest request)
 {
     _jisClient = jisClient;
     _log = log;
     _request = request;
 }