Как да направим Delphi 6 приложение, което да използва .NET Web Service

Започваме с реализацията на уеб метода на .NET във Visual Studio 2005. За да е съвсем ясно, за пример използвам един доста прост метод, който има за цел да направи log-in и връща като резултат дали потребителят има права.


[WebMethod(EnableSession = true)]

public bool LogIn(string aUserName, string aPassword)
{
bool IsAuthenticated;
// проверка дали дадения потребител се оторизира
….
return IsAuthenticated;
}

Предполагаме, че web service-a вече е качен на IIS/Cassini и е достъпен като http://localhost/test/Service.asmx

В Delphi 6 има wizard, който генерира прокси клас за работа с уеб услуги и той е достъпен от:
File->New->Other->Web Services

Стартира се WSDL Import Wizard-a и в началото се налага да се въведе WSDL кода, който за голяма радост се генерира автоматично от .NET чрез извикване на (за текущия пример):
http://localhost/test/Service.asmx?wsdl

Общо взето тук следва единствено натискане на Finish бутона и в крайна сметка получаваме един хубаво генериран proxy клас за работа с web service-a!

Вече може да поставим THTTPRIO компонентата за работа с web services и да се започне същинската работа.

Едно съвсем просто приложение би изглеждало така:


като настройките на THTTPRIO да показани тук:

И тук идва една малка изненада, тъй като .NET Web Services очакват параметрите си по различен начин отколкото е стандартния за Delphi, поради което е нужно да се добави следния ред в автогенерирания код на прокси класа:

initialization

InvRegistry.RegisterInvokeOptions(TypeInfo(ServiceSoap),ioDocument);

Вече няма проблеми с извикванията на .NET web service-a от Delphi код и се връща правилния резултат!

AI in Finance

I found an interesting site related to Neural Networks and Finance browsing on the Internet the other day. The information is little bit out of date, but it is well structured and up to the point.

There are several sections – Neural Networks, Genetic Algorithms, Simulated Annealing and General optimization. Only the first and the second one are of particular interest for me.
Furthermore every section is divided in some subsections

  • Selected articles
  • References
  • Journals
  • Software
  • Links

Here is the web address:
http://www.geocities.com/francorbusetti/neural.htm

Many pdfs and links to other valuable resources.

I am still reading the information (there is a lot!) and investigating any broken links (so far I have found just a few).

I will post a follow up once I have a definitive idea about the complexity and real value of that site.
The Good news is that, well – there are Neural Networks, there is Finance 🙂
The bad news is that the information is slightly old and the site is no longer actively updated…

Finding “academic” resources on the internet

Finding valuable and quality resources on the Internet is always a problem. If you’re like me – spending hours in front of the computer in order to find just one piece of “good” information than you might be interested in these services provided by two of the largest search engines available.

First of them is called Google Scholar and is maintained by errr… Google and the other one is named Academics and run by Microsoft. Both of them utilize the same idea – find all relevant sources of academic information about a specific subject. Great way to explore articles, publications and reference materials. Unfortunately some of the materials require paid subscription. I was little surprised to find that Yahoo! doesn’t have a similar service (yet?)

Hint: Academics does not work well with Firefox (no big surprise here…)

One last thing I would like to mention, that I use with pleasure – zotero. It is best described with the creator’s own words:

extension to help you collect, manage, and cite your research sources. It lives right where you do your work — in the web browser itself.