|
|
| |
build.xml Elements and Attributes
The build.xml file contains information that the wsgen Java Ant task uses to assemble Web services into Enterprise Application archive (*.ear) files.
The following sections provide an example build.xml file and describe its elements and attributes:
The build.xml file consists of a series of XML elements. Java Ant defines a variety of elements you can include in this file, such as project and target. This Appendix, however, describes only those elements that are part of the WebLogic-specific wsgen Java Ant task. For general information about Java Ant, see http://jakarta.apache.org/ant/index.html.
Note: The Java Ant utility included in WebLogic Server uses the ant (UNIX) or ant.bat (Windows) configuration files in the BEA_HOME\bin directory when setting the ANTCLASSPATH variable, where BEA_HOME is the directory in which WebLogic Server is installed. If you need to update the ANTCLASSPATH variable, make the appropriate changes to these files.
The following example shows a simple build.xml file used to assemble one RPC-style Web service and two message-style Web services:
<project name="myProject" default="wsgen"> <target name="wsgen"> <wsgen destpath="myWebService.ear" context="/myContext" protocol="http"> <rpcservices path="myEJB.jar"> <rpcservice bean="statelessSession" uri="/rpc_URI"/> </rpcservices> <messageservices> <messageservice name="sendMsgWS" action="send" destination="examples.soap.msgService.MsgSend" destinationtype="topic" uri="/sendMsg" connectionfactory="examples.soap.msgService.MsgConnectionFactory"/> <messageservice name="receiveMsgWS" action="receive" destination="examples.soap.msgService.MsgReceive" destinationtype="topic" uri="/receiveMsg" connectionfactory="examples.soap.msgService.MsgConnectionFactory"/> </messageservices> </wsgen> </target> </project>
The following diagram shows all the possible sub-elements of the wsgen element in the build.xml file, along with the element hierarchy. An asterisk (*) indicates that the element can be specified zero or more times.
Description of Elements and Attributes
The following sections describe build.xml elements and attributes.
The wsgen element is the name of the Ant task in the build.xml file. Its attributes specify information that is common to all Web services described in the file.
This element contains the following attributes.
The rpcservices element specifies an EJB archive that contains the stateless session EJB that implements the RPC-style Web service, as well as any supporting EJBs.
This element can have any number of rpcservice sub-elements that describe each individual RPC-style Web service.
This element contains the following attributes.
The rpcservice element specifies a specific RPC-style Web service.
This element does not have any sub-elements.
This element contains the following attributes.
Attribute |
Description |
Required? |
bean |
Name of the stateless session EJB that implements the RPC-style Web service. This name corresponds to the ejb-name element in the ejb-jar.xml file of the EJB archive in which the EJB is contained. The path to the EJB archive is specified in the parent rpcservices element. |
Yes. |
uri |
Part of the URL used by clients to invoke the Web service. The full URL to access the Web service is: [protocol]://[host]:[port][context][uri] where
For example, the URL that accesses the RPC-style Web service in the example in Example of a build.xml File is: http://www.myHost.com:7001/myContext/rpc_URI |
Yes. |
The messageservices element is a container for any number of messageservice sub-elements.
This element does not have any attributes.
The messageservice element describes a specific message-style Web service by specifying a JMS destination that will receive or send messages.
This element does not have any sub-elements.
This element contains the following attributes.
Attribute |
Description |
Required? |
name |
Name of the message-style Web service. |
Yes. |
destination |
JNDI name of a JMS topic or queue. |
Yes. |
destinationtype |
Type of JMS destination. Values: topic or queue. |
Yes. |
action |
Specifies whether the client that invokes this message-style Web service sends or receives messages to or from the JMS destination. Values: send or receive. Specify send if the client sends messages to the JMS destination and receive if the client receives messages from the JMS destination. |
Yes. |
connectionfactory |
JNDI name of the ConnectionFactory used to create a connection to the JMS destination. |
Yes. |
uri |
Part of the URL used by clients to invoke the Web service. The full URL to access the Web service is: [protocol]://[host]:[port][context][uri] where
For example, the URL that accesses the first message-style Web service in the example in Example of a build.xml File is: http://www.myHost.com:7001/myContext/sendMsg |
Yes. |
Use the clientjar element to specify the name for the generated Java client jar file. You can also use it specify other arbitrary files that you want to add to the generated Java client jar file.
This element can have one sub-element: manifest, as well as many filesets and zipfilesets elements. The filesets and zipfilesets elements are generic Ant elements, rather than wsgen-specific elements; use them to specify additional files that should be included in the Java client JAR file.
This element contains the following attributes.
The manifest element is a container for additional header entries to the manifest file (MANIFEST.MF) included in the generated Java client JAR file.
This element can have any number of entry sub-elements that describe the additional headers to the manifest file.
This element does not have any attributes.
The entry element specifies the name and value of an additional header to the manifest file (MANIFEST.MF) included in the generated Java client JAR file.
This element does not have any sub-elements.
This element contains the following attributes.
|
Copyright © 2001 BEA Systems, Inc. All rights reserved.
|