public System.Threading.Tasks.Task <TINSoapService.ServiceTINResponse> ServiceTINAsync(string username, string password, string TIN)
 {
     TINSoapService.ServiceTINRequest inValue = new TINSoapService.ServiceTINRequest();
     inValue.Body          = new TINSoapService.ServiceTINRequestBody();
     inValue.Body.username = username;
     inValue.Body.password = password;
     inValue.Body.TIN      = TIN;
     return(((TINSoapService.checktinpinserviceSoap)(this)).ServiceTINAsync(inValue));
 }
        public async Task <ActionResult <HttpResultModel> > GetById(string tIN)
        {
            HttpResultModel httpResult = new HttpResultModel();

            try
            {
                if (!string.IsNullOrEmpty(tIN))
                {
                    TINSoapService.checktinpinserviceSoapClient            service        = new TINSoapService.checktinpinserviceSoapClient();
                    ChannelFactory <TINSoapService.checktinpinserviceSoap> channelFactory = service.ChannelFactory;
                    TINSoapService.checktinpinserviceSoap channel = channelFactory.CreateChannel();

                    TINSoapService.ServiceTINRequest serviceRequest = new TINSoapService.ServiceTINRequest
                    {
                        Body = new TINSoapService.ServiceTINRequestBody
                        {
                            username = soapUsername,
                            password = soapPassword,
                            TIN      = tIN,
                        }
                    };

                    TINSoapService.ServiceTINResponse responseMessage = await channel.ServiceTINAsync(serviceRequest);

                    object  soapResult = responseMessage?.Body?.ServiceTINResult;
                    JObject jObject    = JObject.Parse(soapResult?.ToString());

                    TINResult tINResult = new TINResult
                    {
                        ID          = ((JValue)((JContainer)jObject[nameof(TINResult.ID)]).First)?.Value?.ToString(),
                        MessageErr  = ((JValue)((JContainer)jObject[nameof(TINResult.MessageErr)]).First)?.Value?.ToString(),
                        DigitOk     = ((JValue)((JContainer)jObject[nameof(TINResult.DigitOk)]).First)?.Value?.ToString(),
                        IsExist     = ((JValue)((JContainer)jObject[nameof(TINResult.IsExist)]).First)?.Value?.ToString(),
                        vID         = ((JValue)((JContainer)jObject[nameof(TINResult.vID)]).First)?.Value?.ToString(),
                        vMessageErr = ((JValue)((JContainer)jObject[nameof(TINResult.vMessageErr)]).First)?.Value?.ToString(),
                        vDigitOk    = ((JValue)((JContainer)jObject[nameof(TINResult.vDigitOk)]).First)?.Value?.ToString(),
                        vIsExist    = ((JValue)((JContainer)jObject[nameof(TINResult.vIsExist)]).First)?.Value?.ToString()
                    };

                    httpResult.SetPropertyHttpResult(httpResult, true, "", "", StatusCodes.Status200OK, tINResult);
                }
                else
                {
                    httpResult.SetPropertyHttpResult(httpResult, true, "", "", StatusCodes.Status400BadRequest);
                }
            }
            catch (Exception ex)
            {
                httpResult.SetPropertyHttpResult(httpResult, false, "", ex.Message, StatusCodes.Status500InternalServerError);
            }

            return(httpResult);
        }
 System.Threading.Tasks.Task <TINSoapService.ServiceTINResponse> TINSoapService.checktinpinserviceSoap.ServiceTINAsync(TINSoapService.ServiceTINRequest request)
 {
     return(base.Channel.ServiceTINAsync(request));
 }