The Borland Enterprise Server now provides two web service solutions. In addition to the existing SOAP server provided in all Partitions, this release previews a new, more functionally rich, web services server. This new web services server is provided out-of-the-box in a "webservices" Partition. For information on the existing SOAP server found in all Partitions, see the Borland Enterprise Server Developer's Guide.
This document covers the following:
A separate document, Web Services Overview, provides a general introduction to Web Services for those not familiar with Web Services technologies.
The Borland Enterprise Server stand-alone webservices Partition is pre-configured to support our new web services server and can be used in conjunction with all other Partitions. You simply need to start the webservices Partition to begin using the new web services server and deploy WARs (or EARs containing WARs) containing web services.
The Borland web services server is based on the Apache Axis technology and supports:

Like the Borland standard Partition, you can clone a Borland webservices Partition. You can have multiple Borland webservices Partitions within your Borland Enterprise Server. If, for any reason the Borland webservices Partition is deleted, use the cloning operation to restore the partition.
NOTE: Because certain configuration options are required for web services support, you should only use the Borland webservices Partition (or a clone of this Partition) to clone new webservices Partitions.
For more information on cloning a partition, refer to the Borland Enterprise Server User's Guide.
If you have multiple Partitions on the same machine with web containers enabled, you need to change the HTTP port number for each of the containers. This prevents the Partitions from clashing on HTTP ports.
The standard Partition is configured by default to listen on HTTP port 8080, and the webservices Partition on HTTP port 8040.
To change the HTTP Port number:
The Edit Tomcat's Server .xml window appears.
<Define a non-SSL HTTP/1.1 Connector on port 8040
Connector className="org.apache.catalina.connector.http.HttpConnector"
port="8040" minProcessors="5" maxProcessors="75"
enableLookups="true" redirectPort="8443"
acceptCount="10" debug="0" connectionTimeout="60000"/>
The Borland Web Services engine includes a number of providers. A provider is the link that connects a client web service request to the user's class on the server side.
All providers do the following:
When installing a new web service, you must name the web service and specify which provider the service is going to use. Each provider takes different parameters. The following describes the service providers and the required parameters for each.
The parameters are:
className - The name of the class that is loaded when a request arrives
on this service.allowedMethods - The methods that are allowed to be invoked on this class.
The class can have more methods than listed here; the methods listed here
are available for remote invocation.Example:
<service name="Animal" provider="java:RPC"> <parameter name="className" value="com.borland.examples.web services.java.Animal"/> <parameter name="allowedMethods" value="talk sleep"/> </service>
This provider assumes that the class serving the web service is an EJB.
When a web service request arrives:
The actual EJB itself must be deployed to any non-webservices Partition before a client can access it.
The essential parameters are:
beanJndiName - The name of the bean in JNDI.homeInterfaceName - The fully specified class of the home interface. This
class must be present in the WAR.allowedMethods - The methods that are allowed to be invoked on this EJB, separated
by spaces.
The EJB can have more methods than listed here; the methods listed here are
available for remote invocation.Example:
<service name="Animal" provider="java:EJB">
<parameter name="beanJndiName" value="Animal"/>
<parameter name="homeInterfaceName" value="com.borland.examples.webservices.ejb.AnimalHome"/>
<parameter name="allowedMethods" value="talk sleep"/>
</service>
This provider assumes that the class serving the web service is a Visibroker Server. When a web service request arrives, this provider:
The Visibroker Server must be running on your LAN. In order for the web service to locate it, the VisiBroker Server must use the same user Smart Agent port as Borland Enterprise Server.
The parameters are:
className - The name of the class that is loaded when a request arrives
on this service. Typically this is the name of the CORBA class generated and
based on the IDL. The VisiBroker client stubs including this class, must be
present in the WAR.allowedMethods - The methods that are allowed to be invoked on this class.
The CORBA object can have more methods than listed here; the methods listed
here are available for remote invocation. poaName - The name of the POA that hosts the CORBA object.objectName - The name of the object within the POA.cacheObject - When set to true, then any repeated invocations on the same
service will use the same object. A bind( ) is used to locate the object for
the initial request. The default is false.If the poaName is not specified, then it is assumed that the object itself is directly available and the appropriate bind is used to locate the object.
Example:
<service name="Animal" provider="java:VISIBROKER">
<parameter name="className" value="com.borland.examples.web services.visibroker.AnimalModule.Animal"/>
<parameter name="allowedMethods" value="talk sleep"/>
<parameter name="objectName" value="BigAnimal"/>
<parameter name="cacheObject" value="false"/>
</service>
Web services are deployed as part of a WAR. A single WAR can contain multiple web services. You can also deploy multiple WARs with each containing many web services.
The difference between a normal WAR and a WAR containing web services is the
presence of an extra descriptor named server-config.wsdd in the WEB-INF directory.
The server-config.wsdd file provides configuration information (the name of
the web service, the provider, any corresponding Java classes and allowed
methods).
There is one WSDD file per WAR and it contains information about all available web services within that WAR.
The typical component structure of a WAR containing web services has the following elements:
WEB-INF/web.xmlWEB-INF/server-config.wsddWEB-INF/classes/<classes corresponding to your web services are located
here>WEB-INF/lib/<classes corresponding to your web services are located here
in the packed JAR form>The WEB-INF/lib also contains some standard JARs that are necessary for the
Axis Runtime engine.
To publish your Java classes as a web service, use the WSDD format to define the items that you want to deploy to the webservices Partition. For example, an entry corresponding to a service named "BankService" can be:
<service name="BankService" provider="java:RPC">
<parameter name="allowedMethods" value="create_account query_account"/>
<parameter name="className" value="com.fidelity.Bank"/>
</service>
In this case, the com.fidelity.Bank Java class links to web service BankService.
The class com.fidelity.Bank can have a number of public methods, but only the
methods create_account and query_account are allowed.
NOTE: For more information on the web services deployment descriptor
(WSDD), refer to the Axis User Guide located in <install_dir>/doc/axis/user-guide.html,
where install_dir is the Borland Enterprise Server installation directory.
To create the server-config.wsdd:
Use JBuilder to generate the deployment descriptor as part of your WAR.
or
deploy.wsdd file. Refer to the
deploy.wsdd file in <install_dir>/examples/webservices/java/server.deploy.wsdd file by typing:prompt>java org.apache.axis.utils.Admin server deploy.wsdd
The server-config.wsdd file is packaged as part of the WAR.
You can modify the server-config.wsdd file in your WAR using the
Borland Deployment Descriptor Editor.
To Create a WAR that can be deployed to the web services archive:
WEB-INF/classes or WEB-INF/lib.WEB-INF/lib. The Axis libraries can be found in:
<install_dir>/lib/axisweb.xml necessary for the Axis tool kit to WEB-INF directory. The web.xml can be found in:
<install_dir>/etc/axisdeploy.wsdd that has deployment information about your web services.deploy.wsdd to generate the server-config.wsdd as follows:
<java org.apache.axis.utils.Admin server deploy.wsdd>
server-config.wsdd to WEB-INFUsing the Borland Enterprise Server Console, you can view the properties of any web service deployment descriptor (WSDD) that is packaged in a WAR file.
To view the server-config.wsdd file from the Borland Enterprise Server Console:
The property elements of the server-config.wsdd
file are mapped into a read-only layout.

