uCosminexus Application Server, Web Service Development Guide
The following table lists the combination of Java types and MIME media types available for the entity body of an HTTP request. Note that the operation of the JAX-RS engine is not guaranteed for other combinations.
Table 25-6 Combination of Java types and MIME media types available for the entity body
| No. | Java Type | charset#1 | Content-Type HTTP header | Content-Type HTTP header#2 (JAX-RS engine) |
|---|---|---|---|---|
| 1 | byte[] | N | Any (*/*) | application/octet-stream |
| 2 | java.lang.String | Y | Any (*/*) | text/plain |
| 3 | java.io.InputStream | N | Any (*/*) | application/octet-stream |
| 4 | java.io.Reader | Y | Any (*/*) | text/plain |
| 5 | java.io.File | N | Any (*/*) | application/octet-stream |
| 6 | javax.activation.DataSource | N | Any (*/*) | application/octet-stream |
| 7 | javax.xml.transform.Source#3 | N | Any (*/*) | application/xml |
| 8 | javax.xml.bind.JAXBElement<String>#4 | Y | ext/xml, application/xml, application/*+xml |
application/xml |
| 9 | JAXB class#4 annotated with the XmlRootElement annotation | Y | text/xml, application/xml, application/*+xml |
application/xml |
| 10 | javax.ws.rs.core.MultivaluedMap<String,String> | Y | application/x-www-form-urlencoded | application/x-www-form-urlencoded |
| 11 | javax.ws.rs.core.StreamingOutput | N | Any (*/*) | application/octet-stream |
| 12 | org.w3c.dom.Document | N | Any (*/*) | application/xml |
| 13 | java.awt.image.RenderedImage | N | image/jpeg | application/octet-stream |
| 14 | javax.ws.rs.core.GenericEntity<T>#5 | D | MIME media type similar to the Type specified in T. | MIME media type similar to the Type specified in T. |
| 15 | POJO#6 | N#7 | application/json | application/octet-stream |
If the specified Java type is an unsupported type and if the value is not null, an error occurs (KDJJ10032-E and KDJJ18888-E) and the ClientHandlerException exception is thrown. However, if the specified Java type is javax.mail.internet.MimeMultipart and the MIME media type is multipart/*, the operation ends normally without any error.
With the following Java types, if there is a MIME media type that an HTTP request entity body cannot use, an error occurs (KDJJ10032-E and KDJJ18888-E) and the ClientHandlerException exception is thrown:
However, if the MIME media type of an HTTP request entity body in 1 or 2 is application/fastinfoset or application/json, the operation ends normally without any errors.
If an exception is thrown during the processing of an HTTP request and HTTP response, an error (KDJJ18888-E) occurs and the ClientHandlerException exception that wraps this exception is thrown.
Notes for the types of HTTP methods are as follows:
All Rights Reserved. Copyright (C) 2013, Hitachi, Ltd.