/** {@inheritDoc} */
public Object invoke(Message msg)
{
HTTPMessage message = (HTTPMessage) msg;
ProxyContext context = new ProxyContext();
// SOAPMessages should be sent through the SOAPProxyAdapter, but
// the default destination may be just to the HTTPProxyAdapter.
// We'll update the context just in case....
if (message instanceof SOAPMessage)
context.setSoapRequest(true);
else
context.setSoapRequest(false);
setupContext(context, message);
try
{
filterChain.invoke(context);
//TODO: Do we want a return type that encapsulates the response data?
// OUTPUT
AcknowledgeMessage ack = new AcknowledgeMessage();
ack.setBody(context.getResponse());
ack.setHeader(Message.STATUS_CODE_HEADER, context.getStatusCode());
if (context.getRecordHeaders())
{
ack.setHeader(REQUEST_HEADERS, context.getRequestHeaders());
ack.setHeader(RESPONSE_HEADERS, context.getResponseHeaders());
}
return ack;
}
catch (MessageException ex)