WSDLIMP.EXE, the Command Line WSDL Import Tool

From RAD Studio
Jump to: navigation, search

Go Up to Command-Line Utilities Index

WSDLIMP generates code to represent the types and APIs defined by a WSDL document. This code can be used to write client applications that call on the Web Service that the WSDL (Web Services Description Language) document describes. If you want to write a server that implements the Web Service, one of the command-line options tells the importer to generate implementation classes that you can then complete by filling in the bodies of the generated methods. See also Import WSDL Wizard.

Note: WSDLIMP ignores any definitions in the WSDL document for which it cannot generate code. That is, it can only import Web Services that use SOAP or document literal encoding.

WSDLIMP.EXE imports a WSDL document, generating code that lets your application call on the Web Service that the WSDL document describes. This is the command-line version of the Web Services importer, which is available on the Web Services tab of the new items dialog.

You can configure the output using the WSDLIMP command-line options when you start the program. These options let you specify whether the importer generates Delphi or C++ code, whether you want to generate implementation classes because you are writing a server, and how to handle various types of definitions in the WSDL document.

Command-Line Syntax

The command-line syntax for WSDLIMP is:

WSDLIMP [<options>] <InputWSDLfile|URL>

To display command-line help, enter:

WSDLIMP

or

WSDLIMP -?


Command-Line Elements

The following elements can be used in WSDLIMP command lines:

Element Description
<InputWSDLfile>

Defines the physical WSDL file name to import.
Either <InputWSDLfile> or <URL> is required.

<URL>

Defines the URL to access a WSDL document that is published on the Web.

<options>

The WSDLIMP command-line options.
Each option must be preceded by a hyphen - character. A plus + symbol after an option turns the option on; a hyphen - symbol after the option turns the option off. The + sign is optional.

Command-Line Options

The following table lists the command-line options for WSDLIMP. Most of the WSDLIMP command-line options have corresponding options in the integrated Import WSDL Wizard. We provide names of such options in the Wizard's Option Name column of the table.

The table uses:

  • A plus symbol + after an option to show that the option is ON by default.
  • A hyphen symbol (-) after an option to show that the option is OFF by default.

WSDLIMP Options

Option Wizard's Option Name Description
Language Generation Options:
-C

Generate C++ code to represent the definitions in the WSDL file.
You must use either this option or the -P option, but not both.

-P

Generate Delphi code to represent the definitions in the WSDL file.
You must use either this option or the -C option, but not both.

Code Generation Options:
-Oa+

Process nillable and optional elements

Enable this option to make the WSDL importer generate relevant information about optional and nillable properties. This information is used by the SOAP runtime to allow certain properties be nil.
ON by default.

-Ob-

Use Setters and Getters for properties

By default, the WSDL importer generates properties that map directly to the fields in the generated classes. By enabling this option, you can force the WSDL importer to generate setter and getter methods instead.
OFF by default.

-Od+

Generate destructors for remotable types

When enabled, the importer generates destructors on the classes that represent types. These destructors free any nested members whose types are classes or arrays of classes. The generated destructors simplify the work you must do when freeing instances of classes that represent types, because you do not need to explicitly free class members that also use classes to represent the remotable type.
ON by default.

-Oe+

Generate scoped enumerations

Generate scoped enumerations.
When enabled, scoped enumerations will be generated. Check this option if the WSDL document contains different enumerations that define values with the same name.
ON by default.

-Of+

Import Fault Types

Enable this option to make the WSDL importer process types marked as fault.
ON by default.

-Og-

Generate interface GUIDs using COM API

Enables the WSDL importer to assign unique GUIDs each time a Service is imported. If this option is disabled, the GUID generated to each Service remains the same every time the WSDL importer generates code for that Service. In most cases, we recommend that this option be disabled.
OFF by default.

-Oh+

Import Header Types

Enables the WSDL importer to process types marked as headers.
ON by default.

-Oi+

Generate warnings comments

When enabled, the importer adds warning messages to the comments it puts at the top of generated files. These warnings describe problems such as invalid type definitions in the WSDL document, problems encountered when unwinding literal parameters when Unwind Literal Params is checked, and so on.
ON by default.

-Oj+

Validate Enumeration members

Enable this option to ensure that the WSDL importer uses a global symbol list when generating enumeration members. This option prevents name clashes between enumeration members of enumerated types declared in the WSDL document. Since Delphi 2009, we recommend you enable the Generate scoped enumerations -Oe option instead.
ON by default.

-Ok-

Map pure collections to wrapper class types

