On Wed, Aug 17, 2011 at 5:50 PM, Raymond Feng <enjoyj...@gmail.com> wrote:
> It's difficult to tell if a string is a plain text, XML or JSON without 
> additional information such as the JAX-RS consumes/produces annotations which 
> provide the media type behind the java type. It's also true for some generic 
> java types such as InputStream or OutputStream. I have been thinking of 
> enhancing the databinding framework to take these info into consideration 
> (similar as JAX-RS MessageBodyReader or MessageBodyWriter), but I don't have 
> enough time to work on it :-(
>
> Raymond Feng
> Sent from my iPhone
>

If we did have the situation where a reference interface passes out a
string and a service expects a complex type then the interfaces are
going to be incompatible unless some specific databinding is enacted
to convert the string to the complex type. We don't have a way of
configuring that without, as you say, decorating the interface so
wouldn't we expect these interfaces to be detected as being
incompatible?

To ask the question a different way if I had reference code that
wanted to send a json encoded string directly and a service that
expected that same data rendered as a Java object how would we
configure that. I guess I'm pushing at what the code does now rather
than what it might do in the future. I now we have some special cases
in various bits of binding code but I'm thinking of the general case
here.

Simon


-- 
Apache Tuscany committer: tuscany.apache.org
Co-author of a book about Tuscany and SCA: tuscanyinaction.com

Reply via email to