JBOSS set administrator(WAR file)
2011-11-24 11:17
746 查看
Last modified: 6/16/2005
The WAR Contents
Typically, one creates the WAR file with a GUI development tool or with the
For example, a sample WAR file starting from a WSDL file:
The
The
endpoint can have a optional handler-chain element
<handler-chain-name>somename</handler-chain-name>
<handler>
<handler-name>MyHandler</handler-name>
<handler-class>hello.MyHandler</handler-class>
</handler>
</handler-chain>
The
The following shows a
Remember these requirements when building a WAR:
WSDL and auxiliary WSDL, Schema files should be packaged under WEB-INF/wsdl dir. It is recommended that they need not be packaged when the service is started from Java
WebService implementation class should contain @WebService annotation. Provider based endpoints need not have @WebService annotation.
wsdl, service, port attributes for endpoint element are mandatory for Provider based endpoints.
The WAR Contents
Typically, one creates the WAR file with a GUI development tool or with the ant
wartask from the generated artifacts from
wsimport,
wsgen, or
apttools.
For example, a sample WAR file starting from a WSDL file:
WEB-INF/classes/hello/HelloIF.class SEI WEB-INF/classes/hello/HelloImpl.class Endpoint WEB-INF/sun-jaxws.xml JAX-WS RI deployment descriptor WEB-INF/web.xml Web deployment descriptor WEB-INF/wsdl/HelloService.wsdl WSDL WEB-INF/wsdl/schema.xsd WSDL imports this Schema
The sun-jaxws.xml
File
The <endpoints>element contain one or more
<endpoint>elements. Each endpoint represents a port in the WSDL and it contains all information about implementation class, servlet url-pattern, binding, WSDL, service, port QNames. The following shows a
sun-jaxws.xmlfile for a simple
HelloWorldservice. sun-jaxws.xml is the schema instance of sun-jaxws.xsd.
<?xml version="1.0" encoding="UTF-8"?> <endpoints xmlns="http://java.sun.com/xml/ns/jax-ws/ri/runtime" version="2.0"> <endpoint name="MyHello" [code] implementation="hello.HelloImpl"url-pattern="/
hello"/> </endpoints>
endpoint can have the following attributes
Attribute | Optional | Use |
name | N | Name of the endpoint |
wsdl | Y | Primary wsdl file location in the WAR file. For e.g. WEB-INF/wsdl/HelloService.wsdl. If this isn't specified, JAX-WS will create and publish a new WSDL. When the service is developed from Java, it is recommended to omit this attribute. |
service | Y | QName of WSDL service. For e.g. {http://example.org/}HelloService. When the service is developed from java, it is recommended to omit this attribute. |
port | Y | QName of WSDL port. For e.g. {http://example.org/}HelloPort. When the service is developed from Java, it is recommended to omit this attribute. |
implementation | N | Endpoint implementation class name. For e.g: hello.HelloImpl. The class should have @WebService annotation. Provider based implementation class doesn't have to have this annotation. |
url-pattern | N | Should match <url-pattern> in web.xml |
binding | Y | Binding id defined in the JAX-WS API. The possible values are:"http://schemas.xmlsoap.org/wsdl/soap/http", "http://www.w3.org/2003/05/soap/bindings/HTTP/" If omitted, it is considered SOAP1.1 binding. |
enable-mtom | Y | Enables MTOM optimization. true or false. Default is false. |
<?xml version="1.0" encoding="UTF-8"?> <endpoints ..."> <endpoint ...[code]><handler-chain>
<handler-chain-name>somename</handler-chain-name>
<handler>
<handler-name>MyHandler</handler-name>
<handler-class>hello.MyHandler</handler-class>
</handler>
</handler-chain>
</endpoint> </endpoints>
The web.xml
File
The following shows a web.xmlfile for a simple
HelloWorldservice. It specifies JAX-WS RI specific listener, servlet classes. These classes are com.sun.ws.transport.http.servlet.JAXRPCContextListener, and com.sun.xml.ws.transport.http.servlet.JAXRPCServlet is servlet
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/j2ee/dtds/web-app_2_3.dtd"> <web-app> <listener> <listener-class>com.sun.xml.ws.transport.http.servlet.JAXRPCContextListener</listener-class> </listener> <servlet> <servlet-name>hello</servlet-name> <servlet-class>com.sun.xml.ws.transport.http.servlet.JAXRPCServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>hello</servlet-name> <url-pattern>/hello</url-pattern> </servlet-mapping> <session-config> <session-timeout>60</session-timeout> </session-config> </web-app>
Remember these requirements when building a WAR:
WSDL and auxiliary WSDL, Schema files should be packaged under WEB-INF/wsdl dir. It is recommended that they need not be packaged when the service is started from Java
WebService implementation class should contain @WebService annotation. Provider based endpoints need not have @WebService annotation.
wsdl, service, port attributes for endpoint element are mandatory for Provider based endpoints.
相关文章推荐
- JBoss DeploymentFileRepository WAR Deployment
- weblogic部署项目:Cannot set web app root system property when WAR file is not expanded
- Cannot set web app root system property when WAR file is not expanded
- Cannot set web app root system property when WAR file is not expanded
- JBoss 6 发布WAR工程错误 Trying to resolve systemId as a non-file URL: xxxx 解决办法
- FileMessageSet分析
- java.lang.ClassCastException: org.jboss.logging.appender.DailyRollingFileAppender
- OSD&FileStore之CompatSet
- SetFileAttributes 功能:修改文件属性
- Tomcat:在部署war包的时候java.util.zip.ZipException: error in opening zip file
- Jboss 5/6 Reading/File Encoding Problem
- 启动HIVE 服务报错 HWI WAR file not found
- tomcat set bat file
- 你了解SetFilePointer吗?
- Maven之—— 打包编译出现File encoding has not been set问题
- SetFileAttributes
- eclipse下提交job时报错mapred.JobClient: No job jar file set. User classes may not be found.
- spring boot war 发布到jboss上之后 静态资源访问路径的处理
- python基础31[list+tuple+set+dict+str+file的成员方法]
- Windows API一日一练(56)SetEndOfFile和GetFileSizeEx函数