cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glen Mazza <gma...@talend.com>
Subject Re: Published endpoint URL
Date Wed, 05 Oct 2011 17:59:46 GMT
publishedEndpointURL is just meant for declaring what the endpoint URL 
will be in the WSDL that is served when the client requests it using the 
?wsdl tag.  It does *not* change any actual semantics such as the real 
endpoint URL.  It's not often needed but helpful when you have an http 
server in front of the web service (which knows how to route the web 
service to its actual endpoint URL) that you want to have clients use 
when making the SOAP call.

To actually alter the endpoint URL, that's done via the normal 
Endpoint.publish() for embedded services or via note #2 here: 
http://www.jroller.com/gmazza/entry/web_service_tutorial#notes for 
standalone servlet containers.

HTH,
Glen

On 10/05/2011 12:42 PM, David Sills wrote:
> 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
>


-- 
Glen Mazza
Talend - http://www.talend.com/apache
Blog - http://www.jroller.com/gmazza
Twitter - glenmazza


Mime
View raw message