Before using the EJB2WebService tool, you must set up the Web services command line as follows:
Now, you can use the EJB2WebService tool to create a Web service with an exported EAR file.
To create a Web service using the EJB2WebService tool, enter the following in the command prompt:
Note: <EJB.ear> must be the final argument. See The EJB2WebService tool for a list of optional and mandatory arguments.
This is an example of how to use the EJB2WebService tool:
EJB2WebService -host localhost:9080 -ri MyEJB.remoteInterface -project MyEJBProject MyEJB.ear
The main output of the EJB2WebService tool is a modified version of the original EAR file called <ProjectName>EAR.ear in the root of the generated directory structure. The META-INF directory is also generated under <ProjectName>. This directory holds the generated WSDL file, Java™ classes, and so on. If you do not specify the -server-side-only argument, a client-side directory that contains some extra Java files, including serializer and deserializer classes for your complex types, will also be created.
Once you have generated an EAR file, you can deploy it to a server to make it available to others.