On 04/08/2011 10:27, Simon Laws wrote:
On Wed, Aug 3, 2011 at 8:37 PM, Greg Dritschler
<greg.dritsch...@gmail.com>  wrote:
I have the following composites:
Composite A has a component reference myService with binding.sca uri="X".
  The reference is promoted.
Composite B has a component that uses A as its implementation.  It redefines
reference myService and specifies binding.sca uri="Y".
I get the error
[ASM50022] Too many targets on reference: myService
I've found that EndpointReferenceBuilderImpl.pushDownEndpointReferences() is
adding the endpoint references from the outer component reference to the
inner component reference.  This doesn't seem like it applies in this case.
  My understanding is that bindings configured on the outer component
reference override bindings that would otherwise have been inherited from
the promoted reference.  pushDownEndpointReferences() was introduced in
revision 833132 which says:
     "Fix motivated by ASM-5023. Update code to reflect the OASIS treatment
of promoted references. Endpoint references are now copied down to the
promoted component reference and the multiplicity validation is performed
there."
ASM-5023 uses reference target.  If I were using reference target instead of
binding uri, then I would agree I have an error (assuming multiplicity 0..n
or 1..n), since reference targets are additive.  But I'm not using reference
target.
Greg


Hi Greg

I think the only useful URI on a reference binding.sca is the name of
a target service. This is equivalent to specifying the same target
service via the target attribute. I think though that you're arguing
that the top level binding configuration should override the lower
level binding configuration?

Simon


Folks,

Let's be clear about the use of @uri on <binding.sca>.

IF you specify @target on the parent <binding> - then it is not valid to use 
<binding> subelements:

"If a reference has a value specified for one or more target services in its @target attribute, there MUST NOT be any child <binding/> elements declared for that reference. [ASM50026]"

(Section 4.3.1 Assembly spec)

so then IF you have a reference which allows multiple targets and you require a mixture of bindings, where some of them must be resolved bindings (eg reference is to an external web service known via its address) but others are desired to be <binding.sca>, then necessarily the only way of doing this is to use the @uri attribute on a <binding.sca> element:

<reference name="foo" multiplicity="1..n">
    <binding.sca uri="SomeComponent/SomeService"/>
    <binding.ws uri="http://something.com/another/service"/>
</reference>


Hope this makes things a bit clearer.

Yours,  Mike.

Reply via email to