1

Web アプリケーションを JBoss app-server にデプロイすると、Web サービスのデプロイに失敗します。私はトップダウン アプローチを使用しており、wsdl ファイルと xsd ファイルから wsconsume.bat を使用して必要なファイルを生成しています。次に、必要なアノテーションを Web サービスの実装クラスに追加します。しかし、これは私が得た限りではほとんどありません。ユーザー ガイドのドキュメントには、続行する方法が説明されていません。

jbossws-cxf.xml と web.xml でさまざまな設定を試しました。しかし、webserive は正しくデプロイできません。

誰かがいくつかの点を提案したり、私のユースケースを説明する参照実装に向けて私を指摘したりできますか?

4

1 に答える 1

4

それで、私はついにそれを機能させました。

秘訣は jbossws-cxf.xml-file を削除することです。web.xml には、webservice 実装クラスへのサーブレット マッピングが必要です。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 に答える