示例#1
0
        public override void ProcessPerson(string cprNumberOrUuid)
        {
            var partService = new BatchClient.Part.Part();

            partService.Url = this.PartServiceUrl;
            partService.ApplicationHeaderValue = new BatchClient.Part.ApplicationHeader()
            {
                ApplicationToken = this.ApplicationToken, UserToken = this.UserToken
            };
            partService.Credentials = System.Net.CredentialCache.DefaultCredentials;

            string uuid;

            if (CprBroker.Utilities.Strings.IsGuid(cprNumberOrUuid))
            {
                uuid = cprNumberOrUuid;
            }
            else
            {
                var getUuidResult = partService.GetUuid(cprNumberOrUuid);
                ValidateResult(cprNumberOrUuid, "GetUuid", getUuidResult.StandardRetur);
                uuid = getUuidResult.UUID;
            }
            var request = new BatchClient.Part.LaesInputType()
            {
                UUID = uuid
            };
            var readResult = partService.Read(request);

            ValidateResult(cprNumberOrUuid, "Read", readResult.StandardRetur);
            Console.WriteLine(partService.QualityHeaderValue.QualityLevel);
        }
示例#2
0
        public override void ProcessPerson(string joinedPnrBatch)
        {
            var partService = new BatchClient.Part.Part();

            partService.Url = this.PartServiceUrl;
            partService.ApplicationHeaderValue = new BatchClient.Part.ApplicationHeader()
            {
                ApplicationToken = this.ApplicationToken, UserToken = this.UserToken
            };
            partService.Credentials = System.Net.CredentialCache.DefaultCredentials;

            string[] pnrs  = joinedPnrBatch.Split(',');
            var      uuids = new List <string>();

            foreach (var pnr in pnrs)
            {
                var getUuidResult = partService.GetUuid(pnr);
                ValidateResult(pnr, "GetUuid", getUuidResult.StandardRetur);
                uuids.Add(getUuidResult.UUID);
            }

            var request = new BatchClient.Part.ListInputType()
            {
                UUID = uuids.ToArray()
            };
            var listResult = partService.List(request);

            ValidateResult(joinedPnrBatch, "List", listResult.StandardRetur);

            Succeeded += listResult.LaesResultat.Where(res => res != null).Count();
            Failed    += listResult.LaesResultat.Where(res => res == null).Count();
            Console.WriteLine(string.Format("Batch finished: Size={0}, Succeeded So far={1}; Failed So far={2}", pnrs.Length, Succeeded, Failed));
        }
示例#3
0
        public override void ProcessPerson(string cprNumber)
        {
            var partService = new BatchClient.Part.Part();

            partService.Url = this.PartServiceUrl;
            partService.ApplicationHeaderValue = new BatchClient.Part.ApplicationHeader()
            {
                ApplicationToken = this.ApplicationToken, UserToken = this.UserToken
            };
            partService.Credentials = System.Net.CredentialCache.DefaultCredentials;
            var getUuidResult = partService.GetUuid(cprNumber);

            ValidateResult(cprNumber, "GetUuid", getUuidResult.StandardRetur);
        }