Building a Hello World Web Services Application
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:
- Choose File > New > Other. The New Items dialog box appears.
- Select WebServices folder.
- Double-click the Soap Server Application icon. The SOAP Server Application wizard opens.
- 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.
- To create a Web Service from scratch, click Yes. The Add New Web Service wizard opens.
- 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.
- 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:
- Choose File > New > Other. A New Items dialog appears.
- Select WebServices folder.
- Double-click the icon labeled WSDL importer. A WSDL Import Wizard appears.
- In that dialog box:
- Either specify the file name of a WSDL document (or XML file) or click the ellipsis button [...] to browse for the file.
- If the WSDL document is on a server that requires authentication, fill the required Authentication fields (User Name, Password and Proxy).
- Click Next to continue.
- On the SOAP Version page, choose the SOAP version that you want to use and click Next.
- 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.