*/
public final MuleMessage request(long timeout) throws Exception
{
try
{
EndpointMessageNotification beginNotification = null;
if (connector.isEnableMessageEvents())
{
MuleMessage dummyMessage = new DefaultMuleMessage(NullPayload.getInstance(), endpoint.getMuleContext());
beginNotification = new EndpointMessageNotification(dummyMessage, endpoint, null, EndpointMessageNotification.MESSAGE_REQUEST_BEGIN);
}
// Make sure we are connected
connect();
MuleMessage result = null;
result = doRequest(timeout);
if (result != null)
{
String rootId = result.getInboundProperty(MuleProperties.MULE_ROOT_MESSAGE_ID_PROPERTY);
if (rootId != null)
{
result.setMessageRootId(rootId);
result.removeProperty(MuleProperties.MULE_ROOT_MESSAGE_ID_PROPERTY, PropertyScope.INBOUND);
}
if (beginNotification != null)
{
result.propagateRootId(beginNotification.getSource());
}
if (!endpoint.isDisableTransportTransformer())
{
applyInboundTransformers(result);
}
if (beginNotification != null)
{
connector.fireNotification(beginNotification);
connector.fireNotification(new EndpointMessageNotification(result, endpoint, null,
EndpointMessageNotification.MESSAGE_REQUEST_END));
}
}
return result;
}