RAD Studio
ContentsIndex
PreviousUpNext
Using the WSDL Importer

To use the WSDL importer, choose File|New|Other, and on the WebServices page double-click the icon labeled WSDL importer. In the dialog that appears, specify the file name of a WSDL document (or XML file) or provide the URL where that document is published.

Note: If you do not know the URL for the WSDL document you want to import, you can browse for one by clicking the button labeled Search UDDI. This launches the UDDI browser.
Tip: An advantage of using the UDDI browser, even if you know the location of the WSDL document, is that when you locate the WSDL document using a UDDI description, client applications get fail-over support.
If the WSDL document is on a server that requires authentication (or must be reached using a proxy server that requires authentication), you need to provide a user name and password before the wizard can retrieve the WSDL document. To supply this information, click the Options button and provide the appropriate connection information. 

When you click the Next button, the WSDL importer displays the code it generates for every definition in the WSDL document that is compatible with the Web Services framework. That is, it only uses those port types that have a SOAP binding. You can configure the way the importer generates code by clicking the Options button and choosing the options you want. 

You can use the WSDL importer when writing either a server or a client application. When writing a server, click the Options button and in the resulting dialog, check the option that tells the importer to generate server code. When you select this option, the importer generates implementation classes for the invokable interfaces, and you need only fill in the bodies of the methods.

Warning: If you import a WSDL document to create a server that implements a Web Service that is already defined, you must still publish your own WSDL document for that service. There may be minor differences in the imported WSDL document and the generated implementation. For example, if the WSDL document or XML schema file uses identifiers that are also keywords, the importer automatically adjusts their names so that the generated code can compile.
When you click Finish, the importer creates new units that define and register invokable interfaces for the operations defined in the document, and that define and register remotable classes for the types that the document defines. 

As an alternate approach, you can use the command line WSDL importer instead. For a server, call the command line importer with the -Os option, as follows:

WSDLIMP -Os -P -V MyWSDLDoc.wsdl

 

WSDLIMP -Os -C -V MyWSDLDoc.wsdl

For a client application, call the command line importer without the -Os option:

WSDLIMP -P -V MyWSDLDoc.wsdl

 

WSDLIMP -C -V MyWSDLDoc.wsdl

Tip: The command line interpreter includes some options that are not available when you use the WSDL importer in the IDE. For details, see the help for WSDLIMP.

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!