When you select an element, any associated parameters are automatically displayed in the adjacent table. You can drill-down to view the Parameters of Element details.
For detailed information on these property elements,
refer to the Axis User's Guide in:<install_dir>\doc\axis\user-guide.html,
where install_dir is the Borland Enterprise Server installation
directory.

To view or modify the server-config.wsdd file using DDEditor:
The Borland Deployment Descriptor Editor appears.
The Open J2EE archive or descriptor window appears.

The raw server-config.wsdd file displays.

To help you get started with developing and deploying web services, we provide samples and examples for the Borland webservices engine. These examples are included in your Borland Enterprise Server 5.0.1 installation at:
<install_dir>/examples/webservices/
An example application, "Animal," illustrates the use of the three
web service providers: the Java Provider, the EJB Provider, and the VisiBroker Provider.
Each is located in the webservices examples directory in the Java, EJB,
or VisiBroker folder, respectively.
Your Borland Enterprise Server installation also includes several Apache Axis samples in:
<install_dir>/examples/webservices/axis/samples/
Borland Enterprise Server provides a web service, Animal, in three different forms that correspond to the three web service providers. The Animal application is a text-based "pet" that can speak (although its vocabulary is quite limited) and sleep. You are free to add your own methods to make your pet animal do other things, but sleeping and speaking should be adequate for most users.
Examples for the Borland Enterprise Server must be built before they are deployed and deployed before they are run. Building the examples involves generating the necessary WSDL files and packaging the application's code and descriptors into a deployable unit, in this case a WAR. This WAR can then be deployed to the Borland webservices Partition. The application is run by invoking its client from a command-line. Building and running the examples is automated through the use of the Apache Ant utility, while deployment is performed using tools provided with the Borland Enterprise Server.
/examples/webservices/ directory and execute the Ant command. For example:
C:\BorlandEnterpriseServer\examples\webservices>Ant
builds all the examples. To build an individual example, navigate to its specific directory and execute the Ant command. For example:
C:\BorlandEnterpriseServer\examples\webservices\java>Ant
builds only the Java Provider example.
If security is disabled on your server instance, type the following from the command prompt:
prompt>iastool -deploy -jars ejb/build/animal_ejb.war java/build/animal_java.war visibroker/build/animal_vb.war -server <server_name> -partition webservices -mgmtport <port_number>
prompt>iastool -deploy -jars ejb/build/animal_ejb.jar -server <your_server's_name> -partition standard -mgmt_port <port_number>
If you have security enabled on your server, you must provide a username, password, and server realm as a part of the iastool command syntax:
prompt>iastool -deploy -jars ejb/build/animal_ejb.war java/build/animal_java.war visibroker/build/animal_vb.war-server <server_name> -partition webservices -mgmtport <port_number> -user <user_name> -pwd <password> -realm <realm_name>
prompt>iastool -deploy -jars ejb/build/animal_ejb.jar -server <server_name> -partition standard -mgmt_port <port_number> -user <user_name> -pwd <password> -realm <realm_name>
You must include your server's name in both commands. The default management port number is 42424, unless you have changed it.
ant
run-client command. For example, to run the Java Provider client:
C:\BorlandEnterpriseServer\examples\webservices\java>Ant run-client
Or, to run the EJB Provider client:
C:\BorlandEnterpriseServer\examples\webservices\EJB>Ant run-client
To run the VisiBroker Provider client, two commands are needed, one to start the VisiBroker server, and one to run the client:
C:\BorlandEnterpriseServer\examples\webservices\visibroker>Ant run-server
C:\BorlandEnterpriseServer\examples\webservices\visibroker>Ant run-client
The Apache Axis web service samples are already deployed in the axis-samples.war
file present in the Borland webservices Partition. Since these are already pre-deployed,
you do not need to use the Apache Axis deploy commands suggested in the Apache
Axis User's Guide.
The Apache Axis User's Guide is also provided with your Borland Enterprise Server installation and is located in:
<install_dir>\doc\axis\user-guide.html
These samples illustrate the capabilities of the Axis tool. They are unmodified from the original Apache Axis implementation and are not guaranteed to run.