Object payload;
try {
payload = payloadProxy.getPayload(message);
} catch (MessageDeliverException e) {
throw new ActionProcessingException("Error getting SOAP message parameters from payload.", e);
}
catch (final ClassCastException ex)
{
throw new ActionProcessingException("Required a Map in the payload, but got something else!");
}
if (!(payload instanceof Map)) {
throw new ActionProcessingException("Invalid payload type in message body location '" + payloadProxy.getGetPayloadLocation() + "'. Expected 'java.util.Map', was '" + payload.getClass().getName() + "'.");
}
Map params = (Map) payload;
if (params.isEmpty()) {
logger.warn("Params Map found in message, but the map is empty.");
}
String request;
try {
request = soapUIInvoker.buildRequest(wsdl, getEndpointOperation(), soapServiceName, params, httpClientProps, smooksTransform, soapNs);
} catch (IOException e) {
throw new ActionProcessingException("soapUI Client Service invocation failed.", e);
} catch (SAXException e) {
throw new ActionProcessingException("soapUI Client Service invocation failed.", e);
}
Response response = invokeEndpoint(request);
if(responseAsOgnlMap) {
try {
String mergedResponse = soapUIInvoker.mergeResponseTemplate(wsdl, getEndpointOperation(), soapServiceName, response.getBody(), httpClientProps, null, soapNs);
response.setBody(mergedResponse);
} catch (IOException e) {
throw new ActionProcessingException("soapUI Client Service invocation failed.", e);
} catch (SAXException e) {
throw new ActionProcessingException("soapUI Client Service invocation failed.", e);
}
}
// And process the response into the message...
processResponse(message, response);