February 17, 2019
Hot Topics:

Developing Web Services with Borland JBuilder Enterprise and BEA WebLogic Server

  • February 24, 2005
  • By Vlad Kofman
  • Send Email »
  • More Articles »

Simple Client

The Weblogic test client is not very useful for business; other clients will want to use this Web service with their own implementations. The general mechanism for creating a client is to point the Web service toolkit to the WSDL file and have it generate the client object stubs. The stubs then will be used to open a port to the server and call its methods. They also hide all the complexity of marshaling and un-marshaling of SOAP that is occurring behind the scenes. But, because the client module was added to the project, JBuilder intuitively added a GeneratedWebServicesClient folder to the project and created Bean1_client.jar.

The jar contains all the necessary files to make a fully functional client for the Bean1 service.

Here is how to create a simple test client:

Create a new package called "test", and add the new Test class.

Then, import package beanexport.generated.*; it should already be in the class path because it is in the project.

Create a connection to the service via gerenated stubs:

String wsdlUrl = "http://localhost:7001/web-services/Bean1?WSDL";
Bean1 service = new Bean1_Impl(wsdlUrl);    //bind to service
Bean1Port port = service.getBean1Port();    //get port

And call any method. Here is the complete listing:

package test;

import beanexport.generated.*;

public class Test {
   public static void main(String[] args) {
      try {
         String wsdlUrl = "http://localhost:9501/web-services/Bean1?WSDL";
         Bean1 service = new Bean1_Impl(wsdlUrl);
         Bean1Port port = service.getBean1Port();

         int result = port.getInt();
         System.out.println("Int is: " + result);

         Tuple[] tuple = port.getHeader();

         System.out.println("1st tuple: " + tuple[0]);
         System.out.println("2nd tuple: " + tuple[1]);

         catch (Exception e) {


The result would be an executable program that uses a Web service for communication with the server, calling APIs that were just legacy Java methods, but are now Web service calls.


This article has covered the basics of Web services. It created a simple Java class and turned it into a fully functional Web service. Also, this article discussed how to produce a client to talk to the server and invoke SOAP communication.

Packaging "legacy" code as a Web service mostly involved an understanding of the tools at hand. By hiding all the "plumbing" and complexities of marshaling SOAP and XML parsing, current application servers and toolkits make it very easy to create new or expose existing code as new Web services. This also lets developers concentrate on the business transactions and logic instead of dealing with low-level protocols and communications.

Listing 1

Tuple Class

package beanexport;

import java.io.Serializable;

public class Tuple
   implements Serializable {
      private String key;
      private String value;

      public Tuple() {

   public Tuple(String key, String value) {
      this.key = key;
      this.value = value;

   public Tuple(Object key, Object value) {
      this.key = key.toString();
      this.value = value.toString();

   public String getValue() {
      return value;

   public String getKey() {
      return key;

   public String toString() {
      return key + " : " + value;

   public void setKey(String key) {
      this.key = key;

   public void setValue(String value) {
      this.value = value;

About the Author

Vlad Kofman is a system architect working on projects under government defense contracts. He has also been involved with enterprise-level projects for major Wall Street firms and the U.S. government. His main interests are object-oriented programming methodologies and design patterns.


Download the accompanying source code here.

Online Reference Materials and Books


The Universal Description, Discovery, and Integration (UDDI) protocol is one of the major building blocks required for successful Web services. UDDI creates a standard interoperable platform that enables companies and applications to quickly, easily, and dynamically find and use Web services over the Internet. UDDI also allows operational registries to be maintained for different purposes in different contexts. UDDI is a cross-industry effort driven by major platform and software providers, as well as marketplace operators and e-business leaders within the OASIS standards consortium. http://www.uddi.org/.


WSDL is an XML format for describing network services as a set of endpoints operating on messages containing either document-oriented or procedure-oriented information. The operations and messages are described abstractly, and then bound to a concrete network protocol and message format to define an endpoint. Related concrete endpoints are combined into abstract endpoints (services). WSDL is extensible to allow description of endpoints and their messages regardless of what message formats or network protocols are used to communicate, however, the only bindings described in this document describe how to use WSDL in conjunction with SOAP 1.1, HTTP GET/POST, and MIME.

Borland Software Corporation


Developing Web Services with JBuilder X Enterprise

Developing Web Services with JBuilder 2005 Enterprise


Page 4 of 4

Comment and Contribute


(Maximum characters: 1200). You have characters left.



Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

Thanks for your registration, follow us on our social networks to keep up-to-date