Hi Aki On Wed, May 11, 2011 at 1:53 PM, Aki Yoshida <[email protected]> wrote: > Hi Sergey, > I think it will be slightly complicated to describe the logic in a > short sentense. > As I see, we need to make sure the matching works for the following cases. > > Suppose we have the registered services at > "/soap", "/soap2", "/soappath", "/soap/test". > > we should have the matching match(address) -> the registered path with > > match("/soap") -> "/soap" > match("/soap/2") -> "/soap" > match("/soap/") -> "/soap" > match("/soap2") -> "/soap2" > match("/soap3") -> null > match("/soap/test") -> "/soap/test" > match("/soap/tst") -> "/soap" > > Basically, we need to check if the address is identical to the path or > starts with the path + "/". > A special case is when the address ends with an "/" as in the third > case above, which needs to be matched against the path using only the > part preceeding to the "/". > > I'll create a jira ticket and suggest a possible solution. > Sounds good
> In addition, we might still need an exact matching option if people > are not happy with the call to "/soap/test" suddenly forwarded to > "/soap" as in the last case intead of getting rejected when we > unregister the service at "/soap/test". Or is this behavior accepted > or even expected? I think we can live with this behavior, but I am not > sure what others think. > I agree, I briefly referred to it, it should be possible to configure either CXFServlet or individual endpoint for a strict match policy be enforced. May be if we have a servlet parameter in place then the policy is global and applies to all of the endpoints, and if it's an endpoint property then it applies to a particular Destination only ? thanks, Sergey > regards, aki > > 2011/5/11 Sergey Beryozkin <[email protected]>: >>> >>> Aki, in the code you posted, >>> >>> for (String path : getDestinationsPaths()) { >>> if (address.startsWith(path) >>> && path.length() > len) { >>> ret = getDestinationForPath(path); >>> len = path.length(); >>> } >>> } >>> >>> It should probably be just >>> >>> if (path.startsWith(adddress) >>> >>> That will make sure /soapaddress destinations won't catch >>> /soapaddress2 requests but will /soapaddress/1. >>> >> Sorry, I got confused, the above suggestion is also incorrect :-). >> >> Given /soapaddress2 and destination address /soapaddress, >> path.startsWith(adddress) would fix it but we'd get /soapaddress >> delivered to /soapaddress2 destinations, so as you suggested, the >> address (/soapaddress2 or /soapaddress2/2) has to be split into >> segments and the first segment needs to match exactly the endpoint >> address, that should probably work, what do you think ? >> >> thanks, Sergey >> >
