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

发布于 2024-10-04 03:54:04 字数 262 浏览 0 评论 0原文

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

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

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

When I deploy my webapplication on a JBoss app-server it fails to deploy the webservice. I am using the top-down approach and generated the necessary files with wsconsume.bat from my wsdl- and xsd-files. I then add necessary anottations to the webservice implementation-class. But this is pretty much as far as I get, the documentation in the user guides fails to describe how I should continue.

I have experimented with different settings in the jbossws-cxf.xml and web.xml. But webserive fails to deploy correctly.

Anyone could suggest some points or point me towards a reference implementation that describes my use case?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

雨巷深深 2024-10-11 03:54:04

所以我终于让它发挥作用了。

诀窍是删除 jbossws-cxf.xml 文件。在 web.xml 中应该有一个到 webservice 实现类的 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>

So I finally got it to work.

The trick is to remove jbossws-cxf.xml-file. In web.xml there should be a servlet-mapping to the webservice implementation-class. Jbossws-cxf.xml-file is then automatically generated and stored in a tmp-directory. I advice to examine this file and then create the jbossws-cxf.xml so that customisation can be applied.

In short this is how a configuration in it's simpliest form should look like:

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>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文