Ejemplo n.º 1
0
        private XRoadClientIdentifierType InitClientHeader()
        {
            var ci = new XRoadClientIdentifierType();

            ci.objectType    = XRoadObjectType.SUBSYSTEM;
            ci.xRoadInstance = config.Client.XRoadInstance;
            ci.memberClass   = config.Client.MemberClass;
            ci.memberCode    = config.Client.MemberCode;
            ci.subsystemCode = config.Client.SubSystemCode;
            return(ci);
        }
Ejemplo n.º 2
0
        public BaseClient(HeldinConfig config)
        {
            this.config           = config;
            serviceHeaders        = InitServiceHeaders();
            clientHeader          = InitClientHeader();
            protocolVersionHeader = PROTOCOL_VERSION;
            userIdHeader          = config.UserId;
            issueHeader           = null;
            webService            = FolkClient.WebService(config.Host, config.Secure);
            var myPrivileges = GetMyPrivileges();

            canUseCommunityMethods = myPrivileges.Contains(CAN_USE_COMMUNITY_METHODS);
            CheckPrivileges(myPrivileges);
        }
Ejemplo n.º 3
0
 internal AppUser[] GetByFilter1(ref string sprotocolVersion, ref string sid, ref string sUserId, ref XRoadServiceIdentifierType service, ref XRoadClientIdentifierType client, string filter)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 4
0
        static void Main(string[] args)

        {
            //Create header objects
            var protocolVersion = "4.0";
            var id      = Guid.NewGuid().ToString();
            var userId  = "EE37007160274";
            var service = new XRoadServiceIdentifierType
            {
                xRoadInstance  = "ee-dev",
                memberClass    = "COM",
                memberCode     = "11333578",
                subsystemCode  = "aktorstest-db01",
                serviceCode    = "personList",
                serviceVersion = "v1",
                objectType     = XRoadObjectType.SERVICE
            };
            var client = new XRoadClientIdentifierType
            {
                xRoadInstance = "ee-dev",
                memberClass   = "COM",
                memberCode    = "11333578",
                subsystemCode = "misp2-01",
                objectType    = XRoadObjectType.SUBSYSTEM
            };


            var PLrequest = new personListRequest(
                client,
                service,
                userId,
                id,
                protocolVersion,
                "",
                "Torgoev");


            person_registerClient clientPerson = new person_registerClient();

            // Используйте переменную "client", чтобы вызвать операции из службы.
            // Всегда закройте клиент.


            var response = clientPerson.personList(PLrequest);

            //Console.WriteLine(response.ToString());

            // var response = clientPerson;
            if ((response.id != null))
            {
                Console.WriteLine("Имя : " + response.person.firstName);
                Console.WriteLine("Фамилия : " + response.person.lastName);

                Console.WriteLine("Дата рождения : " + response.person.birthDate);

                Console.WriteLine("Адрес : " + response.person.personContact.address);
                Console.WriteLine("Email : ");
                foreach (String value in response.person.personContact.email)
                {
                    Console.WriteLine("    " + value);
                }


                Console.WriteLine("Phone : ");
                foreach (String value in response.person.personContact.phone)
                {
                    Console.WriteLine("    " + value);
                }
            }
            else
            {
                Console.WriteLine("Не найден!");
            }


            String nn = Console.ReadLine();

            clientPerson.Close();
        }