Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

Kursna lista NBS

[es] :: Pascal / Delphi / Kylix :: Kursna lista NBS

[ Pregleda: 15387 | Odgovora: 19 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

dbabic
Davor Babić

Član broj: 31834
Poruke: 51
213.253.116.*



+2 Profil

icon Kursna lista NBS06.04.2007. u 09:51 - pre 206 meseci
Jel' može neko napiše demo programčić za skidanje kursne liste sa NBS.
Početnik sam u web servisima pa bi mi to bila velika pomoć.

Unapred hvala
 
Odgovor na temu

Goran Nikolovski
Subotica

Član broj: 15308
Poruke: 247
77.46.226.*

Sajt: goran-nikolovski.blogspot..


+1 Profil

icon Re: Kursna lista NBS06.04.2007. u 19:48 - pre 206 meseci
Pazi ja sam za svoj konvertor valuta to napisao, ali bez ikakvih web servisa. To nije tako lako napisati, zato ako ti treba potrudi se, pa napisi sam ...
 
Odgovor na temu

Srki_82
Srdjan Tot
Me @ My Home
Ljubljana

Član broj: 28226
Poruke: 1403
82.208.201.*

ICQ: 246436949


+10 Profil

icon Re: Kursna lista NBS06.04.2007. u 19:56 - pre 206 meseci
Koliko znam, negde na NBS sajtu imas stranicu koja ti generise CVS, ASCII, i ko zna u kom jos formatu kursnu listu. Samo je pronadji, skini fajl uz pomoc INET API, Indy, JVCL ili neceg treceg, i parsiraj taj fajl. Trebalo bi da bude prilicno lako.
 
Odgovor na temu

Goran Nikolovski
Subotica

Član broj: 15308
Poruke: 247
77.46.226.*

Sajt: goran-nikolovski.blogspot..


+1 Profil

icon Re: Kursna lista NBS06.04.2007. u 23:13 - pre 206 meseci
Imas na stranici http://www.nbs.yu/internet/cirilica/scripts/ondate.html da zatrazis da ti generise kursne liste od 2002 godine. Ja bih ti poslao moj program (deo programa) ali su oni nesto na sajtu menjali pa sada to ne radi, a ja bas i nemam vremena da to popravljam.

Kada sam pravio taj program meni je trebalo nekoliko sati da ga nateram da radi kako treba ali je na kraju radilo. Inace ja sam preuzimao sa sajta kursnu listu u ASCII formatu.
 
Odgovor na temu

dbabic
Davor Babić

Član broj: 31834
Poruke: 51
*.adsl.static.sezampro.yu.



+2 Profil

icon Re: Kursna lista NBS07.04.2007. u 10:41 - pre 206 meseci
Za preuzimanje ASCII fajla sa NBS znam. To radi i nije problem. Mene zanima kako to uraditi upotrebom SOAP-a i WSDL fajla na osnovu kojeg u delfiju možeš napraviti unit sa opisom metoda kojim možeš pristupiti web servisu.
Mene zanimaju baš web servisi, a ovaj WSDL fajl koji su oni dali, ima čini mi se samo metode za autentifikaciju i jednu za preuzimanje trenutno aktuelne kursne liste. Ne bi trebalo da bude nikakav problem nekom ko je radio sa SOAP-om.

WSDL izgleda ovako:
-----------------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://www.nbs.rs/TempExchangeRatesService" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://www.nbs.rs/TempExchangeRatesService" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://www.nbs.rs/TempExchangeRatesService">
<s:element name="GetCurrentExchangeRates">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="nExchangeRatesListTypeID" type="s:decimal" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="GetCurrentExchangeRatesResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="GetCurrentExchangeRatesResult">
<s:complexType>
<s:sequence>
<s:element ref="s:schema" />
<s:any />
</s:sequence>
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="AuthenticationHeader" type="tns:AuthenticationHeader" />
<s:complexType name="AuthenticationHeader">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="UserName" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Password" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="LicenceID" type="s:long" />
</s:sequence>
<s:anyAttribute />
</s:complexType>
<s:element name="GetCurrentExchangeRatesXML">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="nExchangeRatesListTypeID" type="s:decimal" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="GetCurrentExchangeRatesXMLResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="GetCurrentExchangeRatesXMLResult" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</wsdl:types>
<wsdl:message name="GetCurrentExchangeRatesSoapIn">
<wsdl:part name="parameters" element="tns:GetCurrentExchangeRates" />
</wsdl:message>
<wsdl:message name="GetCurrentExchangeRatesSoapOut">
<wsdl:part name="parameters" element="tns:GetCurrentExchangeRatesResponse" />
</wsdl:message>
<wsdl:message name="GetCurrentExchangeRatesAuthenticationHeader">
<wsdl:part name="AuthenticationHeader" element="tns:AuthenticationHeader" />
</wsdl:message>
<wsdl:message name="GetCurrentExchangeRatesXMLSoapIn">
<wsdl:part name="parameters" element="tns:GetCurrentExchangeRatesXML" />
</wsdl:message>
<wsdl:message name="GetCurrentExchangeRatesXMLSoapOut">
<wsdl:part name="parameters" element="tns:GetCurrentExchangeRatesXMLResponse" />
</wsdl:message>
<wsdl:message name="GetCurrentExchangeRatesXMLAuthenticationHeader">
<wsdl:part name="AuthenticationHeader" element="tns:AuthenticationHeader" />
</wsdl:message>
<wsdl:portType name="TempExchangeRatesServiceSoap">
<wsdl:operation name="GetCurrentExchangeRates">
<wsdl:input message="tns:GetCurrentExchangeRatesSoapIn" />
<wsdl:output message="tns:GetCurrentExchangeRatesSoapOut" />
</wsdl:operation>
<wsdl:operation name="GetCurrentExchangeRatesXML">
<wsdl:input message="tns:GetCurrentExchangeRatesXMLSoapIn" />
<wsdl:output message="tns:GetCurrentExchangeRatesXMLSoapOut" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="TempExchangeRatesServiceSoap" type="tns:TempExchangeRatesServiceSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="GetCurrentExchangeRates">
<soap:operation soapAction="http://www.nbs.rs/TempExchange...ervice/GetCurrentExchangeRates" style="document" />
<wsdl:input>
<soap:body use="literal" />
<soap:header message="tns:GetCurrentExchangeRatesAuthenticationHeader" part="AuthenticationHeader" use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="GetCurrentExchangeRatesXML">
<soap:operation soapAction="http://www.nbs.rs/TempExchange...ice/GetCurrentExchangeRatesXML" style="document" />
<wsdl:input>
<soap:body use="literal" />
<soap:header message="tns:GetCurrentExchangeRatesXMLAuthenticationHeader" part="AuthenticationHeader" use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="TempExchangeRatesServiceSoap12" type="tns:TempExchangeRatesServiceSoap">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="GetCurrentExchangeRates">
<soap12:operation soapAction="http://www.nbs.rs/TempExchange...ervice/GetCurrentExchangeRates" style="document" />
<wsdl:input>
<soap12:body use="literal" />
<soap12:header message="tns:GetCurrentExchangeRatesAuthenticationHeader" part="AuthenticationHeader" use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="GetCurrentExchangeRatesXML">
<soap12:operation soapAction="http://www.nbs.rs/TempExchange...ice/GetCurrentExchangeRatesXML" style="document" />
<wsdl:input>
<soap12:body use="literal" />
<soap12:header message="tns:GetCurrentExchangeRatesXMLAuthenticationHeader" part="AuthenticationHeader" use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="TempExchangeRatesService">
<wsdl:port name="TempExchangeRatesServiceSoap" binding="tns:TempExchangeRatesServiceSoap">
<soap:address location="http://webservices.nbs.yu/Comm.../TempExchangeRatesService.asmx" />
</wsdl:port>
<wsdl:port name="TempExchangeRatesServiceSoap12" binding="tns:TempExchangeRatesServiceSoap12">
<soap12:address location="http://webservices.nbs.yu/Comm.../TempExchangeRatesService.asmx" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
-----------------------------------------------------------------
Pozdrav
 
Odgovor na temu

viking13
Aleksandar Milanovic
SBB
Novi Beograd

Član broj: 131741
Poruke: 190
89.216.198.*



Profil

icon Re: Kursna lista NBS07.04.2007. u 20:35 - pre 206 meseci
0. http://www.nbs.yu/export/inter...006_koriscenje_web_servisa.pdf
1. File -> New -> VCL Forms Application - Delphi for Win32
2. File -> New -> Other -> WebServices -> WSDL Importer
3. http://webservices.nbs.yu/Comm...ExchangeRatesService.asmx?WSDL
4. Finish
5. Finish
6. uses TempExchangeRatesService;
7. GetTempExchangeRatesServiceSoap.GetCurrentExchangeRatesXML(1);
8. Enjoy :)


