Java 如何在web应用程序中部署JbossWS CXF

Java 如何在web应用程序中部署JbossWS CXF,java,web-services,cxf,jbossws,Java,Web Services,Cxf,Jbossws,当我在JBoss应用服务器上部署我的webapplication时,它无法部署webservice。我正在使用自顶向下的方法,并使用wsconsume.bat从wsdl和xsd文件生成必要的文件。然后,我向webservice实现类添加必要的附加。但就我所知,用户指南中的文档没有描述我应该如何继续 我在jbossws-cxf.xml和web.xml中尝试了不同的设置。但是webserive无法正确部署 任何人都可以向我提出一些建议,或者向我指出一个描述我的用例的参考实现?所以我终于让它开始工作了

当我在JBoss应用服务器上部署我的webapplication时,它无法部署webservice。我正在使用自顶向下的方法,并使用wsconsume.bat从wsdl和xsd文件生成必要的文件。然后,我向webservice实现类添加必要的附加。但就我所知,用户指南中的文档没有描述我应该如何继续

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


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

所以我终于让它开始工作了

诀窍是删除jbossws-cxf.xml-file。在web.xml中,应该有一个到webservice实现类的servlet映射。Jbossws-cxf.xml-file然后自动生成并存储在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>

ws-name
org.company.webserviceinpl
ws-name
/Web服务/端点
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>

所以我终于让它开始工作了

诀窍是删除jbossws-cxf.xml-file。在web.xml中,应该有一个到webservice实现类的servlet映射。Jbossws-cxf.xml-file然后自动生成并存储在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>

ws-name
org.company.webserviceinpl
ws-name
/Web服务/端点
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>


Hi,我可以知道生成jbossws-cxf.xml的路径吗?我选中了/standalone/tmp/vfs/temp[some random string]/[mywarfilename]-[some random string]/但没有创建WEB-INF/jbossws-cxf.xml.slbb-如果您将其与应用程序打包,我可以知道生成的jbossws-cxf.xml是从哪个路径获得的吗?我选中了/standalone/tmp/vfs/temp[一些随机字符串]/[mywarfilename]-[some random string]/但没有WEB-INF/jbossws-cxf.xml created there.slbb-您可以将其与应用程序打包