Web services can be developed from existing JavaBeans.
To develop Web services based on the JAX-WS programming model, you can use a bottom-up development approach when you start from JavaBeans or you can use a top-down development approach when you start with an existing Web Services Description Language (WSDL) file. When developing a JAX-WS Web service starting from JavaBeans, you can use a bean that already exists and then enable the implementation for JAX-WS Web services. The use of annotations simplifies the enabling of a bean for Web services. Adding the @WebService annotation to the bean defines the application as a Web service and how a client can access the Web service. JavaBeans can have a service endpoint interface, but it is not required. Enabling JavaBeans for Web services includes annotating the bean and the optional service endpoint interface, assembling all artifacts required for the Web service, and deploying the application into the WebSphere Application Server environment. You are not required to develop a WSDL file because the use of annotations can provide all of the WSDL information necessary to configure the service endpoint or the client. It is a best practice to develop a WSDL file. JAX-WS Web services are only supported over an HTTP transport.
To develop Web services based on the JAX-RPC programming model, you can use a bottom-up development approach when you start from JavaBeans. You can also develop a JAX-RPC Web service from an enterprise bean. You can use a top-down approach to develop a Web service with an existing Web Services Description Language (WSDL) file using a bean or develop a Web service with an existing WSDL file using an enterprise bean. When developing a JAX-RPC Web service starting from JavaBeans, you need develop a new WSDL file. You can use existing JavaBeans and then enable the implementation for Web services. Enabling JavaBeans for Web services includes developing the service endpoint interface, developing a WSDL file that is the description of the Web service, generating and configuring the deployment descriptors, assembling all artifacts required for the Web service, and deploying the application into the WebSphere Application Server environment.
After you deploy the EAR file, test the Web service to make sure that it works with the application server.
The
Feature Pack for Web Services provides Samples that demonstrate JAX-WS-based
Web services using many of the new functions and standards supported in this
Feature Pack. The Samples demonstrate the simple message exchange patterns
using both synchronous and asynchronous invocation of Web services in SOAP
1.1 and SOAP 1.2 environments. The samples demonstrate the use of JavaBeans
artifacts and static service endpoints and proxy-based clients. To learn more
about these Samples, see the Samples readme located in the app_server_root/samples/lib/WebServicesSamples directory. Refer to the topic on installing the Samples using the administration
console to learn how to install these Samples onto an application server that
has been augmented with a Web services profile.
In this information ...Subtopics
Related tasks
| IBM Redbooks, demos, education, and more(Index) |