Object payload = input.get(inputPartName);
Source inputSource = getSourceFromPayload(payload);
// Create and send exchange
try {
BPEEndpoint endpoint = BPEEndpoint.getCurrent();
BPEComponent component = (BPEComponent) endpoint.getServiceUnit().getComponent();
DeliveryChannel channel = ((BPELifeCycle) component.getLifeCycle()).getContext().getDeliveryChannel();
MessageExchangeFactory factory = channel.createExchangeFactory();
// TODO: need to configure mep
MessageExchange me = factory.createExchange(this.mep);
me.setInterfaceName(interfaceName);
me.setService(serviceName);
if (endpointName != null) {
ServiceEndpoint ep = component.getComponentContext().getEndpoint(serviceName, endpointName);
me.setEndpoint(ep);
}
// TODO: set endpoint
me.setOperation(operationName);
NormalizedMessage nm = me.createMessage();