class PayloadEndpointAdapter extends TransformerObjectSupport implements EndpointAdapter {

	@Override
	public void invoke(MessageContext messageContext, Object endpoint) throws Exception {
		PayloadEndpoint payloadEndpoint = (PayloadEndpoint) endpoint;
		Source requestSource = messageContext.getRequest().getPayloadSource();
		Source responseSource = payloadEndpoint.invoke(requestSource);
		if (responseSource != null) {
			WebServiceMessage response = messageContext.getResponse();
			transform(responseSource, response.getPayloadResult());
		}
	}

}