Exemple #1
0
 public override Gateway.GetPartnerInfoResponse GetPartnerInfo(Gateway.GetPartnerInfoRequest request)
 {
     Logger.BeginRequest("GetPartnerInfo received from " + gateway.GetName(request.clientID), request);
     Gateway.GetPartnerInfoResponse response = gateway.GetPartnerInfo(request);
     Logger.EndRequest(response);
     return(response);
 }
Exemple #2
0
 public override Gateway.GetPartnerInfoResponse GetPartnerInfo(Gateway.GetPartnerInfoRequest request)
 {
     Logger.BeginRequest("GetPartnerInfo sent to " + server.name, request);
     Gateway.GetPartnerInfoResponse response = server.GetPartnerInfo(request);
     Logger.EndRequest(response);
     return(response);
 }
        public override Gateway.GetPartnerInfoResponse GetPartnerInfo(Gateway.GetPartnerInfoRequest request)
        {
            requests++;
            Gateway.GetPartnerInfoResponse resp = server.GetPartnerInfo(request);

            Gateway.GetPartnerInfoResponse response = new Gateway.GetPartnerInfoResponse
            {
                fleets = resp.fleets,
                vehicleTypes = resp.vehicleTypes,
                result = resp.result
            };
            return response;
        }
Exemple #4
0
 List <Zone> GetPartnerCoverage(string partnerID)
 {
     if (!partnerCoverage.ContainsKey(partnerID))
     {
         Gateway partner = partners[partnerID];
         Gateway.GetPartnerInfoResponse resp = partner.GetPartnerInfo(new Gateway.GetPartnerInfoRequest(ID));
         List <Zone> coverage = new List <Zone>();
         foreach (Fleet f in resp.fleets)
         {
             coverage.AddRange(f.Coverage);
         }
         partnerCoverage.Add(partner.ID, coverage);
     }
     return(partnerCoverage[partnerID]);
 }
        public override Gateway.GetPartnerInfoResponse GetPartnerInfo(Gateway.GetPartnerInfoRequest request)
        {
            Logger.BeginRequest("GetPartnerInfo sent to " + name, request);

            JsonServiceClient client = new JsonServiceClient(RootUrl);
            GatewayService.PartnersResponse resp = client.Get<GatewayService.PartnersResponse>(new GatewayService.Partners
            {
                access_token = AccessToken,
            });

            Gateway.GetPartnerInfoResponse response = new Gateway.GetPartnerInfoResponse
            {
                fleets = resp.Fleets,
                vehicleTypes = resp.VehicleTypes,
                result = resp.ResultCode
            };
            Logger.EndRequest(response);
            return response;
        }
Exemple #6
0
        public override Gateway.GetPartnerInfoResponse GetPartnerInfo(Gateway.GetPartnerInfoRequest request)
        {
            Uri uri;
            if (!Uri.TryCreate(RootUrl, UriKind.Absolute, out uri))
                return new Gateway.GetPartnerInfoResponse
                {
                    result = Result.InvalidParameters
                };

            Logger.BeginRequest("GetPartnerInfo sent to " + name, request);
            //Logger.Log("RootURL: " + RootUrl);

            JsonServiceClient client = new JsonServiceClient(RootUrl);
            client.Timeout = timeout;
            GatewayService.NetworksResponse resp = client.Get<GatewayService.NetworksResponse>(new GatewayService.Networks
            {
                access_token = AccessToken,
            });

            Gateway.GetPartnerInfoResponse response = new Gateway.GetPartnerInfoResponse
            {
                fleets = resp.Fleets,
                vehicleTypes = resp.VehicleTypes,
                result = resp.ResultCode
            };
            Logger.EndRequest(response);
            return response;
        }