On Thu, Aug 18, 2011 at 6:08 PM, Michael Vorburger <[email protected]> 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