class WebServiceMessageReceiverObjectSupport implements InitializingBean {

	protected final void handleConnection(WebServiceConnection connection, WebServiceMessageReceiver receiver)
			throws Exception {
		logUri(connection);
		TransportContext previousTransportContext = TransportContextHolder.getTransportContext();
		TransportContextHolder.setTransportContext(new DefaultTransportContext(connection));

		try {
			WebServiceMessage request = connection.receive(getMessageFactory());
			MessageContext messageContext = new DefaultMessageContext(request, getMessageFactory());
			receiver.receive(messageContext);
			if (messageContext.hasResponse()) {
				WebServiceMessage response = messageContext.getResponse();
				if (response instanceof FaultAwareWebServiceMessage && connection instanceof FaultAwareWebServiceConnection) {
					FaultAwareWebServiceMessage faultResponse = (FaultAwareWebServiceMessage) response;
					FaultAwareWebServiceConnection faultConnection = (FaultAwareWebServiceConnection) connection;
					faultConnection.setFaultCode(faultResponse.getFaultCode());
				}
				connection.send(messageContext.getResponse());
			}
		} catch (NoEndpointFoundException ex) {
			handleNoEndpointFoundException(ex, connection, receiver);
		} finally {
			TransportUtils.closeConnection(connection);
			TransportContextHolder.setTransportContext(previousTransportContext);
		}
	}

}