1

当我在 JBoss 应用服务器上部署我的 web 应用程序时,它无法部署 web 服务。我正在使用自上而下的方法,并使用 wsconsume.bat 从我的 wsdl 和 xsd 文件中生成必要的文件。然后,我将必要的注释添加到 web 服务实现类。但这几乎是我所得到的,用户指南中的文档未能描述我应该如何继续。

我在 jbossws-cxf.xml 和 web.xml 中尝试了不同的设置。但是 webserver 无法正确部署。

任何人都可以提出一些建议或将我指向描述我的用例的参考实现?

4

1 回答 1

4

所以我终于让它工作了。

诀窍是删除 jbossws-cxf.xml 文件。在 web.xml 中应该有一个到 web 服务实现类的 servlet 映射。然后自动生成 Jbossws-cxf.xml 文件并将其存储在 tmp 目录中。我建议检查这个文件,然后创建 jbossws-cxf.xml 以便可以应用定制。

简而言之,这是最简单形式的配置应如下所示:

WEB-INF/web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" 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_2_5.xsd">
<servlet>
  <servlet-name>ws-name</servlet-name>
  <servlet-class>org.company.WebServiceImpl</servlet-class>
</servlet>
<servlet-mapping>
  <servlet-name>ws-name</servlet-name>
  <url-pattern>/webservice/endpoint</url-pattern>
</servlet-mapping>
</web-app>

WEB-INF/Jbossws-cxf.xml:

<beans xmlns='http://www.springframework.org/schema/beans' 
        xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' 
        xmlns:beans='http://www.springframework.org/schema/beans' 
        xmlns:jaxws='http://cxf.apache.org/jaxws' 
        xmlns:soap='http://cxf.apache.org/bindings/soap' 
        xsi:schemaLocation='http://www.springframework.org/schema/beans 
        http://www.springframework.org/schema/beans/spring-beans.xsd 
        http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd'>
    <jaxws:endpoint id='ws-name' 
            address='http://127.0.0.1:8180/webservice/endpoint' 
            implementor='org.company.WebServiceImpl'>
        <jaxws:invoker>
            <bean class='org.jboss.wsf.stack.cxf.InvokerJSE'/>
        </jaxws:invoker>
    </jaxws:endpoint>
</beans>
于 2010-11-24T14:00:02.840 回答