Simon? I've spent a little bit of time on the week-end to dig more
into SDO with Tuscany 2.0, but am confused now:

>> I just took a look at the 2.x code and I it looks like SDO hasn't been
>> ported over to 2.x completely yet. I see databinding-sdo and
>> databinding-sdo-axiom in the modules directory and in the build but
>> then I see a comment in the itest pom...
>>
>> <!-- wait until databinding-sdo is in
>>                <module>properties</module>
>> -->

As far as I can tell, testing/itest/properties has nothing to do with
SDO, that comment in the itest/pom appears to be misleading? I'm
proposing a first few small fixes towards making
testing/itest/properties pass in
https://github.com/vorburger/tuscany-sca-2.x/commit/da22acd05d0a05fd9d90c35f167672e32870e194
- but this is completely unrelated to SDO - would you agree or am I
not getting it? Note that the tests in modules/databinding-sdo &
databinding-sdo-axiom both pass.

I've meanwhile found
https://issues.apache.org/jira/browse/TUSCANY-3469, but noticed this
was removed from current SVN trunk and 2.0-Beta3 distrib. On
https://github.com/vorburger/tuscany-sca-2.x/tree/trunk/samples/getting-started/helloworld-webservice-sdo
is my attempt to get an (adapted) version of what was the
helloworld-ws-sdo.zip attached to that JIRA to pass again -
unfortunately currently failing with a java.lang.NullPointerException
at 
org.apache.tuscany.sca.databinding.sdo.SDOTypeHelper.addResolvedXSDs(SDOTypeHelper.java:172).
My understanding of Tuscany's internals, after scanning over its code
over the week-end, are too limited to understand how this could ever
have worked or where to start fixing this - the ModelResolver resolver
is passed in from WSDLContractBuilder build where a null is
hard-coded. Anybody willing to help getting this
helloworld-webservice-sdo to pass and included in trunk again? Or
point to what what would have to be done to get it to pass.

I've also attempted to build a helloworld-webservice-sdo-dynamic
example, same thing with dynamic SDO and no code generation, see
https://github.com/vorburger/tuscany-sca-2.x/commit/9a0fc93f2ba382583c74d480e03bdc36e79418f4.
That currently fails with the following exception:

org.apache.tuscany.sca.databinding.TransformationException:
com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 2
counts of IllegalAnnotationExceptions
commonj.sdo.DataObject is an interface, and JAXB can't handle interfaces.
        this problem is related to the following location:
                at commonj.sdo.DataObject
                at protected commonj.sdo.DataObject sample.jaxws.SayHello.arg0
                at sample.jaxws.SayHello
commonj.sdo.DataObject does not have a no-arg default constructor.
        this problem is related to the following location:
                at commonj.sdo.DataObject
                at protected commonj.sdo.DataObject sample.jaxws.SayHello.arg0
                at sample.jaxws.SayHello
        at 
org.apache.tuscany.sca.databinding.jaxb.axiom.JAXB2OMElement.transform(JAXB2OMElement.java:60)

because for some reason it's trying to do JAXB instead of SDO data
binding in this case... anybody willing to advise what I'm doing wrong
in this proposed example, and how to fix it?

While playing with this I did found one issue which I think is a bug
in SDOContextHelper which may have crept into 2.x but gone unnoticed
due to the removed SDO examples... before hitting above, you'd get a
java.lang.NullPointerException at
org.apache.tuscany.sca.databinding.sdo.ImportSDOProcessor.importWSDL(ImportSDOProcessor.java:176)
- addressed by 
https://github.com/vorburger/tuscany-sca-2.x/commit/8822ba1b3b1560d01879bceb9970b165be16340c
- you may want to integrate that? JIRA? (And a TC for this should be
added in SDOContextHelperTestCase I guess.)


