Building a Hello World Web Services Application

From RAD Studio
Jump to: navigation, search

Go Up to Developing Web Services

Web Services are self-contained modular applications that can be published and invoked over a network (such as the World Wide Web). Web Services use SOAP, a standard lightweight protocol for exchanging information in a distributed environment. It uses HTTP as a communications protocol and XML to encode remote procedure calls.

To build a "Hello World" Web Services application:

  1. Choose File > New > Other. The New Items dialog box appears.
  2. Select WebServices folder.
  3. Double-click the Soap Server Application icon. The SOAP Server Application wizard opens.
  4. Choose the type of Web server application you want to use for your Web Service. The wizard generates a new Web server application that includes a Web module that contains three components: HTTPSoapPascalInvoker, HTTPSoapDispatcher, and WSDLHTMLPublish. When you exit the SOAP Server Application wizard, it asks you if you want to define an interface for your Web Service.
  5. To create a Web Service from scratch, click Yes. The Add New Web Service wizard opens.
  6. To add a new Web Service, specify the name of the invokable interface you want to expose to clients. The Add New Web Service wizard lets you specify the name of the invokable interface and generates the code to declare and register the interface and its implementation class.
  7. To implement a Web Service that has already been defined in a WSDL document, use the WSDL importer to generate the interfaces

To use the WSDL importer:

  1. Choose File > New > Other. A New Items dialog appears.
  2. Select WebServices folder.
  3. Double-click the icon labeled WSDL importer. A WSDL Import Wizard appears.
  4. In that dialog box:
    1. Either specify the file name of a WSDL document (or XML file) or click the ellipsis button [...] to browse for the file.
    2. If the WSDL document is on a server that requires authentication, fill the required Authentication fields (User Name, Password and Proxy).
    3. Click Next to continue.
  5. On the SOAP Version page, choose the SOAP version that you want to use and click Next.
  6. On the WSDL Import Options page check those options that you want to use, uncheck those options that you do not want, and 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.

See Also