tuscany-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Sebastien Delfino <jsdelf...@apache.org>
Subject Re: Databinding mediation between part-based and doc-wrapped operations
Date Tue, 11 Jan 2011 19:17:41 GMT
On 01/11/2011 08:57 AM, Simon Laws wrote:
> Sorry that my example wasn't clear. I had set up the following composite...
>
>
> <composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
>    xmlns:t="http://tuscany.apache.org/xmlns/sca/1.1"
>    targetNamespace="http://test"
>    name="testnativeasyncbare">
>
>      <component name="SampleNativeAsyncReference">
>          <t:implementation.sample
> class="sample.UpperSampleAsyncReferenceBareImpl"/>
>          <reference name="upper" target="SampleNativeAsyncService">
>              <interface.wsdl
> interface="http://sample/upper-async-wrapped#wsdl.interface(UpperWrapped)"/>
>          </reference>
>      </component>
>
>      <component name="SampleNativeAsyncService">
>          <t:implementation.sample
> class="sample.UpperSampleAsyncServiceWrappedImpl"/>
>      </component>
>
> </composite>
>
> With the interface the "upper" reference in
> UpperSampleAsyncReferenceBareImpl defined as bare WSDL as follows
>
>      <wsdl:types>
>          <schema elementFormDefault="qualified"
>                  targetNamespace="http://sample/upper-async-bare"
>                  xmlns="http://www.w3.org/2001/XMLSchema">
>              <element name="arg0" type="xsd:string" />
>              <element name="arg1" type="xsd:string" />
>
>              <element name="result" type="xsd:string" />
>          </schema>
>      </wsdl:types>
>
>      <wsdl:message name="upperRequest">
>          <wsdl:part element="tns:arg0" name="arg0" />
>          <wsdl:part element="tns:arg1" name="arg1" />
>      </wsdl:message>
>
>      <wsdl:message name="upperResponse">
>          <wsdl:part element="tns:result" name="result" />
>      </wsdl:message>
>
> While the interface on the reference in the composite is, as you can
> see, defined by the wrapped WSDL as follows
>
>      <wsdl:types>
>          <schema elementFormDefault="qualified"
>                  targetNamespace="http://sample/upper-async-wrapped"
>                  xmlns="http://www.w3.org/2001/XMLSchema">
>              <element name="upper">
>                  <complexType>
>                      <sequence>
>                          <element name="arg0" type="xsd:string" />
>                          <element name="arg1" type="xsd:string" />
>                      </sequence>
>                  </complexType>
>              </element>
>
>              <element name="upperResponse">
>                  <complexType>
>                      <sequence>
>                          <element name="result" type="xsd:string" />
>                      </sequence>
>                  </complexType>
>              </element>
>
>          </schema>
>      </wsdl:types>
>
>      <wsdl:message name="upperRequest">
>          <wsdl:part element="tns:upper" name="parameters" />
>      </wsdl:message>
>
>      <wsdl:message name="upperResponse">
>          <wsdl:part element="tns:upperResponse" name="parameters" />
>      </wsdl:message>
>
> As per previous discussion on this thread I would expect databinding
> to wrap the parameters from the implementation as per the wrapped
> WSDL. However this falls foul of the following test in
> Input2InputTransfomer
>
> if ((!sourceWrapped&&  !sourceBare)&&  targetWrapped) {
>      ...
> }
>
> This code inside the if does the wrapping but we don't go in as the
> bare WSDL of the source sets sourceBare = true.
>
> Having talking to Scott off line it seems that this test of
> !sourceBare (added for TUSCANY-2398) was specifically added to cater
> for the case where you've marked a Java interface operation as being
> bare using annotations. In this case you're saying that the interface
> may look like a wrapped interface but it isn't really so don't do any
> wrapping regardless of whether you think you need to or not.
>
> Be useful to get some confirmation of the details.
>
> It would seem then that what we really need is a flag that tells us
> about this special case rather than relying on testing whether a
> wrapper is present. Hoping the experts will comment on the
> practicalities.
>
> Regards
>
> Simon

OK I understand your example better now. Looks like you did (a):
'rpc' implementation reference + 'wrapped' reference in composite

That's slightly different from I did (b):
'rpc' implementation reference + 'wrapped binding in composite

With (a) I would have expected a validation error like: 'your two 
definitions of that Upper interface don't match', vs in (b) a 
negotiation (and databinding transformation) between the 'rpc' reference 
and the 'wrapped' binding.

Shouldn't (a) just report a validation error?

Or does the spec allow an <interface> element to alter the style of 
interface of a component implementation like you did in (a)?

If combination (a) is allowed, what interface do you expect to get from 
ComponentReference.getInterfaceContract().getInterface()?

-- 
Jean-Sebastien

Mime
View raw message