use of org.talend.esb.mep.requestcallback.feature.CallContext in project tesb-rt-se by Talend.
the class ServiceProviderHandler method invoke.
@Override
public StreamSource invoke(StreamSource request) {
try {
System.out.println("Service is invoked!!!");
CallContext callContext = CallContext.getCallContext(wsContext);
assertEquals(callContext.getOperationName().getLocalPart(), expectedOperation);
businessHandler.handleMessage(request, callContext);
} catch (Exception e) {
addError(e);
} catch (AssertionError e) {
addError(e);
}
return null;
}
use of org.talend.esb.mep.requestcallback.feature.CallContext in project tesb-rt-se by Talend.
the class ClientProviderHandler method invoke.
@Override
public StreamSource invoke(StreamSource request) {
try {
CallContext context = CallContext.getCallContext(wsContext);
assertNotNull("CallContext missing", context);
QName opName = context.getOperationName();
assertNotNull("Response action missing", opName);
IncomingMessageHandler businessHandler = callbackMap.get(opName.getLocalPart());
if (businessHandler == null) {
throw new RuntimeException("Unknown callback operation: " + context.getOperationName().getLocalPart());
}
businessHandler.handleMessage(request, context);
} catch (Exception e) {
addError(e);
} catch (AssertionError e) {
addError(e);
}
return null;
}
use of org.talend.esb.mep.requestcallback.feature.CallContext in project tesb-rt-se by Talend.
the class CallContextFactoryImpl method createObjectKey.
@Override
public String createObjectKey(E ctxObj) {
if (ctxObj instanceof CallContext) {
CallContext ctx = (CallContext) ctxObj;
String key = ctx.getCallId();
return prettifyCallContextKey(key);
}
return null;
}
use of org.talend.esb.mep.requestcallback.feature.CallContext in project tesb-rt-se by Talend.
the class RequestCallbackInInterceptor method setupCallContext.
private CallContext setupCallContext(SoapMessage message, Header callHeader, Header callbackHeader) throws Fault {
final AddressingProperties maps = getAddressingProperties(message);
if (maps == null) {
throw new IllegalStateException("Request-Callback enabled but no WS-Addressing headers set. ");
}
CallContext ctx = new CallContext();
message.put(RequestCallbackFeature.CALLCONTEXT_PROPERTY_NAME, ctx);
final QName operationName = QName.valueOf(maps.getAction().getValue());
if (!isGenericOperation(operationName)) {
ctx.setOperationName(operationName);
}
ctx.setCallId(valueOf(callHeader));
if (callbackHeader != null) {
ctx.setCallbackId(valueOf(callbackHeader));
}
ctx.setRequestId(maps.getMessageID().getValue());
ctx.setReplyToAddress(maps.getReplyTo().getAddress().getValue());
ctx.setCorrelationId(getCorrelationId(message));
// in callback message
if (callbackHeader == null) {
setupFlowId(message);
}
fillCallContext(ctx, message);
return ctx;
}
use of org.talend.esb.mep.requestcallback.feature.CallContext in project tesb-rt-se by Talend.
the class RequestCallbackInInterceptor method doHandleRequestSoapMessage.
private void doHandleRequestSoapMessage(SoapMessage message, Header callHeader) throws Fault {
CallContext ctx = setupCallContext(message, callHeader, null);
// In case of using requestor certificate for response encryption, store certificate into callContext
storeRequestorCertificate(message, ctx);
}
Aggregations