BEA Logo BEA WebLogic Server Release 6.1

  BEA Home  |  Events  |  Solutions  |  Partners  |  Products  |  Services  |  Download  |  Developer Center  |  WebSUPPORT

 

  |  

  WebLogic Server Doc Home   |     Web Services   |   Previous Topic   |   Next Topic   |   Contents   |   Index   |   View as PDF

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.

 


Example of a build.xml File

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>

 


build.xml Hierarchy Diagram

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.

wsgen

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.

Table 6-1 wsgen Attributes

Attribute

Description

Required?

basepath

Location of the input Enterprise Application archive file (*.ear) or exploded directory that contains the EJB jar files for the EJB that implements the RPC-style Web services, as well as any supporting EJBs.

Be sure to specify the full pathname of the file or directory if it is not located in the same directory as the build.xml file.

Default value is null.

No.

destpath

Type and location of the output Enterprise Application archive. To create an actual Enterprise Application archive file (*.ear), specify the.ear suffix; to create an exploded Enterprise Application directory, specify a directory name.

Specify the full pathname of the file or directory if you do not want the Ant task to create the archive in the local directory.

Yes.

context

Context root of the Web services.

This value is part of the URL used to access the Web service.

Yes.

protocol

Protocol by which clients access the Web service.

There are two possible values: http or https.

The default value is http.

No.

host

Name of the host that is running the WebLogic Server instance that is hosting the Web service; for example, www.bea.com.

If you do not specify this attribute, the host in the WSDL JSP is generated from the hostname section of the URL used to retrieve the WSDL.

No.

port

Port number of WebLogic Server. Default value is 7001.

If you do not specify this attribute, the port in the WSDL JSP is generated from the port section of the URL used to retrieve the WSDL.

No.

webapp

URI that specifies the path to a Web Application module used to expose a Web service.

Default value is web-services.war.

No.

classpath

Semicolon-separated list of directories or JAR files that contain Java classes (such as utility classes) needed by the stateless session EJB that implements an RPC-style Web service.

No.

rpcservices

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.

Table 6-2 rpcservices Attributes

Attribute

Description

Required?

module

If the basepath attribute of the wsgen element is set, this attribute specifies the URI of the Enterprise Application module that corresponds to an EJB archive contained by the Enterprise Application archive.

Only if the basepath attribute of the wsgen element is set.

path

If the basepath attribute of the wsgen element is not set, this attribute specifies the location of an existing EJB archive that contains the EJBs, either archive as a *.jar file or as an exploded directory.

Only if the basepath attribute of the wsgen element is not set.

rpcservice

The rpcservice element specifies a specific RPC-style Web service.

This element does not have any sub-elements.

This element contains the following attributes.

Table 6-3 rpcservice 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

  • protocol refers to the protocol attribute of the wsgen element.

  • host refers to the hostname of the computer upon which the WebLogic Server hosting the service is running.

  • port refers to the port of WebLogic Server.

  • context refers to the context attribute of the wsgen element.

  • uri refers to this attribute.

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.

messageservices

The messageservices element is a container for any number of messageservice sub-elements.

This element does not have any attributes.

messageservice

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.

Table 6-4 messageservice 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

  • protocol refers to the protocol attribute of the wsgen element.

  • host refers to the hostname of the computer upon which the WebLogic Server hosting the service is running.

  • port refers to the port of WebLogic Server.

  • context refers to the context attribute of the wsgen element.

  • uri refers to this attribute.

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.

clientjar

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.

Table 6-5 clientjar Attributes

Attribute

Description

Required?

path

URI for the generated Java client JAR file that contains all the Java classes and interfaces needed to invoke the Web services.

Default value is client.jar.

No.

manifest

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.

entry

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.

Table 6-6 entry Attributes

Attribute

Description

Required?

name

Name of the additional header that will appear in the manifest file (MANIFEST.MF) of the generated Java client JAR file.

Yes.

value

Value of the additional header that will appear in the manifest file (MANIFEST.MF) of the generated Java client JAR file.

Yes.

 

back to top previous page next page