viking ®
 
Odgovor na temu

dbabic
Davor Babić

Član broj: 31834
Poruke: 51
213.253.116.*



+2 Profil

icon Re: Kursna lista NBS09.04.2007. u 10:26 - pre 206 meseci
"GetTempExchangeRatesServiceSoap.GetCurrentExchangeRatesXML(1)"

--Da samo što kao parametar ne može da se prosledi 1. --

Greška:
Incopatible types 'TXSDecimal' and 'integer'
 
Odgovor na temu

inherited
Novi Sad

Član broj: 95516
Poruke: 219
*.exe042.net.



Profil

icon Re: Kursna lista NBS09.04.2007. u 12:09 - pre 206 meseci
Citat:
viking13: 0. http://www.nbs.yu/export/inter...006_koriscenje_web_servisa.pdf
1. File -> New -> VCL Forms Application - Delphi for Win32
2. File -> New -> Other -> WebServices -> WSDL Importer
3. http://webservices.nbs.yu/Comm...ExchangeRatesService.asmx?WSDL
4. Finish
5. Finish
6. uses TempExchangeRatesService;
7. GetTempExchangeRatesServiceSoap.GetCurrentExchangeRatesXML(1);
8. Enjoy :)

Dobro, dobili smo jos taj jedan UNIT. Sta se sada desava?
Kako da skidamo tu kursnu listu i ucitamo je u TDBGrid?
 
