Quantcast
Channel: Delphi – The Wiert Corner – irregular stream of stuff
Viewing all articles
Browse latest Browse all 1440

Delphi WSDL importer compiler defines

$
0
0

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 WSDLImp as 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_MEMORY this requires the FastMM4 unit in the path
  • SHOW_XML_INFO
  • LOG_TYPES_DUMP
  • LOG_TYPES_LOOKUP
  • LOG_TYPES_READING
  • LOG_TYPES_SORTING
  • LOG_TYPES_UNWIND
  • LOG_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


Viewing all articles
Browse latest Browse all 1440

Trending Articles