All:
I'm not sure how to move forward on this or whether I'm doing this all
wrong and could use a suggestion. Ideas?
The code in FormattedServiceListWriter seems to have an issue. I am
specifying in my Spring configuration the property publishedEndpointUrl:
<jaxws:endpoint
id="fingerprintService"
implementor="#fingerprintServiceBean"
address="/FingerprintService"
publishedEndpointUrl="https://dsills-t1500:8300/dsi-services/secure/Fing
erprintService"
/>
I so this because I want it clear how the service is to be addressed.
The code in the list writer, however, doesn't work for me:
private String getAbsoluteAddress(String basePath,
AbstractDestination d) {
String endpointAddress =
(String)d.getEndpointInfo().getProperty("publishedEndpointUrl");
if (endpointAddress != null) {
return endpointAddress;
}
endpointAddress = d.getEndpointInfo().getAddress();
*** if (basePath == null || endpointAddress.startsWith(basePath)) {
return endpointAddress;
} else {
return basePath + endpointAddress;
}
}
This produces:
http://dsills-t1500:9090/dsi-serviceshttps://dsills-t1500:8300/dsi-servi
ces/secure/FingerprintService
which is obviously nonsense.
Perhaps this might help?:
*** if (basePath == null || endpointAddress.startsWith(basePath) ||
isValidURL(endpointAddress)) {
...
where isValidURL is something like:
private boolean isValidURL(String endpointAddress)
{
if (endpointAddress.indexOf("://") != -1)
{
try
{
URL url = new URL(endpointAddress);
}
catch (MalformedURLException e) { }
}
return false;
}
Of course, you may already have a utility that can do this as well - I
don't know the whole codebase, but it's just an idea.
David Sills