Odgovor na temu

viking13
Aleksandar Milanovic
SBB
Novi Beograd

Član broj: 131741
Poruke: 190
89.216.198.*



Profil

icon Re: Kursna lista NBS09.04.2007. u 19:54 - pre 206 meseci
1. Ako traži TXSDecimal, ti mu lepo napravi instancu te klase i podesi joj vrednost.
TXS klase se nalaze u XSBuiltIns unitu.

2. Pošto bi sledeće pitanje sigurno bilo: "A što sad dobijam poruku 'Object reference not set to an instance of an object' i kako da dobijem rezultat?", evo odgovora unapred. U PDF dokumentu piše lepo: "U zaglavlju zahteva (AuthenticationHeader) moraju se proslediti sledeci parametri: UserName, Password, LicenceID". Znači mora da mu se pošalje i header. A samim tim doda i InvokeRegistry unit.

Evo ga jednostavan primer koji dobijeni XML ubaci u Memo (čisto da vidite da cela stvar radi):


Code:

uses
  TempExchangeRatesService, InvokeRegistry, XSBuiltIns;

procedure TForm1.FormCreate(Sender: TObject);
var
   Service: TempExchangeRatesServiceSoap;
   AuthHeader: AuthenticationHeader;
   x: TXSDecimal;
begin
   Service := GetTempExchangeRatesServiceSoap;
   x := TXSDecimal.Create;
   AuthHeader := AuthenticationHeader.Create;
   try
     // eto sad je 1
     x.DecimalString := '1';

     // parametri za pristup iz PDF dokumenta
     AuthHeader.UserName := 'TempTest';
     AuthHeader.Password := 'TempTestPassword';
     AuthHeader.LicenceID := 0;

     // pošalji header (izvrši identifikaciju)
     (Service as ISOAPHeaders).Send(AuthHeader);

     // rezultat metoda GetCurrentExchangeRatesXML stavi u Memo
     Memo1.Lines.Text := Service.GetCurrentExchangeRatesXML(x);
   finally
     AuthHeader.Free;
     x.Free;
     Service := nil;
   end;
end;

viking ®
 
Odgovor na temu

inherited
Novi Sad

Član broj: 95516
Poruke: 219
*.exe042.net.



Profil

icon Re: Kursna lista NBS09.04.2007. u 23:07 - pre 206 meseci
Greska:
Citat:
Server was unable to process request. ---> You are not authorized to use this licence!!!
 
