Defining an EJB web service with JBoss
Procedure
- Browse to the
<INSTALL_DIR>/repository/eardata/platform/webservices folder. Locate the
namedwebservices.xml.sample file. You can either directly rename the file or create
a copy and rename the file to namedwebservices.xml. Important: You must use the namedwebservices.xml file for editing.
- In namedwebservices.xml file, specify each API that you
want to expose as a web service in an Api/Name attribute.
- Property
- Description
- ServiceName
- The name of the service that you configured using the Service Definition Framework (SDF).
- ExposedName
- The name that is used in the Web Services Description Language (WSDL) file. This
is the name that is used to call the web service programmatically. When specifying a service name
for ExposedName, choose a literal that does not match any of the standard application API names.
The exposed name must start with a lower case letter.
- Set the properties necessary for your application
server in sandbox.cfg:
- Parameter
- Description
- JBOSS_DIR
- Set to the absolute path of the JBoss installation directory.
Required, if building EJB web services.
For JBoss only.
- WEBSERVICES_BUILDS
- Takes a comma-separated list that can include YIFWebService
and SIXBeanXapiJaxWS. Defaults to YIFWebService.
Required for EJB and JAX-WS web services, on all application servers.
- Save the file, navigate to the bin directory,
and run the setupfiles command:
- For UNIX/Linux: <INSTALL_DIR>/bin/setupfiles.sh
- For Windows: <INSTALL_DIR>\bin\setupfiles.cmd
- Create the EAR as described in Creating the EAR on JBoss. The web services defined in the file are built when you create the application EAR.
What to do next
Parent topic: EJB Web services overview