Search in sources :

Example 1 with OpenRosaResponse

use of org.commcare.formplayer.beans.OpenRosaResponse in project formplayer by dimagi.

the class FormSubmissionController method parseSubmitResponseMessage.

private void parseSubmitResponseMessage(String responseBody, SubmitResponseBean submitResponseBean) {
    if (responseBody != null) {
        try {
            Serializer serializer = new Persister();
            OpenRosaResponse openRosaResponse = serializer.read(OpenRosaResponse.class, responseBody);
            if (openRosaResponse != null && openRosaResponse.getMessage() != null) {
                submitResponseBean.setSubmitResponseMessage(openRosaResponse.getMessage());
            }
        } catch (Exception e) {
            log.error("Exception parsing submission response body", e);
        }
    }
}
Also used : Persister(org.simpleframework.xml.core.Persister) OpenRosaResponse(org.commcare.formplayer.beans.OpenRosaResponse) HttpClientErrorException(org.springframework.web.client.HttpClientErrorException) InvalidCaseGraphException(org.commcare.cases.util.InvalidCaseGraphException) Serializer(org.simpleframework.xml.Serializer)

Aggregations

InvalidCaseGraphException (org.commcare.cases.util.InvalidCaseGraphException)1 OpenRosaResponse (org.commcare.formplayer.beans.OpenRosaResponse)1 Serializer (org.simpleframework.xml.Serializer)1 Persister (org.simpleframework.xml.core.Persister)1 HttpClientErrorException (org.springframework.web.client.HttpClientErrorException)1