use of org.apache.cxf.ws.transfer.PutResponse in project cxf by apache.
the class ResourceLocal method put.
@Override
public PutResponse put(Put body) {
// Getting reference paramaters
AddressingProperties addrProps = (AddressingProperties) ((WrappedMessageContext) context.getMessageContext()).getWrappedMessage().getContextualProperty(JAXWSAConstants.ADDRESSING_PROPERTIES_INBOUND);
ReferenceParametersType refParams = addrProps.getToEndpointReference().getReferenceParameters();
// Getting representation from the ResourceManager
Representation storedRepresentation = manager.get(refParams);
// Getting representation from the incoming SOAP message. This representation will be stored.
Representation putRepresentation = body.getRepresentation();
// Dialect processing
if (body.getDialect() != null && !body.getDialect().isEmpty()) {
if (dialects.containsKey(body.getDialect())) {
Dialect dialect = dialects.get(body.getDialect());
putRepresentation = dialect.processPut(body, storedRepresentation);
} else {
throw new UnknownDialect();
}
}
ValidAndTransformHelper.validationAndTransformation(resourceTypeIdentifiers, putRepresentation, storedRepresentation);
manager.put(refParams, putRepresentation);
PutResponse response = new PutResponse();
response.setRepresentation(putRepresentation);
return response;
}
Aggregations