Roadmap to WebLogic Web Services


The objective of this section is to highlight major Web service initiatives in this release as opposed to providing an exhaustive list of all Web services or Web services “ related components in WebLogic Platform 7.0. Figure 29.5 provides a snapshot of Web service pieces and interrelationships in WebLogic Platform 7.0.

Figure 29.5. WebLogic Web service roadmap.

graphics/29fig05.gif

Figure 29.5 makes the following points:

  • There are two ways of creating, deploying, and running a local Web service.

  • A Web service requires a runtime environment or container to execute.

  • The WebLogic Server can be a provider as well as a consumer of Web services.

  • Clients can be internal, external, or programmatic, possessing either a GUI or Web interface. Even a Web service can be a client to another Web service.

Creating Local Web Services

WebLogic Platform 7.0 provides two ways of developing your own locally hosted Web service: through WebLogic Server and through the WebLogic Workshop.

Through WebLogic Server

The WebLogic Server (WLS) component of WebLogic Platform 7.0 provides tools for you to create your own Web service, hosted within WebLogic Server. Both client and server requisite files can be generated automatically and yet allow points of control via pluggable custom components. Using these tools requires that you know Java and J2EE, but the WLS provides the most flexible and unbounded environment for creating Web services. This chapter and Chapter 30, "Developing Web Services for WebLogic Server," will illustrate these features in greater detail.

Through WebLogic Workshop

The WebLogic Workshop (WLW) component of WebLogic Platform 7.0 is a wizard for creating Web services. For the business programmer who would rather focus on developing enterprise business logic and business components, WebLogic Workshop is the answer. WLW is a sophisticated IDE for creating Web service clients and providers, in an easy-to-use and intuitive visual interface. WLW is discussed in more detail in Chapter 32, "Web Services Made Easy ”WebLogic Workshop."

Web Service Runtime Environments

When a Web service executes, it presumes the availability of certain services that it uniquely needs. A Web service runtime environment provides a library of services, both client and server side, such as support for a fixed set of data types, APIs for type mappings (to XML) and extensibility mechanisms, processing of standard service descriptions, and deployment APIs. This concept of a Web service runtime is akin to a standard J2EE container that provides a uniform environment for application components such as Enterprise JavaBeans (EJB) to run, thus enabling portability of EJBs across any J2EE-compliant application server. The JAX-RPC initiative claims to do just that. It aims to replace many proprietary Web service implementations that exist today with an industry standard Web service deployment and execution model, thereby protecting your development investment.

There are two distinct Web service runtime environments in WebLogic Platform: one is for the WebLogic Server (JAX-RPC “based Web service container), and the other is for WebLogic Workshop (KNEX runtime). A Workshop-created Web service can run only in a KNEX runtime, and a WLS-created Web service can run only in a JAX-RPC container. However, both types of Web services can interoperate with each other, as well as be published in the same UDDI registry. No special client code is necessary to invoke WLW Web services; that is, a client is oblivious to what runtime environment the service provider is using. In WebLogic Platform 7.0, the appropriate Web service runtimes will be invoked automatically for you when you start either the WebLogic Workshop or WebLogic Server.

Local Web Service Advertised with UDDI

WebLogic Server 7.0 provides new support for hosting your own Web Service Registry, based on the worldwide standard UDDI 2.0. It also features a UDDI browser for both looking up and publishing a service and an implementation of the UDDI API. Publishing your Web service, however, either internally within your enterprise or otherwise , is not required for you to be able to create, deploy, and invoke the Web service. This topic is fully discussed in Chapter 31.

The Portlet Wizard

WebLogic Platform 7.0 includes a portal framework called the WebLogic Portal. A portal is a feature-rich Web site. It provides a single point of access to enterprise data and applications, presenting a unified and personalized view of that information to employees , customers, and business partners .

A portal allows you to have multiple Web applications within a single Web interface. In addition to regular Web content that appears in a portal, a portal provides the ability to display portlets in a single Web interface. A portlet is a self-contained application or content that resides within the WebLogic portal framework. WebLogic Portal provides a wizard for configuring a portlet to invoke and consume Web services.

The Portlet Wizard is accessible from inside the E-Business Control Center (EBCC) application of the WebLogic Portal component in WebLogic Platform 7.0. Invoke the EBCC in Windows by choosing Start, Programs, BEA WebLogic Platform 7.0, WebLogic Portal 7.0, E-Business Control Center.

You then must open a project in the EBCC. An example project file is available at

 
 <  WL_HOME  >\weblogic700\samples\portal\wlcsDomain\beaApps\wlcsApp-project\ wlcsApp-project.eaprj 

