状況
Apache CXF 2.6.2 を使用して Web サービスを Tomcat サーバーにデプロイしています。CXFServlet と次の Spring ベースの構成を使用してサービスをエクスポートしています。
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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">
<import resource="classpath:META-INF/cxf/cxf.xml"/>
<import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>
<jaxws:endpoint id="test_endpoint"
implementor="org.xyz.TestImpl"
address="/test"/>
<bean id="testBean" class="org.xyz.TestBean">
<property name="endpoint" ref="test_endpoint" />
</bean>
</beans>
私の展開例では、CXFServlet は相対パス /service を使用しています。たとえば、TestImpl クラスによって実装された Web サービスは、http ://domain.com/tomcat-context/services/test として利用できます 。TestBean クラスには、エンドポイント用のセッターがあり、それはSpringによって設定されます。
ゴール
endpoint フィールドを使用して、クラス TestBean のエンドポイント test_endpoint によって提供されるアドレス (URL) を特定したいと考えています。結果は正確に「http://domain.com/tomcat-context/services/test」になるはずです。
私が試したこと
log.info("Endpoint set to " + endpoint);
log.info("Address: " + endpoint.getAddress());
org.apache.cxf.jaxws.EndpointImpl ep = (org.apache.cxf.jaxws.EndpointImpl) endpoint;
log.info("Other Address: " + ep.getBindingUri());
log.info("Props: " + ep.getProperties());
しかし、結果はただ
Address: /Sachbearbeiter
Other Address: null
Props: {}
完全な URL を取得するにはどうすればよいですか? 自作せずに方法はありますか?