The Delphi WSDL importer maintenance has been in dormant mode for a long while, which means it still barfs on WSDL include
directives.
In the day and age of REST and gRPC, I don’t think it will get any love soon.
Related bug entries are for instance RSP-18630: WSDL generate bad code and RSP-17321: “Import WSDL” generates invalid code without explanation of problem are examples of this, and I’m sure that QC had more if it were still alive; I could find these in the WayBack machine:
- [WayBack] QualityCentral 5490: Types not generated properly when wsdl contains multiple namespaces
- [WayBack] QualityCentral 53643: WSDL importer fails to import schemas in XSD files namespace
The problem manifests itself when the WSDL file includes one or more XSD files. The generated code will contain a section like this:
// ************************************************************************ // // The following types, referred to in the WSDL document are not being represented // in this file. They are either aliases[@] of other types represented or were referred // to but never[!] declared in the document. The types from the latter category // typically map to predefined/known XML or Embarcadero types; however, they could also // indicate incorrect WSDL documents that failed to declare or import a schema type. // ************************************************************************ //
Further below is a series of commented out types, all starting with a !
end ending in a column with the namespace of those types.
Searching for the first line gives numerous examples as far back as Delphi 7, for instance:
- [WayBack] delphi – How to fix unresolved types when importing Exchange Web Services (EWS) wsdl file? – Stack Overflow
- [WayBack] Types in wsdl not imported – Google Groups
- [WayBack] Trouble with Delphi 7 – delphi
- [WayBack] HELP: Delphi als WEB-Server WSDL als style=document statt RPC – Delphi-PRAXiS
- [WayBack] web services – Delphi SOAP Server – Document/Literal – Possible? – Stack Overflow
- [WayBack] Bing Maps in Delphi
- [WayBack] Alternatief voor request sturen naar webservice
Based on those, I think the reason is that the WSDL importer fails on <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
which is quite common in the real world.
I did not want to pursue manually modifying the WSDL file, or manually generating the types as the WSDL and XSD files were prone to changes and manual steps would make the re-import process more tedious. If you do want to do that, these link might help:
- [WayBack] delphi – What tool can I use to merge wsdl and xsd file? – Stack Overflow
- [WayBack] web services – WSDL import issue in delphi – Stack Overflow
This is what I used to get this to compile and run [WayBack] Web Service Toolkit – Free Pascal wiki:
- [WayBack] webservicetoolkitforfpc&lazarus – Inoussa OUEDRAOGO
- [Wayback] sites.google.com/site/inoussa12/wst-0.7u.zip?attredirects=0
- [WayBack] Free Pascal – Download
- Source (especially for the RTL files which are not part of the binary installation) from either
Build steps
FPC installation
- Run the 32-bit installer
- Keep all options except on the second install screen, disable
Associate .inc files with FreePascal IDE
- Add
C:\FPC\3.0.4\bin\i386-win32
to the user path
Building
- Recursively unzip wst-0.7u.zip
- Open a command prompt in the
wst-0.7u
directory - Verify there is a
ws_helper
subdirectory - …
- …
- …
- …
When compiling in Delphi, then you definitely need the FreePascal RTL sources for the PasTree
unit; see [WayBack] fcl-passrc – Free Pascal wiki.
Related:
- [WayBack] What about webservice client?
- [WayBack] Developing with Objective Pascal – Part 11: Using Web Services
–jeroen