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 Wed, 12 Jan 2011 03:33:34 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.

That's what I've observed too. In the test case at [1] both 'wrapped' 
and 'bare' are false for the UpperTest target interface, which is 
annotated Java.

>
> 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.
>

Good news though! After fixing two errors in EmbedTestCase and WelloTest 
(see changes in SVN revision r1057980 [1]), the tests in [2] run 
successfully.

I can now confirm Raymond's initial assessment:

- Databinding mediation happens between the reference interface contract 
and the binding interface contract.

- The args passed to the reference in an Object[] are correctly placed 
in a newly created wrapper, as expected by the binding.

Simon, the ArrayIndexOutOfBounds you saw before may be caused by test 
case issues similar to what I fixed in [1] (in particular my fix to 
EmbedTestCase). You may want to check that.

[1] http://svn.apache.org/viewvc?view=revision&revision=1057980
[2] 
http://svn.apache.org/repos/asf/tuscany/sandbox/sebastien/java/wrapped/samples/extending-tuscany/implementation-sample/

Hope this helps.
-- 
Jean-Sebastien

Mime
View raw message