use of org.hisp.dhis.web.ohie.common.domain.soap.Envelope in project dhis2-core by dhis2.
the class CsdController method careServicesRequest.
// -------------------------------------------------------------------------
// POST
// -------------------------------------------------------------------------
@RequestMapping(value = "", method = RequestMethod.POST, consumes = MediaType.ALL_VALUE, produces = MediaType.ALL_VALUE)
public void careServicesRequest(HttpServletRequest request, HttpServletResponse response) throws IOException, JAXBException {
Object o = unmarshaller.unmarshal(new BufferedInputStream(request.getInputStream()));
Envelope env = (Envelope) o;
validateRequest(env);
List<OrganisationUnit> organisationUnits = getOrganisationUnits(env);
Csd csd = createCsd(organisationUnits);
Envelope envelope = createResponse(csd, env.getHeader().getMessageID().getValue());
response.setContentType(SOAP_CONTENT_TYPE);
marshaller.marshal(envelope, response.getOutputStream());
}
use of org.hisp.dhis.web.ohie.common.domain.soap.Envelope in project dhis2-core by dhis2.
the class CsdController method createResponse.
public Envelope createResponse(Csd csd, String messageID) {
Envelope envelope = new Envelope();
envelope.getHeader().getAction().setValue("urn:ihe:iti:csd:2013:GetDirectoryModificationsResponse");
envelope.getHeader().setRelatesTo(new RelatesTo(messageID));
GetModificationsResponse response = new GetModificationsResponse(csd);
envelope.getBody().setGetModificationsResponse(response);
return envelope;
}
use of org.hisp.dhis.web.ohie.common.domain.soap.Envelope in project dhis2-core by dhis2.
the class CsdController method soapError.
@ExceptionHandler
public void soapError(SoapException ex, HttpServletResponse response) throws JAXBException, IOException {
Envelope envelope = new Envelope();
envelope.setHeader(null);
envelope.getBody().setFault(new Fault());
envelope.getBody().getFault().getCode().getValue().setValue(ex.getFaultCode());
envelope.getBody().getFault().getReason().getText().setValue(ex.getMessage());
response.setContentType(SOAP_CONTENT_TYPE);
marshaller.marshal(envelope, response.getOutputStream());
}
Aggregations