PDA

View Full Version : Replacing the context name with WsdlDefinitionHandlerAdapter



res1st
Oct 23rd, 2007, 09:25 AM
Hi,

i need for testing purposes a quick fix for the
org.springframework.ws.transport.http.WsdlDefiniti onHandlerAdapter.

Right now, it places the "location" in WSDL-File with the server name of the HTTP request object. That was very well done, Arjen. :)

I need the feature which replaces a String with the currect context name. Example:
WSDL content:
location="http://localhost:8080/#CONTEXTNAME#/services"

Replaced at runtime with:
location="http://localhost:8080/aim1/services"
or
location="http://localhost:8080/aim2/services"
or
location="http://localhost:8080/aimPerfTest/services"

It is necessary to deploy more than 1 server version to one (tomcat) server.
I think that it should not be much work, but i don't understand how the
WsdlDefinitionHandlerAdapter works.

I think it is also interesting for other users.
What do you think Arjen?

Ingo

ralph.poellath
Oct 23rd, 2007, 12:32 PM
If you just specify location="/services" in WSDL, the resulting URL should be "currentscheme://currenthostname:currentport/currentcontext/services".

Wouldn't that be sufficient for your needs?

Cheers,
-Ralph.

res1st
Oct 24th, 2007, 03:03 AM
Thank you Ralph!
It is fully sufficient. :)

Arjen should add it to the SWS documentation.

Ingo

ralph.poellath
Oct 24th, 2007, 04:01 AM
Glad I could help. This seems to be a minor bug in the JavaDocs (http://static.springframework.org/spring-ws/site/apidocs/org/springframework/ws/transport/http/WsdlDefinitionHandlerAdapter.html#transformLocatio n(java.lang.String,%20javax.servlet.http.HttpServl etRequest)):

It says:

If the given location ... is a relative url, the scheme, server name, and port are prepended.

It should say:

If the given location ... is a relative url, the scheme, server name, port and context path are prepended.

You might want to raise an issue in SWS Jira (http://opensource.atlassian.com/projects/spring/browse/SWS).

Cheers,
-Ralph.