views:

231

answers:

3

Simple. I created a LINQ-TO-SQL Entity model, created a website, added a Data Service (*.svc) to this site and made sure it works by writing a simple .NET console application. The service works fine and cannot be modified.

Now I'm going to write a Delphi application (2007) for WIN32 which will have to call this data service. And while Delphi has no major problems importing a SOAP service, it can't import this service since it provides no WSDL...

So, two options. I could figure out how to generate a WSDL based on this data service or I'll have to find another way to consume this service. (Or just give up, but I hate to quit this challenge.) So, any advise?

+1  A: 

Maybe you can use the project Jedi "url grabber" components to consume the service. I have managed to get live share data using these in the past. I do not know exactly how your setup works, but maybe these can be helpful.

http://www.delphi-jedi.org/

mm2010
Well, I myself prefer to just import the "winhttp.dll" type library to grab pages from the Web. This too allows stuff like GET, POST, PUT, etc. Another advantage is that this will use the default IE settings to access the internet, so not much worries about proxies and other stuff. I did use Jedi in the past but for some applications, I think it just adds too much overhead. Still, good answer.
Workshop Alex
+1  A: 

ADO.NET Data Services are REST services. They are not SOAP WebServices and I don't think REST uses WSDL. You can call REST services from Delphi using HTTP GET/PUT/POST/DELETE. You could use Indy's TIdHTTPClient. See http://msdn.microsoft.com/en-us/library/cc668786.aspx for url examples. The results are in the Atom format, which is a XML format. You could parse it with TXMLDocument. They can also return JSON.

Lars Truijens
Yeah, that would be the "other way" that I feared.
Workshop Alex
A: 

You should also look at synapse, a small easy to use library which works well with REST. The latest version, which can be downloaded via SVN, works well in Delphi 2009.

skamradt