diff options
Diffstat (limited to 'sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java')
4 files changed, 7 insertions, 3 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/DataBindingJAXRSProvider.java b/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/DataBindingJAXRSProvider.java index 1ccdb868d7..1dfdf17345 100644 --- a/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/DataBindingJAXRSProvider.java +++ b/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/DataBindingJAXRSProvider.java @@ -84,7 +84,7 @@ public abstract class DataBindingJAXRSProvider { } protected DataType createDataType(Class<?> type, Type genericType) { - DataType dataType = new DataTypeImpl(null, type, type, genericType); + DataType dataType = new DataTypeImpl(null, type, genericType, genericType); dataBindingExtensionPoint.introspectType(dataType, null); return dataType; } diff --git a/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/DataBindingJAXRSReader.java b/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/DataBindingJAXRSReader.java index d38881eb28..d2304b79f4 100644 --- a/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/DataBindingJAXRSReader.java +++ b/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/DataBindingJAXRSReader.java @@ -25,6 +25,7 @@ import java.lang.annotation.Annotation; import java.lang.reflect.Type; import java.util.Collections; +import javax.ws.rs.Consumes; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MultivaluedMap; @@ -39,6 +40,7 @@ import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl; * The generic JAX-RS message body reader based on Tuscany's databindingframework */ @Provider +@Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML, MediaType.WILDCARD}) public class DataBindingJAXRSReader<T> extends DataBindingJAXRSProvider implements MessageBodyReader<T> { public DataBindingJAXRSReader(ExtensionPointRegistry registry) { diff --git a/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/DataBindingJAXRSWriter.java b/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/DataBindingJAXRSWriter.java index be2a9555d7..ab4173939e 100644 --- a/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/DataBindingJAXRSWriter.java +++ b/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/DataBindingJAXRSWriter.java @@ -25,6 +25,7 @@ import java.lang.annotation.Annotation; import java.lang.reflect.Type; import java.util.Collections; +import javax.ws.rs.Produces; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MultivaluedMap; @@ -39,6 +40,7 @@ import org.apache.tuscany.sca.interfacedef.impl.DataTypeImpl; * The generic JAX-RS message body writer based on Tuscany's databindingframework */ @Provider +@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML, MediaType.WILDCARD}) public class DataBindingJAXRSWriter<T> extends DataBindingJAXRSProvider implements MessageBodyWriter<T> { public DataBindingJAXRSWriter(ExtensionPointRegistry registry) { diff --git a/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/TuscanyRESTServlet.java b/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/TuscanyRESTServlet.java index aefa666bfe..266d038b3b 100644 --- a/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/TuscanyRESTServlet.java +++ b/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/TuscanyRESTServlet.java @@ -158,8 +158,8 @@ public class TuscanyRESTServlet extends RestServlet { }); ProvidersRegistry providers = config.getProvidersRegistry(); - providers.addProvider(new DataBindingJAXRSReader(registry), 0.001, true); - providers.addProvider(new DataBindingJAXRSWriter(registry), 0.001, true); + providers.addProvider(new DataBindingJAXRSReader(registry), 0.2, true); + providers.addProvider(new DataBindingJAXRSWriter(registry), 0.2, true); config.getResponseUserHandlers().add(new TuscanyResponseHandler()); |