Odgovor na temu

dbabic
Davor Babić

Član broj: 31834
Poruke: 51
213.253.116.*



+2 Profil

icon Re: Kursna lista NBS11.04.2007. u 08:31 - pre 206 meseci
@viking13
Server was unable to process request. ---> You are not authorized to use this licence!!!

 
Odgovor na temu

Miloš Baić
Miloš Baić
ERP (Dynamics NAV) programer
Beograd

Član broj: 72468
Poruke: 1155
*.dialup.neobee.net.



Profil

icon Re: Kursna lista NBS12.04.2007. u 16:07 - pre 206 meseci
I, šta se dešava?!!! Ima li odgovora?
Someone's sitting in the shade today because someone planted a tree a long time ago.
 
Odgovor na temu

viking13
Aleksandar Milanovic
SBB
Novi Beograd

Član broj: 131741
Poruke: 190
89.216.198.*



Profil

icon Re: Kursna lista NBS13.04.2007. u 20:13 - pre 206 meseci
Rezultat primera odozgo izvršen pre nekoliko sekudi:

Citat:

<ExchangeRatesDataSet>
<ExchangeRates>
<ExchangeRateListNumber>70</ExchangeRateListNumber>
<Date>13.04.2007</Date>
<ExchangeRatesListTypeID>1</ExchangeRatesListTypeID>
<CurrencyGroupID>2</CurrencyGroupID>
<CurrencyCode>978</CurrencyCode>
<CurrencyCodeNumChar>978</CurrencyCodeNumChar>
<CurrencyCodeAlfaChar>EUR</CurrencyCodeAlfaChar>
<CountryNameSerLat>Evropska unija</CountryNameSerLat>
<CountryNameEng>European Union</CountryNameEng>
<Unit>1</Unit>
<BuyingRate>80.3631</BuyingRate>
<MiddleRate>80.6049</MiddleRate>
<SellingRate>80.8467</SellingRate>
</ExchangeRates>
...


Apsolutno mi nije jasno kako vam ne radi.

Ajde da probamo još detaljnije

Znači, napraviš novu aplikaciju:
1. File -> New -> VCL Forms Application - Delphi for Win32

Pokreneš WSDL importer:
2. File -> New -> Other -> WebServices -> WSDL Importer

Pastuješ ovo:
3. http://webservices.nbs.yu/Comm...ExchangeRatesService.asmx?WSDL

Klikneš na Finish, pa opet na Finish
4. Finish
5. Finish

Na Form1 dodaš Memo i dva puta klikneš na form.

Prepraviš unit da izgleda ovako:

Code:

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

uses
  TempExchangeRatesService, InvokeRegistry, XSBuiltIns;

procedure TForm1.FormCreate(Sender: TObject);
var
   Service: TempExchangeRatesServiceSoap;
   AuthHeader: AuthenticationHeader;
   x: TXSDecimal;
begin
   Service := GetTempExchangeRatesServiceSoap;
   x := TXSDecimal.Create;
   AuthHeader := AuthenticationHeader.Create;
   try
     // eto sad je 1
     x.DecimalString := '1';

     // parametri za pristup iz PDF dokumenta
     AuthHeader.UserName := 'TempTest';
     AuthHeader.Password := 'TempTestPassword';
     AuthHeader.LicenceID := 0;

     // pošalji header (izvrši identifikaciju)
     (Service as ISOAPHeaders).Send(AuthHeader);

     // rezultat metoda GetCurrentExchangeRatesXML stavi u Memo
     Memo1.Lines.Text := Service.GetCurrentExchangeRatesXML(x);
   finally
     AuthHeader.Free;
     x.Free;
     Service := nil;
   end;
end;

end.


Izvršiš aplikaciju i dobiješ rezultat u memou.
viking ®
 
Odgovor na temu

Miloš Baić
Miloš Baić
ERP (Dynamics NAV) programer
Beograd

Član broj: 72468
Poruke: 1155
*.dialup.neobee.net.



Profil

icon Re: Kursna lista NBS14.04.2007. u 15:56 - pre 206 meseci
Možda je ovo problem?
Citat:
You are not authorized to view this page
The Web server you are attempting to reach has a list of IP addresses that are not allowed to access the Web site, and the IP address of your browsing computer is on this list.

Please try the following:

