if (runtimeComponentReference == null){
throw new ServiceRuntimeException("Can't find component reference for partner link " + referenceName);
}
RuntimeWire runtimeWire =
runtimeComponentReference.getRuntimeWire(runtimeComponentReference.getBindings().get(0));
// convert operations
Operation operation =
findOperation(partnerRoleMessageExchange.getOperation().getName(), runtimeComponentReference);
/*
This is how a request looks like (payload is wrapped with extra info)
<?xml version="1.0" encoding="UTF-8"?>
<message>
<parameters>
<getGreetings xmlns="http://greetings">
<message xmlns="http://helloworld">Luciano</message>
</getGreetings>
</parameters>
</message>
*/
Element msg = partnerRoleMessageExchange.getRequest().getMessage();
if (msg != null) {
String xml = DOMUtils.domToString(msg);
String payload =
DOMUtils.domToString(getPayload(partnerRoleMessageExchange.getRequest()));
if(__log.isDebugEnabled()) {
__log.debug("Starting invocation of SCA Reference");
__log.debug(">>> Original message: " + xml);
__log.debug(">>> Payload: " + payload);
}
Object[] args = new Object[] {getPayload(partnerRoleMessageExchange.getRequest())};
Object result = null;
boolean success = false;
try {
result = runtimeWire.invoke(operation, args);
success = true;
} catch (Exception e) {
partnerRoleMessageExchange.replyWithFailure(MessageExchange.FailureType.OTHER,
e.getMessage(),
null);