Introduction
Web Services have been designed for interoperability, so you would expect that clients and servers created using different tools interoperate smoothly. In reality it's far from being that simple. Multiple and evolving standards and features created the situation where no two systems are the same. It led to creation of Web Services Interoperability Organization with the purpose to establish best practices for interoperability for select group of standards. Further information can be found at http://www.ws-i.orgWS-I Basic Profile
As the name suggests,WS-I Basic Profile defines minimal set of standards a Web Service should support. Unfortunately, the Basic Profile specification has number of versions which are not necessarily interoperable. For example, system compliant with WS-I version 1.0 might not be able to interoperate with a system compliant with WS-I version 2.0.Windows Communication Foundation supports WS-I with BasicHttpBinding which conforms to WS-I version 1.1. Basically, it means compliance with SOAP 1.1, WSDL 1.2 and UDDI 2.0. It is also understood that internet standards like XML Schema, SSL, X.509 etc are also supported.
Delphi client
Although Delphi introduced support for Web Services early, it doesn't have many advanced features and interoperability with Web Services created with other systems has always been limited. It's getting better with every new version of Delphi, though.
It's fairly easy to consume WCF service configured to use BasicHttpBinding. Let's use Interoperable Web Service Demo at http://aspspider.info/burzyn/echoservice.svc as an example. The WSDL document can be generated using the following link http://aspspider.info/burzyn/echoservice.svc?WSDL
To import the Echo Service into a Delphi project select File | New | Others | WebServices | WSDL Importer and paste http://aspspider.info/burzyn/echoservice.svc?WSDL into the WSDL Source.
Also in Delphi XE2 or newer, there's a new option in the Components menu, which is an alternative way to import WSDL. Use Components | Import WSDL to create a unit to be shared by multiple projects.
WSDL document generated from WCF service usually contains two file, the main file and the second file referenced by using the following line.
<wsdl:import location="http://aspspider.info/Burzyn/EchoService.svc?wsdl=wsdl0"/>
Hi Kris,
ReplyDeleteI'm trying to consume a WCF service using Delphi 2007. I followed your suggestion to use ?singleWSDL link. It works fine on my development machine, although Service Application targets .NET Framework v4.0. It doesn't work when I deploy the application on a server.
Any clues?
Hi Mick,
DeleteNice to hear form you.
Note that .NET Framework v4.5 is basically an extension of v4.0 (as .NET Framework v3.0 and v3.5 are extensions of v2.0). It replaces some system assemblies providing new and improved functionality. I gather you need v4.5 on a deployment machine to take advantage of "?singleWSDL" path.
Hi Kris,
ReplyDeleteHave you tried to connect to WCF RESTfull services using Delphi?
Hi Christophe,
DeleteI haven't tried yet, but I expect it should work. I added webHttpBinding to aspspider.info/burzyn/echoservice.svc, so you can use as a test. Of course, you can also use browser with queries like: http://aspspider.info/burzyn/echoservice.svc/web/echostring?value=test
Cheers
Merci Kris,
DeleteLet me give it try.
We can discuss it over the dinner at La Campanile next time you come to my neck of wood.