Create a Web service from a URL using IBM SOAP
The Web Service wizard assists you in creating a new Web service, configuring it for deployment, deploying the Web application, testing your new Web service, creating a sample application, and publishing the Web service to a UDDI Business Registry.
Prerequisites:
- If you are using the Apache Jakarta Tomcat servlet container as your server, install it, configure an instance of it, and create a Web project targeted to it.
- If you are using a WebSphere server, create a dynamic Web project targeted to the appropriate server as described It is strongly suggested that you start the server before running the Web service wizard since it may take several minutes to start the WebSphere Application Server depending on the speed of your computer. To start the server, select it in the Servers view (Window > Show View > Servers), right-click and click Start.
To create a Web service from a URL:
- Switch to the J2EE perspective ( Window > Open Perspective > J2EE).
- In the Project Explorer view, select the Web project in which you want to create the Web service.
- Click File > New > Other. Select Web Services in order to display the various Web service wizards. Select the Web Service wizard. Click Next.
- On the Web Service page select URL Web service from the Web service type drop down list. You can optionally choose to do the following:
- Start the Web service in a Web project - if you do not select this option you will have to manually start the Web service. You must select this option to enable the other options on this page.
- Launch the Web Services Explorer to publish your Web service to a UDDI registry.
- Generate a Java bean client proxy to the Web service. The Java bean client proxy that is generated provides a remote procedure call interface to the Web service.
- Test the Web service - this allows you to test the Web service in the Web Service Explorer before a proxy is generated.
- Send the Web service traffic through the TCP/IP Monitor, which allows you to watch the SOAP traffic generated by the Web service and to test this traffic for WS-I compliance.
- Service Deployment Configuration page: specify the server and client deployment settings.
- Click Edit and select the IBM SOAP run-time environment and select the server on which you want to run your Web service and Web service client.
- Select the Web project and EAR in which you want your Web service created. The wizard will create these for you if they do not already exist.
- Select the type and name of project in which you want the Web service client created. If you enter the name of an existing project, the project type field must match that of the existing project. If you enter a name of a project that does not already exist, the wizard will create the project for you.
Note:
- When generating a Web Service from a URL, the WSDL produced has HTTP GET and HTTP POST bindings but no SOAP binding. The Axis and IBM WebSphere run-time environments do not support the HTTP GET and POST bindings in WSDL. Only the IBM SOAP run-time environment supports the HTTP bindings. When generating a Web service client for a URL Web Service, or for any WSDL that contains only HTTP GET and POST bindings, use the IBM SOAP run-time environment for the client. Any attempt to use the Axis or IBM WebSphere run-time environments may result in incomplete generated code or an internal error (IWAB0234E An internal error occured).
- The only project type supported for SOAP run-time environment clients is a Web project.
- Select an existing EAR or enter a unique name to associate the Web service client with a different EAR than the Web service EAR. Note: Selecting different EARs for the Web service and Web service client can reduce the chance of encountering run time errors, but will use more system resources.
- Web Service URL page: Specify the URL to be turned into a Web service. Add URL operations, parameters, and ports to your URL Web service. Right-click the operation, parameter, or port to display a list of actions.
- Web Service Binding Proxy Generation panel: if you have selected to generate a proxy, select the binding and proxy options.
- Web Service Client Test page: Use this page to select the following options:
- Select your test facility. You can test the generated proxy in the Universal Test Client or the Web Service Explorer, or you can generate a sample Web service JSP.
- If you selected to test the proxy through a JSP, you can select the folder where the JSP will be located, and you can select the methods that will be included in the JSP.
- Select Run test on server to start the server for you automatically.
- Web Service Publication page: Select whether or not you want to publish this Web service to a UDDI registry. Click Finish.
After the Web service has been created, the following may occur depending on the options you selected:
- If you have selected to test the generated proxy using Web service JSPs, the proxy is launched in a Web browser at the following URL: http://localhost: port/WebProjectClient/sampleBeanName/ WebService/TestClient.jsp You can use this sample application to test the Web service by selecting a method, entering a value for the method, and clicking Invoke. The result of the method will display in the results pane.
- If you have selected to test the generated proxy using the Universal Test Client, it will be launched in a browser window at the following URL: http://localhost:9080/UTC/preload?object=proxy.soap. ProxyNameProxy In the Reference pane, under Object References, expand the proxy to display the methods of the Web service. Click the method you want to test, enter a value in the Parameters pane, and click Invoke. The result will be generated below.
- If you have selected to test the Web service using the Web Services Explorer, the Explorer will open. Select the operation you want to test, enter the required information, and click Go. The result will display in the Status pane.
- If you have selected to publish the Web service, the Web Services Explorer is launched displaying the page required to publish your Web service to the IBM UDDI Test Registry. Follow the instructions in Publishing the Web service to complete this task.
Note: If your methods contain types, not supported by the sample, such as arrays, indexed properties, and collections, the methods will be omitted from the sample and you will receive a warning message.
The URL represents an active Web site. There is no new Web service to deploy. However, the Web application is deployed in order to generate a WSDL document that describes the existing URL. You are now ready to publish your Web service.
Parent topic
Creating Web services with the IBM SOAP run-time environment
Related Concepts
Tools for Web services development
Web services development
Web services run-time environments
Related Tasks
Developing Web services
Using the Web Services ExplorerRelated Reference
Deployment properties
Mapping properties
WSDL documents