Creating a Skeleton enterprise bean (EJB) from a WSDL file

Prerequisites:

The Web Service wizard assists you in creating a skeleton EJB from an existing WSDL document. The skeleton EJB contains a set of methods that correspond to the operations described in the WSDL document. When the EJB is created, each method has a trivial implementation that you replace by editing the bean.

For more information on EJB application development, refer to EJB tools.

To create a skeleton EJB from a WSDL document:

  1. Switch to the J2EE perspective (Window > Open Perspective > J2EE).
  2. In the Project Explorer view, select the Web project in which you want to create the skeleton EJB Web service.
  3. Click File > New > Other. Select Web Services in order to display the various Web service wizards. Select the Web Service wizard. Click Next.
  4. Web Service page: select Skeleton EJB 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.
  5. Object Selection page: Enter the URI to the WSDL, WSIL, or HTML file that will be used to generate the EJB bean. You can optionally generate a WSIL file from this file as well. Ensure that there are no spaces at the beginning of the URI or you may generate a null pointer exception.
  6. Service Deployment Configuration page: specify the server and client deployment settings.
    1. Click Edit and select the IBM® WebSphere® run-time environment and select the server on which you want to run your Web service and Web service client. The WebSphere run-time environment is the only supported run-time environment for this type of Web service.
    2. Select the service project and EAR for your Web service. The wizard will create these for you if they do not already exist.
    3. 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 that the only project type supported for Axis and SOAP run-time clients is a Web project. If you want the client to be created in a Java, EJB, or Application Client project, you must select the WebSphere run-time environment for your client.
    4. 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.
  7. Web Service Skeleton EJB Configuration page: This page displays the name of the WSDL file being generated. Select the Router project (which must be a pre-existing EJB project) and the security settings for the server side of the Web service. If there is already an SEI in your workspace, you can select to use it, or the wizard can generate one for you. If you are using SOAP over JMS as your transport method, most of the information in the JMS URI properties should be prefilled. You may have to manually enter the Listener port name.
  8. Web Service Namespace to Package Mappings page: if you selected Define custom mapping for namespace to package on the previous panel, you can enter your custom mapping pairs on this panel by clicking Add. Alternately, you can click Import to import custom mapping pairs from a .properties file. The content of the properties file must be of the format namespace=package .
  9. Web Service Test page: If you want to test your Web service in the Web Services Explorer click Launch. Select the operation you want to test, enter the required information, and click Go. The result will display in the Status pane.
  10. Web Service Proxy page: select if you want to generate a proxy, and select whether or not to enable security for this proxy. You can optionally select to enter custom namespace to package mappings.
  11. Web Service client namespace to package mapping page: if you selected Define custom mapping for namespace to package on the previous panel, you can enter your custom mapping pairs on this panel by clicking Add. Alternately, you can click Import to import custom mapping pairs from a .properties file. The content of the properties file must be of the format namespace=package .
  12. 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.
  13. 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:

For more information on EJBs, refer to the EJB application development documentation.

Important: When creating a skeleton EJB from a WSDL file, no JNDI name is generated for the newly created EJB. When this EJB is run in the Unit Test Environment, a warning with code WSVR0038I is displayed in the console, saying "No JNDI name found for the EJB, a default binding name based on the home interface will be used." This error does not impact your Web service. Use the J2EE tooling to assign a JNDI name to the EJB to avoid this problem.
Terms of use | Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.