TC NO Doğrulama (Web Servis)
#31
SoapToolkit'ten nefret ettim Wink Vb.net üzerinde aynı yöntemi denedim(soap toolkit), kod yazımı ve denetimi daha kolay diye ve tarih hatasını ben de aşamadım ama projeye webservisi referans olarak ekleyince gayet güzel çalışıyor.. (Access'e değil vb.net projesine) Ama Access için de .net üzerinde bir comclass oluşturulup kullanılabilir.

Çalışmayan:

vb.net
  1. Dim soap As New MSSOAPLib30.SoapClient30
  2. soap.MSSoapInit("http://dbs.epdk.org.tr/EPDKPetrolWS/EPDKPetrol.asmx?WSDL")
  3.  
  4.  
  5. Dim listem = soap.PetrolPiyasasiEnYuksekHacimliSekizFirmaninAkaryakitFiyatlari("2014/7/7")





Çalışan:

vb.net
  1. Dim soap As New ServiceReference1.EPDKPetrolPiyasasiWebHizmetleriSoapClient
  2.  
  3. Dim listem = soap.PetrolPiyasasiEnYuksekHacimliSekizFirmaninAkaryakitFiyatlari("2014/7/7")





  Alıntı
Bu mesajı beğenenler:
#32
"Soap Library", 64 bit office de çalışmıyor.

"GET" ve "POST" arasında hissedilemeyecek düzeyde hız farkı vardır.

Alternatif yöntemler...

Visual Basic
  1. Option Explicit
  2.  
  3. Sub test1()
  4. ' POST metodu
  5. Dim http As Object, trh As String, url As String, txt As String, istek As String
  6.  
  7. istek = _
  8. "<?xml version=""1.0"" encoding=""utf-8""?>" & _
  9. "<soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"">" & _
  10. " <soap:Body>" & _
  11. " <LpgPiyasasiEnYuksekHacimliSekizFirmaninOrtalamaLpgFiyatlari xmlns=""http://dbs.epdk.org.tr/EPDKLpgWS/"">" & _
  12. " <Tarih>@tarih@</Tarih>" & _
  13. " </LpgPiyasasiEnYuksekHacimliSekizFirmaninOrtalamaLpgFiyatlari>" & _
  14. " </soap:Body>" & _
  15. "</soap:Envelope>"
  16.  
  17. Set http = CreateObject("msxml2.xmlhttp")
  18.  
  19. trh = "2014-07-09" ' yyyy-mm-dd
  20.  
  21. url = "http://dbs.epdk.org.tr/EPDKLpgWS/EPDKLpg.asmx?op=LpgPiyasasiEnYuksekHacimliSekizFirmaninOrtalamaLpgFiyatlari"
  22.  
  23. http.Open "post", url, False
  24. http.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
  25.  
  26. http.send Replace(istek, "@tarih@", trh)
  27.  
  28. txt = http.responsetext
  29.  
  30. Debug.Print txt
  31.  
  32. http.abort
  33.  
  34. Set http = Nothing
  35. End Sub
  36.  
  37. Sub test2()
  38. ' GET metodu (test1 in "get" metodu. Ayrıca dönen xml girintili olarak gelir.)
  39. Dim http As Object, trh As String, url As String, txt As String
  40.  
  41. Set http = CreateObject("msxml2.xmlhttp")
  42.  
  43. trh = "2014/07/09" ' yyyy/mm/dd
  44.  
  45. url = "http://dbs.epdk.org.tr/EPDKLpgWS/EPDKLpg.asmx" & _
  46. "/LpgPiyasasiEnYuksekHacimliSekizFirmaninOrtalamaLpgFiyatlari?Tarih=" & trh
  47.  
  48. http.Open "get", url, False
  49.  
  50. http.send
  51.  
  52. txt = http.responsetext
  53.  
  54. Debug.Print txt
  55.  
  56. http.abort
  57.  
  58. Set http = Nothing
  59. End Sub
  60.  
  61. Sub test3()
  62. ' POST metodu
  63. Dim http As Object, trh As String, url As String, txt As String
  64. Dim plk As String, m As Variant, istek As String
  65.  
  66. istek = _
  67. "<?xml version=""1.0"" encoding=""utf-8""?>" & _
  68. "<soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"">" & _
  69. " <soap:Body>" & _
  70. " <LpgPiyasasiIllereGoreLpgFiyatlari xmlns=""http://dbs.epdk.org.tr/EPDKLpgWS/"">" & _
  71. " <GecerliTarih>@tarih@</GecerliTarih>" & _
  72. " <TrafikKodu>@plaka@</TrafikKodu>" & _
  73. " </LpgPiyasasiIllereGoreLpgFiyatlari>" & _
  74. " </soap:Body>" & _
  75. "</soap:Envelope>"
  76.  
  77. Set http = CreateObject("msxml2.xmlhttp")
  78.  
  79. trh = "2014-07-09" ' yyyy-mm-dd
  80. plk = "54" ' Sakarya
  81.  
  82. url = "http://dbs.epdk.org.tr/EPDKLpgWS/EPDKLpg.asmx?op=LpgPiyasasiIllereGoreLpgFiyatlari"
  83.  
  84. http.Open "post", url, False
  85. http.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
  86.  
  87. m = Replace(istek, "@tarih@", trh)
  88. m = Replace(m, "@plaka@", plk)
  89.  
  90. http.send m
  91.  
  92. txt = http.responsetext
  93.  
  94. Debug.Print txt
  95.  
  96. http.abort
  97.  
  98. Set http = Nothing
  99. End Sub
  100.  
  101. Sub test4()
  102. ' GET metodu (test3 ün "get" metodu. Ayrıca dönen xml girintili olarak gelir.)
  103. Dim http As Object, trh As String, url As String, txt As String, plk As String
  104.  
  105. Set http = CreateObject("msxml2.xmlhttp")
  106.  
  107. trh = "2014/07/09" ' yyyy/mm/dd
  108. plk = 54 ' Sakarya
  109.  
  110. url = "http://dbs.epdk.org.tr/EPDKLpgWS/EPDKLpg.asmx/" & _
  111. "LpgPiyasasiIllereGoreLpgFiyatlari?GecerliTarih=" & trh & "&TrafikKodu=" & plk
  112.  
  113. http.Open "get", url, False
  114.  
  115. http.send
  116.  
  117. txt = http.responsetext
  118.  
  119. Debug.Print txt
  120.  
  121. http.abort
  122.  
  123. Set http = Nothing
  124. End Sub





  Alıntı
