On 01/11/2011 07:33 PM, Jean-Sebastien Delfino wrote:
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.

Actually, I had to make one more small change to make this work, as suggested by Benjamin earlier in this thread [3].

See SVN r1058717 [4] for the patch diffs.

The good news is that /modules builds successfully with that change.

The bad news is that I'm not able to confirm that it's not introducing any regression, as testing/compliance-tests and testing/itest both fail for me (exception in client_javapojo.POJO_8037_TestCase and random hangs in testing/itest).

So, it'd be good if somebody else could try that change in trunk and confirm that it's OK, or perhaps suggest a better change, as the wrappering logic in Input2InputTransformer is definitely incorrect right now.

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/

[3] http://marc.info/?l=tuscany-dev&m=129470854530536&w=2
[4] http://svn.apache.org/viewvc?rev=1058717&view=rev

Hope this helps.
--
Jean-Sebastien

Reply via email to