Ejemplo n.º 1
0
        /// <summary>
        /// Sisteme gelen zarf listesini alır
        /// </summary>
        /// <returns>Sisteme gelen zarf listesi</returns>
        public GetUBLListResponseType[] GelenZarflar(TextModel m, ArrayList sslList)
        {
            ServicePointManager.SecurityProtocol = TlsSetting.TlsSet(sslList);  // TLS/SSL ayarları
            WebServisAdresDegistir();
            using (new OperationContextScope(WsClient.InnerChannel))
            {
                if (WebOperationContext.Current != null)
                {
                    WebOperationContext.Current.OutgoingRequest.Headers.Add(HttpRequestHeader.Authorization,
                                                                            Authorization.GetAuthorization(m.Kullanici, m.Sifre));
                }

                var req = new getUBLListRequest      //sisteme gelen zarf listesi için request parametreleri
                {
                    Identifier        = m.PkEtiketi, // //alıcı posta kutusu
                    VKN_TCKN          = m.VknTckn,   // alıcı VKN/TCKN
                    DocType           = "ENVELOPE",  //döküman tipi
                    Type              = "INBOUND",   //gelen zarflar INBOUND, giden zarflar için OUTBOUND
                    FromDate          = m.IssueDate, // max 1 günlük tarih limiti verilmelidir.
                    ToDate            = m.EndDate,
                    FromDateSpecified = true,        //başlangıç ve bitiş tarihi verildikten sonra bu iki alanın true olarak set edilmesi gerekmektedir.
                    ToDateSpecified   = true
                };

                return(WsClient.getUBLList(req));
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        ///  Sisteme e-irsaliye yanıtı gönderir
        /// </summary>
        /// <returns>Gönderilen irsaliye yanıtı bilgileri</returns>
        public sendDesUBLResponse IrsaliyeYanitiGonder(TextModel m, string UUID, ArrayList sslList)
        {
            IrsaliyeYanitiUBL receiptAdvice = new IrsaliyeYanitiUBL();
            var createdUBL = receiptAdvice.CreateReceiptAdvice(m.VknTckn, m.IssueDate, UUID);                             // İrsaliye yanıtı UBL i oluşturulur
            UBLBaseSerializer serializer = new ReceiptAdviceSerializer();                                                 // UBL  XML e dönüştürülür
            var strIrsaliyeYaniti        = serializer.GetXmlAsString(createdUBL);                                         // XML byte tipinden string tipine dönüştürülür

            byte[] zipliFile = ZipUtility.CompressFile(Encoding.UTF8.GetBytes(strIrsaliyeYaniti), createdUBL.UUID.Value); // XML  ziplenir
            ServicePointManager.SecurityProtocol = TlsSetting.TlsSet(sslList);                                            // TLS/SSL ayarları

            ClientEDespatchServicesPortClient wsClient = new ClientEDespatchServicesPortClient();

            using (new OperationContextScope(wsClient.InnerChannel))
            {
                if (WebOperationContext.Current != null)
                {
                    WebOperationContext.Current.OutgoingRequest.Headers.Add(HttpRequestHeader.Authorization,
                                                                            Authorization.GetAuthorization(m.Kullanici, m.Sifre));
                }
                var req = new sendDesUBLRequest
                {
                    VKN_TCKN           = m.VknTckn,   // gönderici vkn veya tckn
                    SenderIdentifier   = m.PkEtiketi, //gönderici birim etiketi
                    ReceiverIdentifier = m.GbEtiketi, //alıcı birim etiketi
                    DocType            = "RECEIPT",   // gönderilecek doküman tipi
                    DocData            = zipliFile    //gönderilecek irsaliye yanıtının ziplenmiş byte datası
                };

                return(wsClient.sendDesUBL(req));
            }
        }
        public getDocumentResponseType[] SmmPDFIndir(TextModel m, ArrayList sslList)
        {
            ServicePointManager.SecurityProtocol = TlsSetting.TlsSet(sslList); // TLS/SSL ayarları
            WebServisAdresDegistir();
            using (new OperationContextScope(WsClient.InnerChannel))
            {
                if (WebOperationContext.Current != null)
                {
                    WebOperationContext.Current.OutgoingRequest.Headers.Add(HttpRequestHeader.Authorization,
                                                                            Authorization.GetAuthorization(m.Kullanici, m.Sifre));
                }
                var req = new getDocumentRequest //UBL datası istenen e-arşiv faturasının request parametrelerini set ediyoruz.
                {
                    VKN_TCKN      = m.VknTckn,
                    GetDocDetails = new getDocumentRequestType[] {
                        new getDocumentRequestType {
                            Type     = "SMM",
                            ViewType = "PDF",
                            UUID     = m.FaturaUUID,
                            ID       = m.FaturaID
                        }
                    }
                };

                return(WsClient.getDocument(req));
            }
        }
Ejemplo n.º 4
0
        // <summary>
        /// Sisteme gönderilen e-irsaliye yanıtlarının listesini alır
        /// </summary>
        /// <returns>Sisteme gönderilen e-irsaliye yanıtlarının listesi</returns>
        public GetDesUBLListResponseType[] GonderilenIrsaliyeYanitlari(TextModel textModel, ArrayList sslList, RequestModel reqModel)
        {
            ServicePointManager.SecurityProtocol = TlsSetting.TlsSet(sslList); // TLS/SSL ayarları
            ClientEDespatchServicesPortClient wsClient = new ClientEDespatchServicesPortClient();

            using (new OperationContextScope(wsClient.InnerChannel))
            {
                if (WebOperationContext.Current != null)
                {
                    WebOperationContext.Current.OutgoingRequest.Headers.Add(HttpRequestHeader.Authorization,
                                                                            Authorization.GetAuthorization(textModel.Kullanici, textModel.Sifre));
                }

                var req = new getDesUBLListRequest
                {
                    Identifier        = reqModel.Identifier,   //gönderici birim etiketi
                    VKN_TCKN          = textModel.VknTckn,     //gönderici VKN veya TCKN
                    DocType           = reqModel.DocType,      //döküman tipi
                    Type              = reqModel.DespatchType, //gelen dosyalar için INBOUND, gönderilen dosyalar için ise OUTBOUND yazılmalı
                    FromDate          = textModel.IssueDate,   //sorgulanacak başlangıç tarihi. Max 1 günlük tarih aralığı limiti verilmeli.
                    ToDate            = textModel.EndDate,     //sorgulanacak bitiş tarihi
                    FromDateSpecified = true,
                    ToDateSpecified   = true                   //başlangıç ve bitiş tarihi verildikten sonra bu iki alanın true olarak set edilmesi gerekmektedir.
                };

                return(wsClient.getDesUBLList(req).Response);
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Sisteme gönderilen uygulama yanıtlarının listesini alır
        /// </summary>
        /// <returns>Sisteme gönderilen uygulama yanıtlarının listesi</returns>
        public GetUBLListResponseType[] GonderilenUygulamaYanitlari(TextModel m, ArrayList sslList)
        {
            ServicePointManager.SecurityProtocol = TlsSetting.TlsSet(sslList);  // TLS/SSL ayarları
            WebServisAdresDegistir();
            using (new OperationContextScope(WsClient.InnerChannel))
            {
                if (WebOperationContext.Current != null)
                {
                    WebOperationContext.Current.OutgoingRequest.Headers.Add(HttpRequestHeader.Authorization,
                                                                            Authorization.GetAuthorization(m.Kullanici, m.Sifre));
                }

                var req = new getUBLListRequest      //fatura ve uygulama yanıtı listesi çekerken aynı metod kullanılıyor. parametreler değişiklik gösteriyor.
                {
                    Identifier        = m.PkEtiketi, // uygulama yanıtının gönderici birim etiketi
                    VKN_TCKN          = m.VknTckn,   //tckn veya vkn
                    DocType           = "APP_RESP",  //döküman tipi
                    Type              = "OUTBOUND",  //gelen uygulama yanıtları için INBOUND, giden uygulama yanıtları için OUTBOUND
                    FromDate          = m.IssueDate, //uygulama yanıtlarının listesini çekerken max 1 günlük tarih limiti verilmelidir.
                    ToDate            = m.EndDate,
                    FromDateSpecified = true,        //başlangıç ve bitiş tarihi verildikten sonra bu iki alanın true olarak set edilmesi gerekmektedir.
                    ToDateSpecified   = true
                };

                return(WsClient.getUBLList(req)); //gönderilen parametreler sonucu gelen faturalara yolladığımız uygulama yanıtlarının listesi dönüyor.
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Grid üzerinden seçilen gelen veya gönderilen faturayı UBL olarak kayıt eder
        /// </summary>
        /// <returns>Grid üzerinden seçilen gelen veya gönderilen faturanın UBL binary datası</returns>
        public byte[][] FaturaUBLIndir(TextModel m, string[] invUUID, ArrayList sslList)
        {
            ServicePointManager.SecurityProtocol = TlsSetting.TlsSet(sslList);  // TLS/SSL ayarları
            WebServisAdresDegistir();
            using (new OperationContextScope(WsClient.InnerChannel))
            {
                if (WebOperationContext.Current != null)
                {
                    WebOperationContext.Current.OutgoingRequest.Headers.Add(HttpRequestHeader.Authorization,
                                                                            Authorization.GetAuthorization(m.Kullanici, m.Sifre));
                }

                string[] arrayUUID = invUUID;

                var req = new getUBLRequest   //Faturanın UBL datasını almak için request parametreleri gönderiyorz.
                {
                    Identifier = m.GbEtiketi, //gönderici birim etiketi
                    VKN_TCKN   = m.VknTckn,   //tckn veya vkn
                    UUID       = arrayUUID,   //grid üzerinden seçimi yapılan faturanın UUID si
                    DocType    = "INVOICE",   //xml olarak kaydedilecek dosya tipi
                    Type       = "OUTBOUND",  //gelen veya giden fatura seçeneği
                    Parameters = new[] { "XML" } //parametre olarak XML gönderiyoruz.
                };

                return(WsClient.getUBL(req));
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Grid üzerinden seçilen gelen veya gönderilen e-irsaliyeyi UBL olarak kayıt eder
        /// </summary>
        /// <returns>Grid üzerinden seçilen gelen veya gönderilen e-irsaliyenin UBL binary datası</returns>
        public getDesUBLResponse IrsaliyeUBLIndir(TextModel m, string[] UUID, ArrayList sslList, RequestModel reqModel)
        {
            ServicePointManager.SecurityProtocol = TlsSetting.TlsSet(sslList);  // TLS/SSL ayarları
            ClientEDespatchServicesPortClient wsClient = new ClientEDespatchServicesPortClient();

            using (new OperationContextScope(wsClient.InnerChannel))
            {
                if (WebOperationContext.Current != null)
                {
                    WebOperationContext.Current.OutgoingRequest.Headers.Add(HttpRequestHeader.Authorization,
                                                                            Authorization.GetAuthorization(m.Kullanici, m.Sifre));
                }

                var req = new getDesUBLRequest
                {
                    Identifier = reqModel.Identifier,  // Alınacak dosyanın bulunduğu etiket
                    VKN_TCKN   = m.VknTckn,            // VKN veya TCKN
                    UUID       = UUID,                 // datagrid deki irsaliye veya irsaliye yanıtlarının UUID si (en fazla 20 UUID sorgulanabilir)
                    DocType    = reqModel.DocType,     // Alınacak dosya irsaliye ise DESPATCH, irsaliye yanıtı ise RECEIPT yazılmalı
                    Type       = reqModel.DespatchType // Alınacak dosya gelen ise INBOUND , gönderilen ise OUTBOUND olmalı.
                };

                return(wsClient.getDesUBL(req)); // UBL in zipli base64 formatındaki datası döner
            }
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Sisteme uygulama yanıtı gönderir
        /// </summary>
        /// <returns>Sisteme gönderilen uygulama yanıtının bilgileri</returns>
        public SendUBLResponseType[] UygulamaYanitiGonder(TextModel m, string gelenFaturaID, ArrayList sslList)
        {
            ApplicationResponseUBL applicationResponse = new ApplicationResponseUBL();
            var createdUBL = applicationResponse.CreateApplicationResponse(m.VknTckn, gelenFaturaID, m.IssueDate);        // Uygulama yanıtı UBL i oluşturulur
            UBLBaseSerializer serializer = new InvoiceSerializer();                                                       // UBL  XML e dönüştürülür
            var strUygulamaYaniti        = serializer.GetXmlAsString(createdUBL);                                         // XML  byte tipinden string tipine dönüştürülür

            byte[] zipliFile = ZipUtility.CompressFile(Encoding.UTF8.GetBytes(strUygulamaYaniti), createdUBL.UUID.Value); // XML  ziplenir

            ServicePointManager.SecurityProtocol = TlsSetting.TlsSet(sslList);                                            // TLS/SSL ayarları
            WebServisAdresDegistir();

            using (new OperationContextScope(WsClient.InnerChannel))
            {
                if (WebOperationContext.Current != null)
                {
                    WebOperationContext.Current.OutgoingRequest.Headers.Add(HttpRequestHeader.Authorization,
                                                                            Authorization.GetAuthorization(m.Kullanici, m.Sifre));
                }

                var req = new sendUBLRequest
                {
                    SenderIdentifier   = m.PkEtiketi, //uygulama yanıtı gönderici birim etiketi
                    ReceiverIdentifier = m.GbEtiketi, //uygulama yanıtı alıcı posta kutusu
                    VKN_TCKN           = m.VknTckn,   // tckn veya vkn
                    DocType            = "APP_RESP",  //gönderilen döküman tipi
                    DocData            = zipliFile    //gönderilen uygulama yanıtının ziplenmiş byte datası
                };

                return(WsClient.sendUBL(req));
            }
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Sisteme e-fatura gönderir
        /// </summary>
        /// <returns>Sisteme gönderilen faturanın bilgileri </returns>
        public SendUBLResponseType[] FaturaGonder(TextModel m, ArrayList sslList, BaseInvoiceUBL fatura)
        {
            var createdUBL = fatura.BaseUBL;                                                                      // Fatura UBL i oluşturulur
            UBLBaseSerializer serializer = new InvoiceSerializer();                                               // UBL  XML e dönüştürülür
            var strFatura = serializer.GetXmlAsString(createdUBL);                                                // XML byte tipinden string tipine dönüştürülür

            byte[] zipliFile = ZipUtility.CompressFile(Encoding.UTF8.GetBytes(strFatura), createdUBL.UUID.Value); // XML  ziplenir
            ServicePointManager.SecurityProtocol = TlsSetting.TlsSet(sslList);                                    // TLS/SSL ayarları
            WebServisAdresDegistir();
            using (new OperationContextScope(WsClient.InnerChannel))
            {
                if (WebOperationContext.Current != null)
                {
                    WebOperationContext.Current.OutgoingRequest.Headers.Add(HttpRequestHeader.Authorization,
                                                                            Authorization.GetAuthorization(m.Kullanici, m.Sifre));
                }

                var req = new sendUBLRequest
                {
                    VKN_TCKN           = m.VknTckn,   //tckn veya vkn
                    SenderIdentifier   = m.GbEtiketi, //gönderici birim etiketi
                    ReceiverIdentifier = m.PkEtiketi, //alıcı posta kutusu
                    DocType            = "INVOICE",   //gönderilen döküman tipi. zarf, fatura vs.
                    DocData            = zipliFile    //içinde xml dosyası olan zip lenen dosya.
                };

                return(WsClient.sendUBL(req));
            }
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Sisteme gelen irsaliye zarf listesini alır
        /// </summary>
        /// <returns>Sisteme gelen irsaliye zarf listesi</returns>
        public getDesUBLListResponse GelenZarflar(TextModel m, ArrayList sslList)
        {
            ServicePointManager.SecurityProtocol = TlsSetting.TlsSet(sslList); // TLS/SSL ayarları
            ClientEDespatchServicesPortClient wsClient = new ClientEDespatchServicesPortClient();

            using (new OperationContextScope(wsClient.InnerChannel))
            {
                if (WebOperationContext.Current != null)
                {
                    WebOperationContext.Current.OutgoingRequest.Headers.Add(HttpRequestHeader.Authorization,
                                                                            Authorization.GetAuthorization(m.Kullanici, m.Sifre));
                }

                var req = new getDesUBLListRequest
                {
                    Identifier        = m.PkEtiketi, // alıcı birim etiketi
                    VKN_TCKN          = m.VknTckn,   //alıcı VKN veya TCKN
                    DocType           = "ENVELOPE",  //doküman tipi
                    Type              = "INBOUND",   // gelen dosyalar için INBOUND, gönderilen dosyalar için ise OUTBOUND yazılmalı
                    FromDate          = m.IssueDate, //sorgulanacak başlangıç tarihi. Max 1 günlük tarih aralığı limiti verilmeli
                    ToDate            = m.EndDate,   //sorgulanacak bitiş tarihi
                    FromDateSpecified = true,
                    ToDateSpecified   = true         //başlangıç ve bitiş tarihi verildikten sonra bu iki alanın true olarak set edilmesi gerekmektedir.
                };
                return(wsClient.getDesUBLList(req));
            }
        }
Ejemplo n.º 11
0
        /// <summary>
        /// Sisteme e-Arşiv fatura gönderir
        /// </summary>
        /// <returns>Sisteme gönderilen e-Arşiv faturanın bilgileri ve binary PDF datası</returns>
        public sendInvoiceResponseType EArsivGonder(TextModel m, BaseInvoiceUBL arsiv, ArrayList sslList)
        {
            var createdUBL = arsiv.BaseUBL;                                                                       // e-Arşiv fatura UBL i oluşturulur
            UBLBaseSerializer serializer = new InvoiceSerializer();                                               // UBL  XML e dönüştürülür
            var strFatura = serializer.GetXmlAsString(createdUBL);                                                // XML byte tipinden string tipine dönüştürülür

            byte[] zipliFile = ZipUtility.CompressFile(Encoding.UTF8.GetBytes(strFatura), createdUBL.UUID.Value); // XML  ziplenir
            string hash      = GetHashInfo(zipliFile);                                                            // zipli dosyanın hash bilgisi alınır

            ServicePointManager.SecurityProtocol = TlsSetting.TlsSet(sslList);                                    // TLS/SSL ayarları
            WebServisAdresDegistir();
            using (new OperationContextScope(WsClient.InnerChannel))
            {
                if (WebOperationContext.Current != null)
                {
                    WebOperationContext.Current.OutgoingRequest.Headers.Add(HttpRequestHeader.Authorization,
                                                                            Authorization.GetAuthorization(m.Kullanici, m.Sifre));
                }

                var req = new sendInvoiceRequest
                {
                    sendInvoiceRequestType = new SendInvoiceRequestType
                    {
                        senderID            = m.VknTckn,             //gönderici VKN-TCKN
                        receiverID          = "2222222222",          //alıcı VKN-TCKN
                        fileName            = createdUBL.UUID.Value, //dosya ismi
                        binaryData          = zipliFile,             //gönderilecek fatura
                        docType             = "XML",                 //dosya tipi
                        hash                = hash,                  //dosyanın hash bilgisi
                        customizationParams = new[]
                        {
                            new CustomizationParam
                            {
                                paramName  = "BRANCH", //parametre ismi
                                paramValue = m.Sube    //şube adı opsiyoneldir. Gönderilmez ise varsayılan olarak "default" şube setlenir.
                            }
                        }
                    }
                };

                return(WsClient.sendInvoice(req.sendInvoiceRequestType));
            }
        }
        /// <summary>
        /// Textbox a girilen TCKN veya VKN numarası ile sisteme kayıtlı mükellef sorgulaması yapar.
        /// </summary>
        /// <returns>Mükellef Listesi</returns>
        public UserType[] MukellefSorgula(TextModel m, string filterVknTckn, ArrayList sslList)
        {
            try
            {
                ServicePointManager.SecurityProtocol = TlsSetting.TlsSet(sslList); // TLS/SSL ayarları
                WebServisAdresDegistir();
                using (new OperationContextScope(WsClient.InnerChannel))
                {
                    if (WebOperationContext.Current != null)
                    {
                        WebOperationContext.Current.OutgoingRequest.Headers.Add(HttpRequestHeader.Authorization,
                                                                                Authorization.GetAuthorization(m.Kullanici, m.Sifre));
                    }



                    var request = new getUserListRequest
                    {
                        Identifier      = m.GbEtiketi,  //kullanıcı etiketi
                        VKN_TCKN        = m.VknTckn,    //kullanıcı vkn vaya tckn
                        Role            = "PK",         //sorgulanacak GB veya PK etiketi
                        Filter_VKN_TCKN = filterVknTckn // sorgulanacak mükellefin vkn veya tckn si ( Filter_VKN_TCKN--> opsiyoneldir requeste eklenmeyebilir)
                    };
                    return(WsClient.getUserList(request));
                }
            }

            catch (FaultException <ProcessingFault> ex)
            {
                MessageBox.Show(ex.Detail.Message, "ProcessingFault", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(null);
            }
            catch (FaultException ex)
            {
                MessageBox.Show(ex.Message, "FaultException", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(null);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
                return(null);
            }
        }
Ejemplo n.º 13
0
 /// <summary>
 /// Gönderilen faturayı UBL olarak kayıt eder
 /// </summary>
 /// <returns>Gönderilen faturanın binary UBL datası </returns>
 public getSignedInvoiceResponseType FaturaUBLIndir(TextModel m, ArrayList sslList)
 {
     ServicePointManager.SecurityProtocol = TlsSetting.TlsSet(sslList); // TLS/SSL ayarları
     WebServisAdresDegistir();
     using (new OperationContextScope(WsClient.InnerChannel))
     {
         if (WebOperationContext.Current != null)
         {
             WebOperationContext.Current.OutgoingRequest.Headers.Add(HttpRequestHeader.Authorization,
                                                                     Authorization.GetAuthorization(m.Kullanici, m.Sifre));
         }
         var req = new getSignedInvoiceRequestType //UBL datası istenen e-arşiv faturasının request parametrelerini set ediyoruz.
         {
             vkn           = m.VknTckn,            // vkn veya tckn
             UUID          = m.FaturaUUID,         // UBL datası alınacak faturanın UUID si
             invoiceNumber = m.FaturaID            // UBL datası alınacak faturanın ID si
         };
         return(WsClient.getSignedInvoice(req));
     }
 }
Ejemplo n.º 14
0
        /// <summary>
        /// Aşağıdaki metodda Grid üzerindeki gelen veya gönderilen e-irsaliyelerin sadece PDF binary datası alınmaktadır.
        /// Aynı request içerisinde DocDetails alanından max 20 adet olabilir .
        /// Aynı request içerisinde istenirse (gönderilen etiket ve VKN aynı olmak şartıyla) aynı veya farklı UUID lere ait belgelerin HTML, PDF, XSLT, PDF_DEFAULT veya HTML_DEFAULT belgeleride alınabilir.
        /// </summary>
        /// <returns>Grid üzerindeki gelen veya gönderilen e-irsaliyelerin PDF binary datası</returns>
        public getDesViewResponse IrsaliyePDFIndir(TextModel m, string[] UUID, ArrayList sslList, RequestModel reqModel)
        {
            List <GetDesViewRequestType> docDetails = new List <GetDesViewRequestType>();

            ServicePointManager.SecurityProtocol = TlsSetting.TlsSet(sslList);  // TLS/SSL ayarları
            ClientEDespatchServicesPortClient wsClient = new ClientEDespatchServicesPortClient();

            using (new OperationContextScope(wsClient.InnerChannel))
            {
                if (WebOperationContext.Current != null)
                {
                    WebOperationContext.Current.OutgoingRequest.Headers.Add(HttpRequestHeader.Authorization,
                                                                            Authorization.GetAuthorization(m.Kullanici, m.Sifre));
                }

                var req = new getDesViewRequest
                {
                    Identifier = reqModel.Identifier, // Alınacak dosyanın bulunduğu  etiket
                    VKN_TCKN   = m.VknTckn,           // gönderici VKN veya TCKN
                };


                foreach (var item in UUID)
                {
                    var data = new GetDesViewRequestType  //Her requestType da bulunan UUID  aynı veya farklı olabilir.
                    {
                        UUID     = item,                  // datagrid de seçilen irsaliye veya irsaliye yanıtının UUID si
                        Type     = reqModel.DespatchType, // Alınacak dosya gelen ise INBOUND , gönderilen ise OUTBOUND olmalı.
                        DocType  = reqModel.DocType,      // Alınacak dosya irsaliye ise DESPATCH, irsaliye yanıtı ise RECEIPT yazılmalı
                        ViewType = "PDF"                  // Dosyanın tipi HTML ,PDF, XSLT, PDF_DEFAULT veya HTML_DEFAULT olabilir
                    };
                    docDetails.Add(data);
                }

                req.DocDetails = docDetails.ToArray();

                return(wsClient.getDesView(req)); // Yazılan her UUID için istenilen dosya tipinde data dönülür.
            }
        }
Ejemplo n.º 15
0
        /// <summary>
        /// Textbox a girilen TCKN veya VKN numarası ile sisteme kayıtlı mükellef sorgulaması yapar.
        /// </summary>
        /// <returns>Mükellef Listesi</returns
        public getDesUserListResponse MukellefSorgula(TextModel m, ArrayList sslList)
        {
            ServicePointManager.SecurityProtocol = TlsSetting.TlsSet(sslList); // TLS/SSL ayarları
            ClientEDespatchServicesPortClient wsClient = new ClientEDespatchServicesPortClient();

            using (new OperationContextScope(wsClient.InnerChannel))
            {
                if (WebOperationContext.Current != null)
                {
                    WebOperationContext.Current.OutgoingRequest.Headers.Add(HttpRequestHeader.Authorization,
                                                                            Authorization.GetAuthorization(m.Kullanici, m.Sifre));
                }

                var req = new getDesUserListRequest
                {
                    Identifier = m.GbEtiketi, //kullanıcı etiketi
                    VKN_TCKN   = m.VknTckn,   //kullanıcı vkn vaya tckn
                    Role       = "PK"         //sorgulanacak GB veya PK etiketi
                };
                return(wsClient.getDesUserList(req));
            }
        }
Ejemplo n.º 16
0
        /// <summary>
        /// Sisteme gönderilen zarfın statüsünü sorgular
        /// </summary>
        /// <returns>Sisteme gönderilen zarfın statüsü </returns>
        public GetDesEnvelopeStatusResponseType[] ZarfDurumSorgula(TextModel m, string[] envelopeUUID, ArrayList sslList)
        {
            ServicePointManager.SecurityProtocol = TlsSetting.TlsSet(sslList); // TLS/SSL ayarları
            ClientEDespatchServicesPortClient wsClient = new ClientEDespatchServicesPortClient();

            using (new OperationContextScope(wsClient.InnerChannel))
            {
                if (WebOperationContext.Current != null)
                {
                    WebOperationContext.Current.OutgoingRequest.Headers.Add(HttpRequestHeader.Authorization,
                                                                            Authorization.GetAuthorization(m.Kullanici, m.Sifre));
                }

                var req = new getDesEnvelopeStatusRequest
                {
                    Identifier = m.GbEtiketi, // gönderici birim etiketi
                    VKN_TCKN   = m.VknTckn,   // gönderici VKN veya TCKN
                    UUID       = envelopeUUID // zarf UUIDleri
                };
                return(wsClient.getDesEnvelopeStatus(req).Response);
            }
        }
        public sendDocumentResponseType[] ESmmGonder(TextModel m, ArrayList sslList)
        {
            SmmUBL            smm        = new SmmUBL(m.VknTckn);
            var               createdUBL = smm.UBL;                                                                                         // e-Mm fatura UBL i oluşturulur
            UBLBaseSerializer serializer = new SmmSerializer();                                                                             // UBL  XML e dönüştürülür
            var               strFatura  = serializer.GetXmlAsString(createdUBL);                                                           // XML byte tipinden string tipine dönüştürülür

            byte[] zipliFile = ZipUtility.CompressFile(Encoding.UTF8.GetBytes(strFatura), createdUBL.serbestMeslekMakbuz[0].ETTN + ".xml"); // XML  ziplenir
            string hash      = GetHashInfo(zipliFile);                                                                                      // zipli dosyanın hash bilgisi alınır

            ServicePointManager.SecurityProtocol = TlsSetting.TlsSet(sslList);                                                              // TLS/SSL ayarları
            WebServisAdresDegistir();
            using (new OperationContextScope(WsClient.InnerChannel))
            {
                if (WebOperationContext.Current != null)
                {
                    WebOperationContext.Current.OutgoingRequest.Headers.Add(HttpRequestHeader.Authorization,
                                                                            Authorization.GetAuthorization(m.Kullanici, m.Sifre));
                }

                var req = new sendDocumentRequest
                {
                    VKN_TCKN       = m.VknTckn,
                    Branch         = m.Sube,
                    SendDocDetails = new sendDocumentRequestType[]
                    {
                        new sendDocumentRequestType()
                        {
                            UUID    = createdUBL.serbestMeslekMakbuz[0].ETTN,
                            Type    = "SMM",
                            DocType = "XML",
                            DocData = zipliFile,
                        }
                    }
                };
                return(WsClient.sendDocument(req));
            }
        }
Ejemplo n.º 18
0
        /// <summary>
        /// Sisteme gönderilen zarfın statüsünü sorgular
        /// </summary>
        /// <returns>Sisteme gönderilen zarfın statüsü </returns>
        public getEnvelopeStatusResponseType[] ZarfDurumSorgula(TextModel m, string[] zarfUUID, ArrayList sslList)
        {
            ServicePointManager.SecurityProtocol = TlsSetting.TlsSet(sslList);  // TLS/SSL ayarları
            WebServisAdresDegistir();

            using (new OperationContextScope(WsClient.InnerChannel))
            {
                if (WebOperationContext.Current != null)
                {
                    WebOperationContext.Current.OutgoingRequest.Headers.Add(HttpRequestHeader.Authorization,
                                                                            Authorization.GetAuthorization(m.Kullanici, m.Sifre));
                }

                var req = new getEnvelopeStatusRequest //request parametreleri gönderiliyor.
                {
                    Identifier = m.GbEtiketi,          //gönderici birim etiketi
                    VKN_TCKN   = m.VknTckn,            //tckn veya vkn
                    UUID       = zarfUUID              //sisteme gönderilen faturaların zarfUUID leri
                };

                return(WsClient.getEnvelopeStatus(req)); //gönderilen request parametrelerinden geri dönen sonuc
            }
        }
Ejemplo n.º 19
0
        /// <summary>
        /// Grid üzerinden seçilen gelen veya gönderilen faturayı PDF olarak kayıt eder
        /// </summary>
        /// <returns>Grid üzerinden seçilen gelen veya gönderilen faturanın PDF binary datası</returns>
        public getInvoiceViewResponse FaturaPDFIndir(TextModel m, string invUUID, ArrayList sslList)
        {
            ServicePointManager.SecurityProtocol = TlsSetting.TlsSet(sslList);  // TLS/SSL ayarları
            WebServisAdresDegistir();
            using (new OperationContextScope(WsClient.InnerChannel))
            {
                if (WebOperationContext.Current != null)
                {
                    WebOperationContext.Current.OutgoingRequest.Headers.Add(HttpRequestHeader.Authorization,
                                                                            Authorization.GetAuthorization(m.Kullanici, m.Sifre));
                }

                var req = new getInvoiceViewRequest //Faturanın görüntüsünü almak için request parametreleri gönderiyorz.
                {
                    Identifier = m.GbEtiketi,       //gönderici birim etiketi
                    VKN_TCKN   = m.VknTckn,         //tckn veya vkn
                    DocType    = "PDF",             //dosya formatı
                    Type       = "OUTBOUND",        //gelen veya giden fatura türü
                    UUID       = invUUID            //grid üzerinden seçilen faturanın UUID si
                };

                return(WsClient.getInvoiceView(req)); //gönderilen request parametreleri sonucu dönen değer
            }
        }