第3章 サーバーサイド統合カスタマイズ
JBossWS-CXF を使用すると、JBossWS-Native の場合と同様にアーカイブを提供することにより、Web サービスエンドポイントをデプロイできます。ただし、CXF 設定ファイルをエンドポイントデプロイメントアーカイブに組み込むことによって JBossWS および CXF 統合をカスタマイズできます。要件は以下のとおりです。
- ファイル名は
jbossws-cxf.xml
である必要があります。 - POJO デプロイメントの場合は、
WEB-INF
ディレクトリに含まれます。 - EJB3 デプロイメントの場合は、
META-INF
ディレクトリに含まれます。
ユーザーが独自の CXF 設定ファイルを提供しない場合は、実行時にデフォルトの設定ファイルが自動的に生成されます。POJO デプロイメントの場合、生成された
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' 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'> <!-- one or more jaxws:endpoint POJO declarations --> <jaxws:endpoint id='POJOEndpoint' address='http://localhost:8080/pojo_endpoint_archive_name' implementor='my.package.POJOEndpointImpl'> <jaxws:invoker> <bean class='org.jboss.wsf.stack.cxf.InvokerJSE'/> </jaxws:invoker> </jaxws:endpoint> </beans>
EJB3 デプロイメントの場合、生成された
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' 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'> <!-- one or more jaxws:endpoint EJB3 declarations --> <jaxws:endpoint id='EJB3Endpoint' address='http://localhost:8080/ejb3_endpoint_archive_name' implementor='my.package.EJB3EndpointImpl'> <jaxws:invoker> <bean class='org.jboss.wsf.stack.cxf.InvokerEJB3'/> </jaxws:invoker> </jaxws:endpoint> </beans>
ユーザーが標準的な JAX-WS 仕様の一部でない機能を使用する場合は、カスタム CXF 設定をエンドポイントデプロイメントに提供することが役に立ちます (CXF はこれらの機能を実装します)。詳細については、8章WS-Reliable Messaging チュートリアル を参照してください。カスタム CXF エンドポイント設定を提供してエンドポイントの WS-RM 機能を有効にします。
注記
ユーザーが独自の CXF 設定をエンドポイントアーカイブに組み込む場合は、各 JAX-WS エンドポイントの
org.jboss.wsf.stack.cxf.InvokerJSE
または org.jboss.wsf.stack.cxf.InvokerEJB3 JAX-WS
起動プログラム Bean を参照する必要があります。