Spring には、Web サービスを宣言する単純化された方法があります (cxf を使用)。
ルートタグに追加applicationContext.xml
する( ) とxmlns:jaxws="http://cxf.apache.org/jaxws"
<beans>
http://cxf.apache.org/core
http://cxf.apache.org/schemas/core.xsd
http://cxf.apache.org/jaxws
http://cxf.apache.org/schemas/jaxws.xsd
あなたにschemaLocation
それから加えて:
<!-- Loading CXF modules -->
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
最後に、WebService 実装を宣言します。
<jaxws:endpoint id="MyWebService" implementor="#MyWebServiceImpl"
address="/myWebServiceAddress" />
#MyWebServiceImpl
Bean の ID はどこにありますか。他の Spring 依存関係をその Bean に自由に注入できます。
次に、Web サービスにアクセスできるようになりますhttp://yourhost/cxfuri/myWebServiceAddress
(cxfuri は CXF サーブレットのマッピングです)。