コード例 #1
0
 public System.Threading.Tasks.Task <GEMSoapService.ServiceResponse> ServiceAsync(string username, string password, string TIN, string VATTaxPayerName, string GuildName, int ProvinceCode)
 {
     GEMSoapService.ServiceRequest inValue = new GEMSoapService.ServiceRequest();
     inValue.Body                 = new GEMSoapService.ServiceRequestBody();
     inValue.Body.username        = username;
     inValue.Body.password        = password;
     inValue.Body.TIN             = TIN;
     inValue.Body.VATTaxPayerName = VATTaxPayerName;
     inValue.Body.GuildName       = GuildName;
     inValue.Body.ProvinceCode    = ProvinceCode;
     return(((GEMSoapService.gemserviceRD3Soap)(this)).ServiceAsync(inValue));
 }
コード例 #2
0
        public async Task <ActionResult <HttpResultModel> > Get([FromBody] Model.GEM model)
        {
            HttpResultModel httpResult = new HttpResultModel();

            try
            {
                GEMSoapService.gemserviceRD3SoapClient            service        = new GEMSoapService.gemserviceRD3SoapClient();
                ChannelFactory <GEMSoapService.gemserviceRD3Soap> channelFactory = service.ChannelFactory;
                GEMSoapService.gemserviceRD3Soap channel        = channelFactory.CreateChannel();
                GEMSoapService.ServiceRequest    serviceRequest = new GEMSoapService.ServiceRequest
                {
                    Body = new GEMSoapService.ServiceRequestBody
                    {
                        username        = soapUsername,
                        password        = soapPassword,
                        TIN             = model.vTaxPayerID,
                        ProvinceCode    = Convert.ToInt32(model.vProvinceCode),
                        GuildName       = model.vGuildName,
                        VATTaxPayerName = model.vVATTaxPayerName
                    }
                };

                GEMSoapService.ServiceResponse responseMessage = await channel.ServiceAsync(serviceRequest);

                GEMSoapService.gems soapResult = responseMessage?.Body.ServiceResult;
                Model.GEM           gemModel   = new Model.GEM(soapResult);
                // TODO: ตรงนี้ไม่มีตัวอย่างข้อมูลสำหรับทดสอบ หากต้องการใช้งานจะต้องพัฒนาต่อเอง

                httpResult.SetPropertyHttpResult(httpResult, true, "", "", StatusCodes.Status200OK, gemModel);
            }
            catch (Exception ex)
            {
                httpResult.SetPropertyHttpResult(httpResult, false, "API Error", ex.Message, StatusCodes.Status500InternalServerError);
            }

            return(Ok(httpResult));
        }
コード例 #3
0
 System.Threading.Tasks.Task <GEMSoapService.ServiceResponse> GEMSoapService.gemserviceRD3Soap.ServiceAsync(GEMSoapService.ServiceRequest request)
 {
     return(base.Channel.ServiceAsync(request));
 }