*
* @param soapCall the call to make to a SOAP web service
* @return information about the SOAP response
*/
public SoapCallReturn invokeSoapCall(SoapCall<Stub> soapCall) {
Stub stub = soapCall.getSoapClient();
SoapCallReturn.Builder builder = new SoapCallReturn.Builder();
synchronized (stub) {
Object result = null;
try {
result = invoke(soapCall);
} catch (InvocationTargetException e) {
builder.withException(e.getTargetException());
} catch (Exception e) {
builder.withException(e);
} finally {
MessageContext messageContext = stub._getCall().getMessageContext();
try {
builder.withRequestInfo(new RequestInfo.Builder().withSoapRequestXml(
messageContext.getRequestMessage().getSOAPPartAsString())
.withMethodName(stub._getCall().getOperationName().getLocalPart())
.withServiceName(stub.getPortName().getLocalPart())
.withUrl(stub._getCall().getTargetEndpointAddress())
.build());
} catch (AxisFault e) {
builder.withException(e);
}
try {