On 5/11/07, Jean-Sebastien Delfino <[EMAIL PROTECTED]> wrote:
Jean-Sebastien Delfino wrote: > Raymond Feng wrote: >> ComponentReference.getReference() should give you the reference on >> the component type. >> >> Thanks, >> Raymond >> > > ComponentReference.getReference() will give you the reference from the > ComponentType. I think that Ant is looking for the CompositeReference > promoting the ComponentReference, and the interface that it declares. > I think this issue is only on the reference side, on the service side > we create a ComponentService with the characteristics of each > CompositeService. We may have to follow the same pattern as for > ComponentReferences and CompositeReferences. I'll dig into this a > little more and should come back with a proposal to address this later > today. > >> ----- Original Message ----- From: "ant elder" <[EMAIL PROTECTED]> >> To: <[email protected]> >> Sent: Friday, May 11, 2007 8:29 AM >> Subject: Re: How to get to the <interferface> defined on a >> <reference> from the <binding>? >> >> >>> I didn't think so as the RuntimeComponentReference instance passed >>> in to the >>> createReferenceBindingProvider method has the InterfaceContract of the >>> component's reference not the interface inside the <reference>. >>> Maybe thats >>> just a bug? >>> >>> You can see this if you change sample-helloworld-ws-reference >>> helloworldwsclient.composite to use the interface.wsdl from the >>> previous >>> email and then with a break point at >>> Axis2BindingProviderFactory.createReferenceBindingProvider (or >>> anywhere else >>> in the Axis2 binding code), I couldn't find anything pointing to the >>> WSDL >>> interface. >>> >>> ...ant >>> >>>> >>> On 5/11/07, Raymond Feng <[EMAIL PROTECTED]> wrote: >>>> >>>> Hi, >>>> >>>> Do the following methods give you enough information? >>>> >>>> ReferenceBindingProvider<M> >>>> createReferenceBindingProvider(RuntimeComponent >>>> component, RuntimeComponentReference reference, M binding); >>>> ServiceBindingProvider<M> >>>> createServiceBindingProvider(RuntimeComponent >>>> component, RuntimeComponentService service, M binding); >>>> >>>> The binding class should be able to take the interface contracts >>>> from the >>>> service/reference when the binding providers are created. >>>> >>>> Thanks, >>>> Raymond >>>> >>>> ----- Original Message ----- >>>> From: "ant elder" <[EMAIL PROTECTED]> >>>> To: <[email protected]> >>>> Sent: Thursday, May 10, 2007 7:28 AM >>>> Subject: How to get to the <interferface> defined on a <reference> >>>> from >>>> the >>>> <binding>? >>>> >>>> >>>> > I'm trying to get <binding.ws> to work without specifying all the >>>> WSDL >>>> > info, >>>> > for example like this: >>>> > >>>> > <reference name="HelloWorldService" >>>> > promote="HelloWorldServiceComponent/helloWorldService"> >>>> > <interface.wsdl interface=" >>>> > http://helloworld#wsdl.interface(HelloWorld)" /> >>>> > <binding.ws > >>>> uri="HelloWorldServiceComponent/HelloWorldWebService" >>>> > /> >>>> > </reference> >>>> > >>>> > but i can't find any way to get to the whats defined in the >>>> <interface> >>>> > element of the <reference>. None of the runtime objects seem to >>>> have > any >>>> > link back to the references InterfaceContract. >>>> > >>>> > Should this be possible? >>>> > >>>> > ...ant >>>> > >>>> After investigating this issue a bit more. Here's some thoughts and a proposal: - We currently push the bindings specified on composite references down to the component reference that they promote. We should push the interface contract defined on the composite reference as well, as it defines the actual contract that needs to be used on the wire to a target component. - Code that injects references into a component implementation should be changed to use the interface of the reference declare in the component type instead of the component reference, as the object injected into the implementation really needs to comply with that interface, and not any other matching interface declared on the component reference or any of the composite references that promote it. With these two changes, in your particular scenario: - componentReference.getInterfaceContract() will return the WSDL interface. This is what you want to use to talk on the wire. - componentReference.getReference().getInterfaceContract() returns the interface contract expected by the component implementation. Component reference injection needs to use this one (we'll have to adjust the Java and Script implementations to do that), this will ensure that the component implementation gets exactly what it said it required. Makes sense?
+1, sounds good to me. ...ant
