I have a perfectly working pair of demo servers / client applications using Spring (only!) - CXF or WSDL are not involved. It works with Apache Tomcat 7.0.34.
I was curious to find out if I could see any trace in her presence in the browser ( http://localhost:8080/ ), but I could not find any hint of the URL in the source code (copied verbatim from the tutorial).
Then I found this thread , which provided a way to get the endpoint URL:
TransportContext tc = TransportContextHolder.getTransportContext(); WebServiceConnection wc = tc.getConnection(); URI uri = wc.getUri();
I added this to my demo / tutorial client code, and while the first statement ( getTransportContext() ) throws no exception, it returns null , and so the second ( getConnection() ) throws a NullPointerException.
Why?
Clean Spring Servlets Don't Have Endpoint URLs?
If not, what am I missing? How can I get the service url?
I know that the client knows about the server using the context path and the bean identifier (as defined in general by beans.xml):
ClassPathXmlApplicationContext appContext = new ClassPathXmlApplicationContext( new String[] {"/sample/spring/beans.xml" } );
But isn't the URL equivalent to this? How do WSDLs do?
source share