jboss seam webservice

csdn越来越坑 重庆市易联软件 其他  2015-08-17 11:58:33
1. Write POJO-based implementation of Web Service:
@WebService public class TestService
{
@WebMethod public String test(){ //.... }
}
2. POJO code location in the META-INF directory with standard-jaxws-endpoint-config.xml, as follows:
<jaxws-config xmlns="urn:jboss:jaxws-config:2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:javaee="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="urn:jboss:jaxws-config:2.0 jaxws-config_2_0.xsd">
<endpoint-config>
<config-name>Seam WebService Endpoint</config-name>
<pre-handler-chains>
<javaee:handler-chain> <javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol- bindings>
<javaee:handler> <javaee:handler-name>SOAP Request Handler</javaee:handler-name> <javaee:handler-class>org.jboss.seam.webservice.SOAPRequestHandler</javaee:handler-class>
</javaee:handler>
</javaee:handler-chain>
</pre-handler-chains>
</endpoint-config>
</jaxws-config>
3. Registered in web.xml
<!-- Web Service -->
<servlet>
<servlet-name>TestService Servlet</servlet-name>
<servlet-class>test.TestService</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>TestService Servlet</servlet-name>
<url-pattern>/TestService</url-pattern>
</servlet-mapping>
4. Configure Web Service to access Seam components in components.xml file needs to do to add the following configuration statement:
xmlns: web = "http://jboss.com/products/seam/web"
And
http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.0.xsd
In addition:
<web:context-filter url-pattern="/TestService/*"/>
5. WebService to access Seam components
TestSeamComp comp = (TestSeamComp) Component.getInstance("testSeamComp");
6. Access to the generated WSDL file
http://localhost:8080/jbossws/services



参照以上资料在一个seam框架的运用中添加webservice功能,但是在启动web服务器时报错:java.lang.ClassCastException: xxwebservice.TestService cannot be cast to javax.servlet.Servlet
...全文
95 点赞 收藏 2
写回复
2 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
csdn越来越坑 2015-08-17
引用 1 楼 shijing266 的回复:
test.TestService 说你的这个类不是一个Servlet
那该怎么做呢?实现servlet接口?
回复
test.TestService 说你的这个类不是一个Servlet
回复
相关推荐
发帖
Web 开发
创建于2007-09-28

8.0w+

社区成员

Java Web 开发
申请成为版主
帖子事件
创建了帖子
2015-08-17 11:58
社区公告
暂无公告