As a follow-up on Delphi WSDL default importer settings, you can use these compiler defines to increase output.
Output that the built-in Wizard will never show you (that is also the reason you will not see any errors like access violations in the IDE).
TL;DR
Always use the command-line WSDL importer
WSDLImpas it has the same default options as the IDE.
The command-line WSDL importer called WSDLImp does show error messages, but in case of an error still continues writing the wrong .pas file.
Syntax:
"C:\Program Files (x86)\Embarcadero\Studio\19.0\bin\WSDLImp.exe" -DD:\Playground\iECK_ImportWSDL "D:\Playground\iECK DT2.0 services v2.1.1\wsdl\ECK-DT2-CatalogService-v2.1.1.wsdl"
When debugging the code, I found out there are many conditional defines you can enable so it shows more output. Output that greatly helps to pin-point issues while importing more complex WSDL, especially when the WSDL has include or import elements.
These are the defines:
TRACK_MEMORYthis requires theFastMM4unit in the pathSHOW_XML_INFOLOG_TYPES_DUMPLOG_TYPES_LOOKUPLOG_TYPES_READINGLOG_TYPES_SORTINGLOG_TYPES_UNWINDLOG_TYPES_WRITING
The really odd thing is that there is a hidden command-line option -debug which does not automatically enable these, but does use SHOW_XML_INFO which seems enabled by default and writes an output file with extension .xml in addition to .pas, where the XML has an overview of the parsed data types.
I am going to fiddle around to see if I can enable all of the
LOG_entries from the command-line in a simple way.
When you debug the WSDLImp tool, ensure these two directories are on the unit search path:
$(BDS)\source\soap$(BDS)\source\xml
The first is needed so the compiler can find CompVer.inc, the second so you can step through the XML handling code.
Also make sure you change the output path from $(BDS)\bin (which only works under UAC and overwrites the stock output) with something like .\$(Platform)\$(Config) (which puts it along the .DCU files).
–jeroen






