Home arrow Graphic Design arrow Page 5 - Working with Web Services

Working with Web Services

Why would you want to use a Web service? They are flexible and supported on a number of platforms and can be implemented by using a number of languages. This chapter from BEA WebLogic Workshop 8.1 (by Albert J. Saganich, Jr., et al., Sams, 2004, ISBN: 0-672-32622-1) covers Web services concepts, SOA, SOAP, WSDL, and security.

Author Info:
By: Albert J. Saganich, Jr.
Rating: 4 stars4 stars4 stars4 stars4 stars / 16
June 28, 2004
  1. · Working with Web Services
  2. · Web Services Benefits for Service Developers
  3. · Understanding SOAP, WSDL, and UDDI and Their Place in WebLogic Workshop
  4. · Developing Web Services
  5. · Using Web Services Within Workshop Applications
  6. · Using Web Services from Standalone Applications
  7. · Conversations
  8. · Web Service Security
  9. · Associating Security with Web Services

print this article

Working with Web Services - Using Web Services Within Workshop Applications
(Page 5 of 9 )

Although a Web service is typically used to make a service available to the outside world, often you want to use a previously defined Web service from within a Workshop application. The following list illustrates three possible situations in which you would access Web services from within a Workshop application:

  • Web service within the same project as the caller—The Web service is defined in the calling application as a JWS file.

  • Web service in a Web services project—The Web service is developed in another Workshop project, but within the same application.

  • External Web server—The Web service is external to the application.

The simplest situation is having a Web service contained within the same project as the Web or portal application. In this case, you can simply right-click the Web service JWS file, and choose Generate Service Control. A control with the same name as the Web service is created, with Control.jcx added to the end of the name. Drag and drop the newly created control onto a Page Flow or any other consumer, and use it as you normally would.

If the Web service is nonlocal, you need to access its WSDL to create a control wrapper. WebLogic Workshop can easily create a WSDL file from a Web service. To do this, right-click the Web service, and choose Generate WSDL File. A WSDL file is created with the same name as the Web service, but it ends in Contract.wsdl. Workshop is smart enough to keep the associated WSDL file synchronized with its Web service parent. Changes to the Web service's methods or signatures cause an update to the associated WSDL.

To create a Web service control around an external Web service within a Page Flow, follow the steps shown in Figure 9.4:

  1. Select the folder where the Web service control will be created, and from the Data Palette's Add menu, choose Web Service.

  2. Enter a variable name for the control instance.

  3. Select the Create a New Web Service Control to Use option, and enter a Java Control Extension (JCX) name. A common convention is to use all uppercase letters for the JCX name or add WS to the end.

  4. Browse to the WSDL file defining the interface to the Web service. For those Web services within the same application but in a control project, you can browse to the directory containing the WSDL file. For external Web services, you can enter a fully qualified URL to the WSDL file.

  5. Click Create.


Figure 9.4 -- Creating a Web service control from an external Web service.

Workshop then creates a JCX file defined by the selected WSDL that can be used like any other control. It's important to note that the newly created control represents the Web service as it was defined by the WSDL file at its moment of creation. If the underlying Web service changes, such as modifying a method signature, the control instance will not match the running service. Be careful to ensure that the Web service is stable before you create a control from it.

SamsThis chapter is from BEA WebLogic Workshop 8.1, by Albert J. Saganich, Jr., et al. (Sams, 2004, ISBN: 0-672-32622-1). Check it out at your favorite bookstore today.

Buy this book now.

blog comments powered by Disqus

- Customizing Wordpress Favicons and Gravatars
- Building Corner Effects with Transparent Bac...
- 3D Graphics Technology: VRML Part I - Introd...
- Creating Visual Effects
- Web Page Design Overview
- Creating Artistic Photographs
- Working with Tools in Paint Shop Pro 8
- Using HTML Quickform for Form Processing
- Introduction to Adobe FrameMaker
- WebLogic Workshop, WebLogic Platform, and th...
- Planning the Site
- Working with Web Services
- WebLogic Workshop Application Development Ba...
- Scanning Images for Web Use
- Web Graphics Overview

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2019 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials