On Wed, Mar 21, 2012 at 9:01 PM, Raymond Feng <[email protected]> wrote: > Hi, > > This change breaks the case where we use @target in the <reference> element > to wire components using non-SCA bindings. For example, the > RESTBindingInvoker uses the binding.uri to find out the target address. Since > now it's a clone, the value won't be updated when the service binding set the > deployed URI. > > A better fix is to retrieve the deployed URI from the target endpoint. >
I agree its irksome that simple local @target references can't rely on getting the service url set after its wired up but really that seems like it was only working previously by relying on the bug that the objects were shared. Getting the URI from the target endpoint isn't going to solve all the other problems that can happen when the Binding object is shared, the problem is that what information within a Binding can or can't be shared between the Endpoint and EndpointReference is difficult to determine and varies across binding impls - policy, databindings, really any of the binding fields - getting set by one side can easily overwrite what the other end had previously set. I can't yet see a better way to fix this than cloning the binding here. What about trying to fix the deployed service URI getting passed on to the reference by doing something with the EndpointRegistry so that setting the deployed URI on the service Endpoint in there gets its replicated to the reference side? ...ant
