use of no.difi.meldingsutveksling.noarkexchange.schema.PutMessageResponseType in project efm-integrasjonspunkt by felleslosninger.
the class EphorteClientTest method testSendEduMelding.
@Test
public void testSendEduMelding() throws Exception {
NoarkClientSettings settings = new NoarkClientSettings("http://localhost:7778/ephorte", "", "");
EphorteClient client = new EphorteClient(settings);
PutMessageResponseType result = client.sendEduMelding(new PutMessageRequestType());
assertEquals("Hello world", result.getResult().getType());
}
use of no.difi.meldingsutveksling.noarkexchange.schema.PutMessageResponseType in project efm-integrasjonspunkt by felleslosninger.
the class P360Client method sendEduMelding.
@Override
public PutMessageResponseType sendEduMelding(PutMessageRequestType request) {
JAXBElement<no.difi.meldingsutveksling.noarkexchange.p360.schema.PutMessageRequestType> p360request = new PutMessageRequestMapper().mapFrom(request);
final WebServiceTemplate template = templateFactory.createTemplate("no.difi.meldingsutveksling.noarkexchange.p360.schema", PutMessageMarker.markerFrom(new PutMessageRequestWrapper(request)));
JAXBElement<no.difi.meldingsutveksling.noarkexchange.p360.schema.PutMessageResponseType> response = (JAXBElement<no.difi.meldingsutveksling.noarkexchange.p360.schema.PutMessageResponseType>) template.marshalSendAndReceive(settings.getEndpointUrl(), p360request, new SoapActionCallback(SOAP_ACTION));
PutMessageResponseType theResponse = new PutMessageResponseType();
ModelMapper modelMapper = new ModelMapper();
modelMapper.map(response.getValue(), theResponse);
setUnmappedValues(response, theResponse);
if (!isValid(theResponse)) {
theResponse = new PutMessageResponseType();
final no.difi.meldingsutveksling.noarkexchange.schema.AppReceiptType appReceiptType = new no.difi.meldingsutveksling.noarkexchange.schema.AppReceiptType();
theResponse.setResult(appReceiptType);
appReceiptType.setType("OK");
}
return theResponse;
}
use of no.difi.meldingsutveksling.noarkexchange.schema.PutMessageResponseType in project efm-integrasjonspunkt by felleslosninger.
the class PutMessageResponseFactory method createErrorResponse.
public static PutMessageResponseType createErrorResponse(String errorMsg) {
PutMessageResponseType response = new PutMessageResponseType();
AppReceiptType receipt = new AppReceiptType();
receipt.setType("ERROR");
StatusMessageType statusMessageType = new StatusMessageType();
statusMessageType.setText(errorMsg);
statusMessageType.setCode("Unknown");
receipt.getMessage().add(statusMessageType);
response.setResult(receipt);
return response;
}
use of no.difi.meldingsutveksling.noarkexchange.schema.PutMessageResponseType in project efm-integrasjonspunkt by felleslosninger.
the class WebsakClient method sendEduMelding.
@Override
public PutMessageResponseType sendEduMelding(PutMessageRequestType request) {
JAXBElement<no.difi.meldingsutveksling.noarkexchange.websak.schema.PutMessageRequestType> websakRequest = new PutMessageRequestMapper().mapFrom(request);
final WebServiceTemplate template = templateFactory.createTemplate("no.difi.meldingsutveksling.noarkexchange.websak.schema", markerFrom(new PutMessageRequestWrapper(request)));
JAXBElement<no.difi.meldingsutveksling.noarkexchange.websak.schema.PutMessageResponseType> response = (JAXBElement) template.marshalSendAndReceive(settings.getEndpointUrl(), websakRequest, new SoapActionCallback(SOAP_ACTION));
PutMessageResponseType theResponse = new PutMessageResponseType();
ModelMapper modelMapper = new ModelMapper();
modelMapper.map(response.getValue(), theResponse);
setUnmappedValues(response, theResponse);
return theResponse;
}
use of no.difi.meldingsutveksling.noarkexchange.schema.PutMessageResponseType in project efm-integrasjonspunkt by felleslosninger.
the class EphorteClient method sendEduMelding.
@Override
public PutMessageResponseType sendEduMelding(PutMessageRequestType request) {
ModelMapper modelMapper = new ModelMapper();
no.difi.meldingsutveksling.noarkexchange.ephorte.schema.PutMessageRequestType r = new no.difi.meldingsutveksling.noarkexchange.ephorte.schema.PutMessageRequestType();
modelMapper.map(request, r);
JAXBElement<no.difi.meldingsutveksling.noarkexchange.ephorte.schema.PutMessageRequestType> ephorteRequest;
try {
ephorteRequest = new PutMessageRequestMapper().mapFrom(request);
} catch (JAXBException e) {
throw new RuntimeException("Failed to map request from internal PutMessageRequest to ephorte", e);
}
final WebServiceTemplate template = templateFactory.createTemplate("no.difi.meldingsutveksling.noarkexchange.ephorte.schema", markerFrom(new PutMessageRequestWrapper(request)));
JAXBElement<no.difi.meldingsutveksling.noarkexchange.ephorte.schema.PutMessageResponseType> ephorteResponse = (JAXBElement<no.difi.meldingsutveksling.noarkexchange.ephorte.schema.PutMessageResponseType>) template.marshalSendAndReceive(settings.getEndpointUrl(), ephorteRequest);
PutMessageResponseType response = new PutMessageResponseType();
modelMapper.map(ephorteResponse.getValue(), response);
setUnmappedValues(ephorteResponse, response);
return response;
}
Aggregations