uCosminexus Application Server, Web Service Development Guide
You can use the EJB Web Service invoke functionality in a configuration where the EAR files do not include the WAR file for settings. However, to use the Application Server functionality where the specification of WAR file is required, you can include the WAR file for settings in the EAR file. The following subsections describe about the WAR file for settings.
When EJB JAR file is included in EAR file, and EJB Web Service Implementation Class is included in EJB JAR file, the JAX-WS engine operates assuming that the WAR file for settings is also included. The following table describes the configuration of the assumed WAR file for settings:
Table 3-3 Configuration of assumed WAR file for settings
| Directory | Remarks | ||
|---|---|---|---|
| / | -- | ||
| WEB-INF/ | -- | ||
| web.xml | See 3.5.4(4) | ||
| META-INF/ | -- | ||
When invoking the EJB Web Service Implementation Class, if you want to concurrently perform additional settings to web.xml such as applying the servlet filter functionality, store the created web.xml in the WAR file for settings and include the file in the EAR file. The following table describes the configuration of WAR file for settings. Note that the WAR files for settings have naming rules. For the file name of WAR file for settings, see 3.5.4(3) Name of the WAR file for settings.
Table 3-4 Configuration of WAR file for settings
| Directory | Remarks | ||
|---|---|---|---|
| / | -- | ||
| WEB-INF/ | -- | ||
| classes/ | Stores the compiled Java classes. When using the filter, store the filter of the Java class in this directory.# | ||
| lib/ | Stores the JAR files that include the compiled Java classes. When using the filter, store the JAR file including the Java class of the filter in this directory.# | ||
| web.xml | See 3.5.4(4). | ||
| META-INF/ | -- | ||
If the WAR file for settings is included in the EAR file, the name of the WAR file for settings for EJB Web Service must be same as the file name specified in the webserver.container.jaxws.webservice.wsee.warname property of the User Property file (usrconf.properties) for J2EE server.
If WAR file for settings is not included in the EAR file, the operation is executed assuming that the WAR file for settings with the file name specified in the webserver.container.jaxws.webservice.wsee.warname property is included. When WAR file for settings is not included in the EAR file, a message is output in the J2EE server log. You can thereby confirm the assumption that the JAX-WS engine includes the WAR file for settings (KDJE42391-I). If this message is not output, you can check whether the WAR file for settings specified in the property is included in the EAR file.
Note that the default value of the property is CosminexusWSEE.war.
You can use the following settings for invoking the EJB Web Service. To use these settings, include the WAR file for settings in the EAR file and specify the name of the WAR file for settings.
This subsection describes the web.xml that is included in the WAR file for settings of EJB Web Service.
When creating web.xml, specify the file name as web.xml and save directly below the WEB-INF directory configuring the WAR files. Whether the saving of the web.xml file is mandatory differs depending upon the value set in the webserver.container.jaxws.webservice.no_webxml.enabled property of the User Property file for J2EE server (usrconf.properties).
The following subsections describe the operations when web.xml is not included in the WAR file for settings and the operations when web.xml is included in the WAR file for settings.
If you specify strict or lax in setup value of the webserver.container.jaxws.webservice.wsee.no_webxml.enabled property and do not include the web.xml in the WAR file for settings of the EJB Web Service, the processing is performed considering that the web.xml with the following contents exist while invoking the Web Service.
<?xml version="1.0" encoding="UTF-8"?>
<!-- code the web-app element-->
<description>Cosminexus JAX-WS Default web.xml</description>
<display-name>Cosminexus_JAX_WS_Default_web_xml</display-name>
<listener>
<listener-class>
com.cosminexus.xml.ws.transport.http.servlet.EJBWSServletContextListener
</listener-class>
</listener>
<servlet>
<description>EJB Endpoint servlet for Cosminexus JAX-WS</description>
<display-name>EJB_Endpoint_servlet_for_Cosminexus_JAX_WS</display-name>
<servlet-name>CosminexusJaxwsEjbServlet</servlet-name>
<servlet-class>
com.cosminexus.xml.ws.transport.http.servlet.EJBWSServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>CosminexusJaxwsEjbServlet</servlet-name>
<url-pattern>"/" + Service name of Web Service 1 + "/" + Class name of Web Service 1</url-pattern>
<url-pattern>"/" + Service name of Web Service 2 + "/" + + Class name of Web Service 2</url-pattern>
:
<url-pattern>"/" + Service name of Web Service n + "/" + Class name of Web Service n</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>60</session-timeout>
</session-config>
</web-app>
|
For "/" + Service-name-of-Web-Service-1 + "/" + Class-name-of-Web-Service-1 in the url-pattern element, a string with / (forward slash) added as a prefix is defined in the value of the serviceName attribute and the name attribute of the javax.jws.WebService annotation for the Web Service Implementation Class.
Operations for all the Web Service Implementation Classes stored in the WAR file for settings are performed assuming that the url-pattern element exists.
If you specify strict in the webserver.container.jaxws.webservice.wsee.no_webxml.enabled property and include the web.xml in the WAR file, or if you specify none, create web.xml so that the following conditions are fulfilled:
<listener>
<listener-class>
com.cosminexus.xml.ws.transport.http.servlet.EJBWSServletContextListener
</listener-class>
</listener>
|
<servlet>
<description>EJB Endpoint servlet for Cosminexus JAX-WS</description>
<display-name>EJB_Endpoint_servlet_for_Cosminexus_JAX_WS</display-name>
<servlet-name>CosminexusJaxwsEjbServlet</servlet-name>
<servlet-class>
com.cosminexus.xml.ws.transport.http.servlet.EJBWSServlet
</servlet-class>
</servlet>
|
<servlet-mapping>
<servlet-name>CosminexusJaxwsEjbServlet</servlet-name>
<url-pattern>"/" + Service name of Web Service 1 + "/" + Class name of Web Service 1</url-pattern>
<url-pattern>"/" + Service name of Web Service 2 + "/" + Class name of Web Service 2</url-pattern>
:
<url-pattern>"/" + Service name of Web Service n + "/" + Class name of Web Service n</url-pattern>
</servlet-mapping>
|
The following is an example of web.xml that is included in WAR file for settings of EJB Web Service:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<description>Cosminexus JAX-WS Default web.xml</description>
<display-name>Cosminexus_JAX_WS_Default_web_xml</display-name>
<listener>
<listener-class>
com.cosminexus.xml.ws.transport.http.servlet.EJBWSServletContextListener
</listener-class>
</listener>
<servlet>
<description>EJB Endpoint servlet for Cosminexus JAX-WS</description>
<display-name>EJB_Endpoint_servlet_for_Cosminexus_JAX_WS</display-name>
<servlet-name>CosminexusJaxwsServlet</servlet-name>
<servlet-class>
com.cosminexus.xml.ws.transport.http.servlet.EJBWSServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>CosminexusJaxwsServlet</servlet-name>
<url-pattern>/AddNumbersImplService/AddNumbersImpl</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>60</session-timeout>
</session-config>
</web-app>
|
When creating web.xml of version 2.5, specify 2.5 in the version attribute of the web-app element and specify http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd as the second location information in the xsd:schemaLocation attribute.
In this example, it is assumed that the value of the serviceName attribute of the javax.jws.WebService annotation for the Web Service Implementation Class is AddNumbersImplService and the value of the name attribute is AddNumbersImpl.
The operations cannot be guaranteed when lax is set in the webserver.container.jaxws.webservice.wsee.no_webxml.enabled property and web.xml is included in the WAR file for settings, and listener, servlet, servlet-mapping, or any other element is not completely included.
All Rights Reserved. Copyright (C) 2013, Hitachi, Ltd.