Bu mesajı beğenenler:
#33
Zeki aynı yöntemlerle ben de bir çalışma yapmıştım daha önce hatta eski konularımda var ama bana çok eziyetli geliyor. Tabii Access için soap library ile almak çok daha basit ama yine de yaptığın bence her yönden daha iyi çözüm. Access ile ya da VBA diyelim zaten mazoşist olmadıkça pek bi şey yapılamıyor.



  Alıntı
Bu mesajı beğenenler:
#34
Berkant, ben her zaman kolay olmasından ziyade, her pc de sorunsuz çalışabilen algoritma kullanmayı tercih ederim. Bu açıdan mazoşist olduğum söylenebilir. Wink eheheh

Doğrusunu söylemek gerekirse, çok basit kullanımı olduğu halde bi türlü sevemedim "sabun" library' i. Önyargı işte... Smile


Bu arada, önerdiğin "wireshark" ile istediğimi elde ettim. Çok teşekkürler Berkant.



  Alıntı
Bu mesajı beğenenler:


Benzer Konular...
Konu: Yazar Cevaplar: Gösterim: Son Mesaj
  ArBeSis Servis Takip Programı HaCKeRKaN 8 6.101 05-01-2022, 08:43
Son Mesaj: onur_can
  Teknik Servis Programı Basit.. ibrahim.kut 8 5.485 21-07-2020, 20:09
Son Mesaj: ginzu-
  ETAEL Araç Takip (Personel Servis Taşımacılığı Uygulaması) devilspath 22 11.778 21-12-2019, 18:42
Son Mesaj: desifre16
  Bilgisayar Teknik Servis Takip Programı mybil 19 49.276 06-06-2016, 12:50
Son Mesaj: onrcnisk
  SERVİS PUANTAJ UYGULAMASI seneraky_78 1 2.197 31-12-2015, 00:45
Son Mesaj: hturkavci03
  teknik servis takip veri tabanı dayday 27 32.427 30-04-2015, 11:31
Son Mesaj: artvin08

Foruma Git:


Bu konuyu görüntüleyen kullanıcı(lar): 1 Ziyaretçi