* Contact the Web site administrator if you believe you should be able to view this directory or page.

HTTP Error 403.6 - Forbidden: IP address of the client has been rejected.
Internet Information Services (IIS)

Someone's sitting in the shade today because someone planted a tree a long time ago.
 
Odgovor na temu

dudasel

Član broj: 184115
Poruke: 1
77.46.167.*



Profil

icon Re: Kursna lista NBS16.06.2008. u 10:22 - pre 192 meseci
Aleksandre meni nikako da proradi skidanje kursne liste preko NBS pa sam hteo da ti pošaljem kod da ti možda pogledaš u čemu je problem. Ako možeš da mi pomogneš pošalji mi mail na [email protected]
Pozdrav
 
Odgovor na temu

rick_hunter
rick hunter

Član broj: 178288
Poruke: 10
*.eunet.rs.



Profil

icon Re: Kursna lista NBS08.09.2008. u 00:03 - pre 189 meseci
Na primer kad dobijem rezultat u memo

<ExchangeRatesDataSet>
<ExchangeRates>
<ExchangeRateListNumber>171</ExchangeRateListNumber
<ExchangeRatesDataSet>
<ExchangeRates>
<ExchangeRateListNumber>171</ExchangeRateListNumber>
<Date>05.09.2008</Date>
<ExchangeRatesListTypeID>1</ExchangeRatesListTypeID>
<CurrencyGroupID>2</CurrencyGroupID>
<CurrencyCode>978</CurrencyCode>
<CurrencyCodeNumChar>978</CurrencyCodeNumChar>
<CurrencyCodeAlfaChar>EUR</CurrencyCodeAlfaChar>
<CountryNameSerLat>Evropska unija</CountryNameSerLat>
<CountryNameEng>European Union</CountryNameEng>
<Unit>1</Unit>
<BuyingRate>76.5851</BuyingRate>
<MiddleRate>0.0000</MiddleRate>
<SellingRate>77.0459</SellingRate>
</ExchangeRates>
...

kako da procitam vrednost valute to jest kako da procitam vrednost sa taga <BuyingRate>?

Pokušavao sam da to sve usnimam kao xml pa preko kontrole XMLDocument procitam ali nikako, non stop prijavljuje da je xml sintaksa neispravna.

 
Odgovor na temu

obucina

Član broj: 38191
Poruke: 723

Jabber: obucina


+7 Profil

icon Re: Kursna lista NBS08.09.2008. u 15:51 - pre 189 meseci
I meni javlja "Server was unable to process request. ---> You are not authorized to use this licence!!!"
 
Odgovor na temu

viking13
Aleksandar Milanovic
SBB
Novi Beograd

Član broj: 131741
Poruke: 190
*.dynamic.sbb.rs.



Profil

icon Re: Kursna lista NBS08.09.2008. u 20:53 - pre 189 meseci
Dotični servis mi nikada nije trebao i nikada ga nisam koristio za sopstvene potrebe.

Jedini put kada sam ga koristio je bio kad sam vama ovde napisao kako da ga koristite i ja tada nisam imao nikakve probleme sa njim.

Imam sveže reinstaliran laptop bez instaliranog Delphija, pa ne mogu da probam. Probaću za vikend da vidim šta se sada dešava, ali ne očekujem da se nešto značajno promenilo.

Meni se čini da vi sa problemom sa autorizacijom koristite malo stariji delphi, recimo D7. Ili grešim?

viking ®
 
Odgovor na temu

obucina

Član broj: 38191
Poruke: 723

Jabber: obucina


+7 Profil

icon Re: Kursna lista NBS09.09.2008. u 00:14 - pre 189 meseci
Da, sa D7 ima greske, sa D11 nema greske.
 
Odgovor na temu

Hasimbegovic

Član broj: 20360
Poruke: 265
*.dynamic.isp.telekom.rs.



+3 Profil

icon Re: Kursna lista NBS25.12.2010. u 16:32 - pre 161 meseci
Bilo bi lepo da neko uploaduje novi kod za kusnu listu nakon izmena koje je uradila NBS ? Stari odavno vise ne radi...
 
Odgovor na temu

[es] :: Pascal / Delphi / Kylix :: Kursna lista NBS

[ Pregleda: 15387 | Odgovora: 19 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.