-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Token alınamıyor. #8
Comments
aynı hatayı bende alıyrum. son bir haftadır. |
Çözdüm. Benim repodan kullanabilirsiniz. |
hala token alamıyor |
Benim repodan indirip kullanırsanız çalışıyor. Ne hata alıyorsunuz? |
Ahmet Bey, iyi akşamlar öncelikle ilginiz için teşekkür ederim. Ben sizin projeden kurdum referanslarımı ancak yine token alamadım. Özellikle
|
Ben console uygulamasından kütüphaneyi kullandım çalıştı. Unit test yazıyorsunuz galiba. XUnit’le ilgili ne olduğunu tam anlayamadım. Denemem lazım. Ayrıca ben kendim özel olarak yazdığım kodlarda da aynı sorunu yaşamıştım. Önce RestClient ile geçici olarak çözdüm. Daha sonra sorunun HttpClient.DefaultRequestHeaders’a user-agent eklenmemesinden olduğunu anladım. Kendi kodlarımı da düzelttim. Hepsi çalışıyor. “Test” yazan kısmı "Prod" olarak değiştirmenize gerek yok. Sadece user-agent gönderilsin diye o şekilde girdim. Önemli olan user-agent gönderilmesi. Başka user-agent da girebilirsiniz. Sonuç olarak Timeout hatası almıyorsunuz. |
Aslında Ahmet Bey token aldığını farkettim bir şekilde şu ekran görüntüsündende anlaşılacağı gibi asenkron Login fonksiyonu nesneden Tokeni geri değer döndürmüyor sanırım neden bilmiyorum ekran görüntüsüne bir göz atabilme şansınız var mı?
|
|
Geç oldu kusura bakmayın. Konsol uygulamasından e-arsiv-fatura-dotnet projesini referans olarak tanımladıktan sonra aşağıdaki kodlarla token alıp userdata görüntüleyebiliyorum. Login fonksiyonu token geri döndürmese diğer fonksiyonlar çalışmaz zaten. https://github.com/ahmetaksoy1985/e-arsiv-fatura-dotnet `// See https://aka.ms/new-console-template for more information var configuration = FaturaServiceConfigurationFactory.Create(); FaturaService faturaService = new(configuration); faturaService.GetToken().Wait(); var userdata = faturaService.GetUserData().GetAwaiter().GetResult();` |
@ahmetaksoy1985 Ahmet Bey merhaba birşey soracaktım size ben anca projeye geri dönebildim, bu defa charset problemiyle karşılaştım. Örneğin fatura nesnesi oluştururken name alanına "Orçun" girdiğimde "Orçun" olarak faturaya taşınıyor |
Düzeltebildiniz mi? HttpServices.cs dosyasını değiştirmişsiniz. Ben aktif olarak kullanmıyorum kodları. Benim kendi yazdığım kodlar vardı onları kullanıyorum. Bugün deneyip dönerim size. |
HttpServices.cs Dosyasını düzelttim ama sonuç alamadım maalesef :( Sizi de böyle uğraştırıyorum yardımlarınız için tekrar teşekkürler hocam. Birde e-posta adresinizi alabilir miyim? iletmek istediğim bir konu varda... |
Tamam. Ben düzeltirim bugün. Benim daha önceden kendi yazdığım kodlar çalışıyor. Aktif olarak kullanıyorum. Bu kodları tam anlamıyla test etme şansım olmamıştı. |
Düzelttim. Json Türkçe karakter olmadan Post etmek gerekiyor. System.Text.Json ile yazmıştım kendi kodlarımı. Otomatik olarak Türkçe karakterleri escapeliyor. Newtonsoft ise Türkçe karakterleri de içeriyor. Bu repo Newtonsoft kullanıyor diye ona uygun olarak kullandım. |
Mail adresim gmail.
|
@ahmetaksoy1985 çok teşekkürler ederim yardımlarınız için 🙏 epostam ulaştı mı size Ahmet Bey |
Ulaştı. Çok teşekkür ederim. |
GetRecipientDataByTaxIDOrTRID düzelttim. https://github.com/ahmetaksoy1985/e-arsiv-fatura-dotnet `var configuration = FaturaServiceConfigurationFactory.Create(); var response = await faturaService.GetRecipientDataByTaxIDOrTRID(taxId); if(response is GIBResponseModel) |
Ahmet Bey özür dilerim çok başınızı ağrıttım RecipientModel i güncelledim
ama yapamadım bu kod yine hata verdi; neyi yanlış yaptım acaba?
var configuration = FaturaServiceConfigurationFactory.Create();
configuration.ServiceType = ServiceType.Prod;
configuration.Username = "------";
configuration.Password = "------";
FaturaService faturaService = new(configuration);
long taxId = long.Parse(vergikimlik.Text);
await faturaService.GetToken();
GIBResponseModel<List<RecipientModel>> response = await
faturaService.GetRecipientDataByTaxIDOrTRID(taxId);
List<RecipientModel> recipients = response.data;
foreach (RecipientModel recipient in recipients)
{
adi.Text = recipient.adi;
soyadi.Text = recipient.soyadi;
unvan.Text = recipient.unvan;
vergidairesi.Text = recipient.vergiDairesi;
}
Orçun DİYARBAKIRLI
ahmetaksoy1985 ***@***.***>, 4 Haz 2023 Paz, 19:07 tarihinde
şunu yazdı:
… GetRecipientDataByTaxIDOrTRID düzelttim.
https://github.com/ahmetaksoy1985/e-arsiv-fatura-dotnet
`var configuration = FaturaServiceConfigurationFactory.Create();
configuration.ServiceType = ServiceType.Prod;
configuration.Username = "";
configuration.Password = "";
FaturaService faturaService = new(configuration);
long taxId = long.Parse("");
await faturaService.GetToken();
var response = await faturaService.GetRecipientDataByTaxIDOrTRID(taxId);
if(response is GIBResponseModel)
{
RecipientModel recipient = response.data;
var unvan = recipient.unvan;
var adi = recipient.adi;
var soyadi = recipient.soyadi;
var vergiDairesi = recipient.vergiDairesi;
}
`
—
Reply to this email directly, view it on GitHub
<#8 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A2JOTDGNCX6YDZ2DCG6Y6U3XJSXF3ANCNFSM6AAAAAAXAVUP4Q>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Sizin kodlar çalışmaz. List olmayacak. O yüzden foreach de olmayacak. Benim kodları kullanın. Üstte gönderdim. |
var configuration = FaturaServiceConfigurationFactory.Create();
configuration.ServiceType = ServiceType.Prod;
configuration.Username = "-----";
configuration.Password = "----";
FaturaService faturaService = new(configuration);
long taxId = long.Parse(vergikimlik.Text);
await faturaService.GetToken();
var response = await
faturaService.GetRecipientDataByTaxIDOrTRID(taxId);
if (response is GIBResponseModel)
{
RecipientModel recipient = response.data;
var unvan = recipient.unvan;
var adi = recipient.adi;
var soyadi = recipient.soyadi;
var vergiDairesi = recipient.vergiDairesi;
}
Ahmet Bey :( bu kodları derleyemedim ama hata verdi
https://github.com/Orcunary/BFY.Fatura/blob/master/faturaOlustur/Form1.cs
button2_Click olayına bakabilir misiniz?
Önem Derecesi Kod Açıklama Proje Dosya Çizgi Gizleme Durumu
Hata CS0305 Genel tür 'GIBResponseModel<T>' kullanmak için 1 türü bağımsız
değişkenler gerekir
Orçun DİYARBAKIRLI
ahmetaksoy1985 ***@***.***>, 4 Haz 2023 Paz, 20:23 tarihinde
şunu yazdı:
… Sizin kodlar çalışmaz. List olmayacak. O yüzden foreach de olmayacak.
Benim kodları kullanın. Üstte gönderdim.
—
Reply to this email directly, view it on GitHub
<#8 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A2JOTDBFSVA3J65LAGQJLTLXJS777ANCNFSM6AAAAAAXAVUP4Q>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Bir de
var response = faturaService.CreateInvoiceAndGetHTML(nesne, false);
using (var client = new WebClient())
{
client.DownloadFile(faturaService.GetDownloadURL(response.Result.data,
false), "a.html");
}
bu doğru bir kullanım olur mu ?
Orçun DİYARBAKIRLI
Orçun Diyarbakırlı ***@***.***>, 4 Haz 2023 Paz, 20:55
tarihinde şunu yazdı:
…
var configuration = FaturaServiceConfigurationFactory.Create();
configuration.ServiceType = ServiceType.Prod;
configuration.Username = "-----";
configuration.Password = "----";
FaturaService faturaService = new(configuration);
long taxId = long.Parse(vergikimlik.Text);
await faturaService.GetToken();
var response = await
faturaService.GetRecipientDataByTaxIDOrTRID(taxId);
if (response is GIBResponseModel)
{
RecipientModel recipient = response.data;
var unvan = recipient.unvan;
var adi = recipient.adi;
var soyadi = recipient.soyadi;
var vergiDairesi = recipient.vergiDairesi;
}
Ahmet Bey :( bu kodları derleyemedim ama hata verdi
https://github.com/Orcunary/BFY.Fatura/blob/master/faturaOlustur/Form1.cs
button2_Click olayına bakabilir misiniz?
Önem Derecesi Kod Açıklama Proje Dosya Çizgi Gizleme Durumu
Hata CS0305 Genel tür 'GIBResponseModel<T>' kullanmak için 1 türü bağımsız
değişkenler gerekir
Orçun DİYARBAKIRLI
ahmetaksoy1985 ***@***.***>, 4 Haz 2023 Paz, 20:23
tarihinde şunu yazdı:
> Sizin kodlar çalışmaz. List olmayacak. O yüzden foreach de olmayacak.
> Benim kodları kullanın. Üstte gönderdim.
>
> —
> Reply to this email directly, view it on GitHub
> <#8 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/A2JOTDBFSVA3J65LAGQJLTLXJS777ANCNFSM6AAAAAAXAVUP4Q>
> .
> You are receiving this because you commented.Message ID:
> ***@***.***>
>
|
Aşağıdaki gibi olacaktı. Düzeltmeyi unutmuşum. Konsol uygulamasında denemiştim. `if(response is GIBResponseModel) RecipientModel recipient = response.data; |
if(response is GIBResponseModel)
GIBResponseModel yine t değişkeni istiyor derlemiyor
Orçun DİYARBAKIRLI
ahmetaksoy1985 ***@***.***>, 4 Haz 2023 Paz, 21:02 tarihinde
şunu yazdı:
… Aşağıdaki gibi olacaktı. Düzeltmeyi unutmuşum. Konsol uygulamasında
denemiştim.
if(response is GIBResponseModel) { RecipientModel recipient =
response.data; unvan.Text = recipient.unvan; adi.Text = recipient.adi;
soyadi.Text = recipient.soyadi; vergidairesi.Text = recipient.vergiDairesi;
}
—
Reply to this email directly, view it on GitHub
<#8 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A2JOTDG4LLHK4G72AOIOTZDXJTESPANCNFSM6AAAAAAXAVUP4Q>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Webclient sınıfı deprecated. Ben size kendi yazdığım kodları gönderirim. |
Kodları güncelledim. Tekrar aldınız mı? Kodlar çalışıyor. Ben konsol uygulamasında denedim. |
Birkaç gün beklerseniz sizin kodları düzenlerim. Çok güzel olur. |
Tamam Ahmet bey,beklerim tabi çok teşekkür ederim.
4 Haz 2023 Pzr 22:24 tarihinde ahmetaksoy1985 ***@***.***>
şunu yazdı:
… Birkaç gün beklerseniz sizin kodları düzenlerim. Çok güzel olur.
—
Reply to this email directly, view it on GitHub
<#8 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A2JOTDDCWEGQLKGWCVUV2HDXJTOIRANCNFSM6AAAAAAXAVUP4Q>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Şöyle bir fonksiyon yazmışım. faturaService.GetDownloadURL(response.Result.data, Üstten gelen stringi uri olarak girip outputFolderPath kısmına da klasörü belirtirseniz. Zip dosyasını da açıp indirir. public static async Task DownloadExtractZipFileAsync(string uri, string outputFolderPath) |
Orçun Bey çok teşekkürler ederim helvalar için. Bayıldım. Ellerinize sağlık. Düzelttim. Prod olarak giriş yaparsanız firma bilgilerini çekiyor. SMS onaylama ve faturayı görüntüleme kısmını yapacağım. Login kısmını her click olayı yerine 1 kere yaparsanız daha iyi olur. Onun içinde ayrı Login Form'u yapmayı düşünüyorum. Tek bir form içinde olsun derseniz en üste login için button koyabiliriz. Bir de üstteki combobox’ları tam olarak nasıl kullanmak istiyorsunuz. Ben sql ile firma bilgilerini çekip combobox ile listeliyorum. |
Ahmet Bey afiyet olsun :) Çok teşekkür ederim hocam bende henüz deneme fırsatı bulamadım login için bende o tarz bir form düşünmüştüm doğrusu. Combobox larda insanların ünvanları ve kullanıcı şifre bilgileri yer alacak, aynı form üzerinden comboxta seçili ünvan için yanş birden fazla ünvan ve şifre bilgisi ile fatura kesilebilecek. |
Şimdi anladım Orçun Bey 2 tane Combobox olmasını. Şöyle yapabiliriz. Login formunda kullanıcı bilgisi ve şifre girilirken otomatik login seçeneği seçilirse direk fatura kesme formu açılır her başlatmada. Logout buttonuna basınca tekrar login formu açılır. Login olduğunuzda ise firma bilgisini siteden çekip gösteririz. |
The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing.
The text was updated successfully, but these errors were encountered: