Web service null value for type Int64

I am using a web service with a numeric element. Importer Delphi wsdl installs it as Int64.

The web service allows this item to be empty. However, since it is defined as Int64, when I use a web service in Delphi without setting a value for it, it defaults to 0 because it is Int64. But I need it to be empty, and the web service does not take the value 0 (0 is defined as invalid and returns an error with the web service).

How to pass empty value if type is Int64?

+7
source share
1 answer

Empty age (example)

<E06_14></E06_14> 

may be of particular importance, for example, "unknown" age.

In this case, the real question is how to make the field indispensable on the Delphi side.

From this post, J. M. Babe:

Support for "nil" has been an ongoing issue. Several built-in Delphi types are not NULL. Therefore, we decided to use the class for these cases (not elegant, but it works). So, with the latest update for Delphi 2007, I added several types of TXSxxxx to help with this. Basically: TXSBoolean, TXSInteger, TXSLong, etc. TXSString was already there, but it was not registered. Now this. When importing WSDL, you must enable the Use 'TXSString for simple nillable types' option to make the importer switch to TXSxxxx types. On the command line, this is the "-0z +" option.

The DocWiki for the WSDL Import Wizard also shows two parameters associated with items that are not sized:

  • Process raw and optional items . Set this parameter to force the WSDL importer to generate relevant information about optional and uncoated properties. This information is used by the SOAP environment so that certain properties are zero.

  • Use TXSString for simple nillable types . The WSDL standard allows the use of simple types in nil, Delphi or NULL, in C ++, while Delphi and C ++ do not allow this. Select this check box to make the WSDL importer overcome this limitation using shell class instances.

+7
source

All Articles