Enable this option to enable the WSDL importer to map the imported array types to wrapper classes. This option is mainly provided for C++Builder, where array types cannot be directly mapped to WSDL array types, thus requiring a wrapper collection class.
OFF by default.

-Ol-

Emit Literal Types

In document literal encoding, the Web Service does not describe operations. Rather, it describes two records, one that presents the expected input and one that presents the output. When Emit Literal Types is enabled, the importer generates type definitions for these two records, even if it converts them to method calls (that is, even if Unwind Literal Params is checked.)
OFF by default.

-Om-

Allow out parameters

This option controls whether the WSDL importer generates methods that use out parameters when returning multiple parts of a SOAP message. If this option is disabled, out parameters are not generated; the WSDL importer generates wrapper classes for multipart SOAP messages.
OFF by default.

-Oo+

One out parameter is return value

When enabled, the importer maps operations with a single output message into functions, where the output message is the return value. If this is not checked, the output message is mapped to an output parameter.
ON by default.

-Op+

Process included and imported schemas

Enable this option to make the WSDL importer process included and imported schemas.
ON by default.

-Or-

Generate alias for the element of pure collections

This backward-compatible switch generates code as previous product versions did. To re-enable the generation of an alias type as before, turn this option ON. OFF by default. For more information, see WSDL -Or- Option.

-Os-

Generate server implementation instead of client implementation

When enabled, the importer generates implementation classes for the imported interfaces. Use this option when writing a server that implements a Web Service that is already defined in a WSDL document.
OFF by default.

-Ot+

Do not emit unused types

If this option is enabled, the WSDL importer does not generate code for types declared in the WSDL document, but not used in any exposed Service. Note that classes may not follow this rule, because a Service may return an instance of a derived class where the base class is expected. In this case, code for both the base class and the derived one is generated.
ON by default.

-Ou+

Unwind Literal Params

In document literal encoding, the Web Service does not describe operations. It rather describes two records, one that presents the expected input and one that presents the output. When Unwind Literal Params is enabled, the importer converts these two records into method calls.
ON by default.

-Ov+

Generate verbose information about types and interfaces

If this options is enabled, the WSDL importer generates information regarding type namespaces, service styles, binding names, and various other WSDL exposed data.
ON by default.

-Ow-

Map String to WideString

When enabled, the importer maps all string types to WideString values. When unchecked, the importer uses the string type instead. WideString values may be required to handle values that use extended characters. If string values do not use extended characters, it is more efficient to use the string type.
OFF by default.

-Ox+

Generate class aliases as class types

Enable this option to make the WSDL importer generate class types instead of weak aliases. This option makes sure that generated alias classes have RTTI (Run-Time Type Information) different from the base type's one.
ON by default.

-Oz-

Use TXSString for simple nillable types

Use TXSString for simple nillable types.
The WSDL standard allows simple types to be nil, in Delphi, or NULL, in C++, while Delphi and C++ do not allow that. Enable this option to make the WSDL importer overcome this limitation by using instances of wrapper classes.
OFF by default.

SOAP Version Options:
-SOAP11

Process only WSDL Binding extensions for the SOAP 1.1 Protocol.
This option cannot be used simultaneously with -SOAP12.

-SOAP12

Process only WSDL Binding extensions for the SOAP 1.2 Protocol.
This option cannot be used simultaneously with -SOAP11.

File Options:
-D<path>

Specifies the <path> directory where WSDLIMP writes the files it generates.

@<RespFile>

The <RespFile> specifies a text file where each line lists a URL or WSDL file to import. You can optionally add =OutputFileName after the URL or WSDL file name to specify where to place the generated code for each imported WSDL document.

-=<OutputFileName>+

Interpret the equal sign = as introducing an OutputFileName output file name. OutputFileName can be used after the URL or WSDL file name to specify where to place the generated code for an imported WSDL document. (See also the @<RespFile&gt option.)
When OFF, an equal sign is assumed to be part of the URL. ON by default.

Proxy/Server Authentication:
-user:UserName

User Name

Using this option, specify the user name to use if the WSDL document is on a secure server that requires authentication.
This option requires the -pass:Password option to be specified.

-pass:Password

Password

Using this option, specify the password to use with User Name when the WSDL document is on a secure server that requires authentication.
This option requires the -user:UserName option to be specified.

-proxy:Proxy

Proxy

Specify the host names for any proxy servers that must forward requests to the specified WSDL document URL.
This option requires the -pass:Password and -user:UserName options to be specified.

WSDLIMP Command-Line Examples

For WSDLIMP command-line examples, see Using the WSDL Importer.

See Also