MessageContext ctx = new MessageContext();
ctx.setXFire(xfire);
ctx.setService(service);
ctx.setProperty(Channel.BACKCHANNEL_URI, out);
ctx.setExchange(new org.codehaus.xfire.exchange.MessageExchange(ctx));
InMessage msg = new InMessage();
ctx.getExchange().setInMessage(msg);
if (exchange.getOperation() != null) {
OperationInfo op = service.getServiceInfo().getOperation(exchange.getOperation().getLocalPart());
if (op != null) {
ctx.getExchange().setOperation(op);
}
}
ctx.setCurrentMessage(msg);
NormalizedMessage in = exchange.getMessage("in");
msg.setXMLStreamReader(getXMLStreamReader(in.getContent()));
if (in.getAttachmentNames() != null && in.getAttachmentNames().size() > 0) {
JavaMailAttachments attachments = new JavaMailAttachments();
for (Iterator it = in.getAttachmentNames().iterator(); it.hasNext();) {
String name = (String) it.next();
DataHandler dh = in.getAttachment(name);
attachments.addPart(new SimpleAttachment(name, dh));
}
msg.setAttachments(attachments);
}
EndpointDeliveryChannel.setEndpoint(endpoint);
JBIContext.setMessageExchange(exchange);
if (isInAndOut(exchange)) {