Thanks for your answer Christian, I think your existing knowledge is correct
about it.

As I debugged more into the CXF Source code, I have found that a destination
is selected with the following method.
It first selects the most general endpoint and tries to find more specific
ones later.
But it does not recognize variables such as {id} on the URL template.

destPaths: [ /myendpoint, /myendpoint/{id}/subendpoint,
/myendpoint/{id}/othersubendpoint   ]
address: /myendpoint/42/subendpoint

... DestinationRegistryImpl {
...
     private AbstractHTTPDestination getRestfulDestination(Set<String>
destPaths, String address) {
        int len = -1;
        AbstractHTTPDestination ret = null;
        for (String path : destPaths) {
            String thePath = path.length() > 1 && path.endsWith(SLASH)
                ? path.substring(0, path.length() - 1) : path;
            if ((address.equals(thePath)
                || SLASH.equals(thePath)
                || (address.length() > thePath.length()
                    && address.startsWith(thePath) &&
address.charAt(thePath.length()) == '/'))
                && thePath.length() > len) {
                ret = getDestinationForPath(path);
                len = path.length();
            }
        }
        return ret;
    }
...
}

This returns always Destination related with "/myendpoint" for the given
inputs above, 
so this type of modularization does not seem to be possible with current
implementation.



--
Sent from: http://cxf.547215.n5.nabble.com/cxf-user-f547216.html

Reply via email to