If you don't already have one, you must first define a portal to which your portlet will be associated. While creating your portlet, specify Web service(s) for the content type, as shown in Figure 29.6.

Figure 29.6. Create a Web service portlet using the EBCC Portlet Wizard.

graphics/29fig06.gif

A convenient wizard feature is the capability to specify the WSDL URL of the Web service to be presented in the portlet, as shown in Figure 29.7.

Figure 29.7. The Portlet Wizard allows you to select the Web service to be included in the portlet, via a WSDL URL.

graphics/29fig07.gif

For more information on the Portlet Wizard, consult the WebLogic Portal EBCC documentation.

Web Services Included with WebLogic Commerce

The WebLogic Portal component of WebLogic Platform 7.0 includes a sample commerce application representing an online hardware store, complete with an online catalog and shopping cart. During checkout, the sales taxes must be calculated and displayed, and before checkout can be completed, the user 's credit card must be authorized for the purchase amount. These two services, tax and payment, are deployed as Web services. Their Web service home pages, shown in Figure 29.8 and 29.9, were generated automatically by WebLogic Server when its tools were used to generate the Web service.

First, you need to launch the WebLogic Commerce Server, which hosts these two Web services. To do this in Windows, choose Start, Programs, BEA WebLogic Platform 7.0, WebLogic Portal 7.0, Portal Examples, Commerce Templates, Launch Commerce Server.

When the Commerce Server is up and running, you can reach the tax and payment home pages at the following URLs (by default), respectively:

 
 http://localhost:7501/taxws/TaxService http://localhost:7501/payws/PaymentService 

The sample tax Web service that comes deployed with the WebLogic Portal Commerce sample (see Figure 29.8) illustrates how a local or remote Web service can be integrated with an online store. However, because it is a sample, its business logic is inadequate for commercial use. You must customize or integrate with a tax service bureau for production use.

Figure 29.8. The Commerce sample tax Web service home page.

graphics/29fig08.gif

Similar customization and integration requirements also apply to the sample payment Web service shown in Figure 29.9. The WebLogic Server generated both of these Web services automatically.

Figure 29.9. The Commerce sample payment Web service home page.

graphics/29fig09.gif

For now, observe that the generated Web service home page tells you what the service is all about, its publicly available operations or methods , access to its WSDL, and some Web service testing mechanisms. We will discuss Web service home pages in greater detail in the next chapter.

Another sample application called End-to-End highlights how the portal framework can be used to build business-to-business and business-to-consumer portlets. It implements and uses the same sales tax Web service as in the Commerce application. In addition, it implements and uses a unique payment Web service that was built with WebLogic Workshop. The End-to-End sample application can be invoked via

 
  <WL_HOME>  /weblogic700/samples/platform/e2eDomain/starteE2E.bat 

Web Service Examples in WebLogic

WebLogic Platform includes a wealth of working sample code that further illustrates the Web service concepts described in these chapters. All Web service samples can be found in

 
  <WL_HOME>  \weblogic700\samples\server\src\examples\ webservices 

where <WL_HOME> is the base install directory for WebLogic Platform. Each sample comes equipped with a build.xml file, so invoking ant builds and deploys the sample for you into the examples server, and invoking ant run runs the sample. You can find detailed instructions on how to run the examples at

 
 <WL_HOME>\weblogic700\samples\server\src\examples\webservices\package-summary.html 

The following samples are provided (specific sample locations shown in parentheses are relative to the preceding samples home folder):

  • An RPC Web service based on a Java class back-end component (in ..\basic\ javaclass )

  • An RPC Web service based on a stateless session bean back-end component (in ..\basic\statelessSession )

  • An RPC Web service that uses user-defined types (in ..\complex\statelessSession )

  • Client Examples:

    • A static client (in ..\client\static )

    • A dynamic client using a WSDL file (in ..\client\dynamic_wsdl )

    • A dynamic client without a WSDL file (in ..\client\dynamic_no_wsdl )

    • A static client invoking a Web service that employs output parameters (in ..\client\static_out )

    • An RPC Web service that uses SOAP handlers (in ..\Handler\log )

    • An RPC Web service that uses SOAP handlers exclusively with no back-end component (in ..\Handler\nocomponent )

In addition, two new examples can be found on the Sams Web site, www.samspublishing.com.

  • A Web service (called ws-inout ) that illustrates use of output parameters or Holder classes

  • An asynchronous client and Web service (called ws-async ) that uses JMS (Java Messaging Service) and MDB (message-driven beans) as back-end components



BEA WebLogic Platform 7
BEA WebLogic Platform 7
ISBN: 0789727129
EAN: 2147483647
Year: 2003
Pages: 360

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net