Operation operation =
(Operation)context.getProperty(Operation.class);
if (operation == null) {
String errorMessage =
"Could not find the operation for this request";
fatalError(new XMLPipelineException(errorMessage, locator));
}
Message message = (Message)context.getProperty(Message.class);
if (message == null) {
String errorMessage =
"Could not find the message for this request";
fatalError(new XMLPipelineException(errorMessage, locator));
}
InputSource wsdlInputSource = null;
try {
wsdlInputSource = acquireWSDLInputSource(operation);
} catch (IOException e) {
e.printStackTrace();
fatalError(new XMLPipelineException(
e.getMessage(), locator, e));
}
if (wsdlInputSource == null) {
// It should usually not be the case that wsdlInputSource is
// null, though can happen if the WSDL acquisition times out
// for example.
// @todo later for some reason this can cause a flow control failure if the operation is surrounded by a try operation
fatalError(new XMLPipelineException(
"wsdlInputSource is null", locator));
}
try {
Message result =
WebServiceInvoker.invokeWebService(wsdlInputSource,
operation,
message);
forwardMessageAsXML(result);
} catch (Exception e) {
fatalError(new XMLPipelineException(
e.getMessage(), locator, e));
}
}
}