On Mon, Aug 22, 2011 at 4:35 PM, Michael Vorburger <m...@vorburger.ch> wrote:
> Hello Simon,
>
> thank you so much for responding. You most certainly helped...
>
>> String getGreetings(DataObject myGreeting);
>
> this is all it took - and it now seems obvious - once you know it! ;-)
>
> I've pushed the change I made back to my
> https://github.com/vorburger/vorburgers-blueprints/tree/master/helloworld-ws-sdo-dyn.
> Would you be interested in having this as an example included in
> Tuscany?
>
>> Hence to make SDO work the SDO databinding would need to be ported from 1.x
>
> I might have a look into what effort it would take on 2.0 - if I do,
> would this be a welcome contribution?
>
> Best,
> Michael
>
> PS: In looking into this I've also come across two general SDO Qs
> which I'll post in a separate new thread.
> _______________________
> Michael Vorburger
> http://www.vorburger.ch
>
>
>
> On Fri, Aug 19, 2011 at 7:02 PM, Simon Laws <simonsl...@googlemail.com> wrote:
>> On Thu, Aug 18, 2011 at 6:08 PM, Michael Vorburger <m...@vorburger.ch> wrote:
>>> Hello Tuscans,
>>>
>>> I am interested in Tuscany SCA with Dynamic (!) SDO, to both expose &
>>> consume data via REST and SOAP services.  Can Tuscany do this?
>>>
>>> http://tuscany.apache.org/tuscany-sdo-java-faq.html under "How to use
>>> SDO in tuscany SCA?" says that "It's possible to use Static SDO or
>>> Dynamic SDO" it seems it should - but I am having trouble getting this
>>> to work:
>>>
>>> In 
>>> https://github.com/vorburger/vorburgers-blueprints/blob/master/helloworld-ws-sdo-dyn/src/test/java/helloworld/HelloWorldDynamicClientTestCase.java,
>>> how do you pass the DataObject into getGreetings() ? I'm probably
>>> getting this all wrong, and the SOAP service client should be generic,
>>> somehow?
>>>
>>> Similarly, how would one go about creating a "dynamic" service? In the
>>> same example project, can the Name interface etc. code generation be
>>> avoided on the server side as well, just having SDO read e.g. the XSD
>>> (or any other dynamic model source) ?
>>>
>>> BTW: The sample-helloworld-ws-sdo is only bundled in v1.6.2 and not in
>>> v2.0-Beta3, is that a case of "not yet" or a "won't be anymore" ?  Is
>>> SDO still used?
>>>
>>> Thanks a lot for any help,
>>> Michael
>>>
>>> _______________________
>>> Michael Vorburger
>>> http://www.vorburger.ch
>>>
>>
>> Hi Michael
>>
>> I just took a look at the 2.x code and I it looks like SDO hasn't been
>> ported over to 2.x completely yet. I see databinding-sdo and
>> databinding-sdo-axiom in the modules directory and in the build but
>> then I see a comment in the itest pom...
>>
>> <!-- wait until databinding-sdo is in
>>                <module>properties</module>
>> -->
>>
>> I haven't seen anyone changing the SDO code itself in a long time and
>> it doesn't seem that there are manyof committers around that know
>> about it. Having said that it worked in 1.x so I don't see a
>> particular reason why it can't be brought into 2.x if there is someone
>> willing to do it.
>>
>> re. actually using it in services.
>>
>> Tuscany treats references and service independently and provides a
>> databinding framework to smooth out the inconsistencies. You could
>> implement getGreetings() at you service in a number of different ways,
>> for example,
>>
>> String getGreetings(MyGreetingJavaBean myGreeting);
>> or
>> String getGreetings(MyGreetingJAXB myGreeting);
>> or
>> String getGreetings(MyGreetingSDO myGreeting);
>> or
>> String getGreetings(DataObject myGreeting);
>>
>> Then if you define you're service as
>>
>> <component name="GreetingComponent">
>>  <implementation.java class="com.greeting.app.GreeterImpl"/>
>>  <service name="Greeter">
>>    <binding.ws uri="http://localhost:8080/my/greeter"/>
>>  </service>
>> </component>
>>
>> The client should be able to send SOAP messages to
>> http://localhost:8080/my/greeter just like any other WS endpoint. In
>> particular you could do http://localhost:8080/my/greeter?wsdl and this
>> will tell you what the interface looks like irrespective of what
>> databinding the implementation assumes.
>>
>> Under the covers on the service side Tuscany looks at the
>> implementation and finds out what sort of data it's expecting, e.g.
>> Java bean, JAXB, Static SDO, Dynamic SDO. It then looks at the binding
>> to see what sort of data is available. XML in the binding.ws case (In
>> Tuscany this will be represented using Axiom). Then it looks for a
>> databinding to convert between the two and hence complete the call to
>> the service.
>>
>> Hence to make SDO work the SDO databinding would need to be ported from 1.x
>>
>> As an aside there are some databindings that are binding specific, for
>> example, if you wanted to do
>>
>> String getGreetings(javax.jms.Message myGreeting);
>>
>> The you would need to use the JMS binding.
>>
>> Not sure if this is helping answer the question.
>>
>> Regards
>>
>> Simon
>>
>> --
>> Apache Tuscany committer: tuscany.apache.org
>> Co-author of a book about Tuscany and SCA: tuscanyinaction.com

Reply via email to