toolshed51
Feb 18th, 2011, 04:44 PM
I'm using Spring Android M2 and its saved me a lot of development time and has been great. The only issue I ran into so far was this.
Given that I'm running my Android app against my WCF 4 server,
And given that the response is a 204 No Content
WCF does not set the Content length or content type headers.
Spring Android expects the Content-Type header to be set and throws a RestClientException
I worked around this by doing a
try {
//RestTemplate.exchange(blah, blah, blah);
}
catch (RestClientException restClientException) {
if (restClientException.getMessage().contains("no Content-Type found")) {
return null;
}
throw restClientException;
}
Forgive me if I overlooked it, but it would also be awesome if the exception contained more information about the request that caused the exception.
Thanks - Russ
Given that I'm running my Android app against my WCF 4 server,
And given that the response is a 204 No Content
WCF does not set the Content length or content type headers.
Spring Android expects the Content-Type header to be set and throws a RestClientException
I worked around this by doing a
try {
//RestTemplate.exchange(blah, blah, blah);
}
catch (RestClientException restClientException) {
if (restClientException.getMessage().contains("no Content-Type found")) {
return null;
}
throw restClientException;
}
Forgive me if I overlooked it, but it would also be awesome if the exception contained more information about the request that caused the exception.
Thanks - Russ