Situation
I am deploying web services with Apache CXF 2.6.2 on a Tomcat server. I export services using CXFServlet and the following Spring configuration:
<?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>
In my deployment example, the CXFServlet uses the relative path / service, and for example, the web service implemented by the TestImpl class is available as http://domain.com/tomcat-context/services/test The TestBean class has an installer for the endpoint and is installed by Spring .
goal
I want to determine the address (URL) that the test_endpoint endpoint provides in the TestBean class using the endpoint field. The result should be "http://domain.com/tomcat-context/services/test".
What i tried
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());
but the result is just
Address: /Sachbearbeiter Other Address: null Props: {}
How can I get the full URL? Is there a way without creating it myself?
source share