use of com.sun.xml.ws.message.DataHandlerAttachment in project metro-jax-ws by eclipse-ee4j.
the class ServerMessageHandlerTube method callHandlersOnResponse.
void callHandlersOnResponse(MessageUpdatableContext context, boolean handleFault) {
// Lets copy all the MessageContext.OUTBOUND_ATTACHMENT_PROPERTY to the message
Map<String, DataHandler> atts = (Map<String, DataHandler>) context.get(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS);
AttachmentSet attSet = context.packet.getMessage().getAttachments();
for (Entry<String, DataHandler> entry : atts.entrySet()) {
String cid = entry.getKey();
if (attSet.get(cid) == null) {
// Otherwise we would be adding attachments twice
Attachment att = new DataHandlerAttachment(cid, atts.get(cid));
attSet.add(att);
}
}
try {
// SERVER-SIDE
processor.callHandlersResponse(HandlerProcessor.Direction.OUTBOUND, context, handleFault);
} catch (RuntimeException wse) {
// no rewrapping
throw wse;
}
}
use of com.sun.xml.ws.message.DataHandlerAttachment in project metro-jax-ws by eclipse-ee4j.
the class ServerLogicalHandlerTube method callHandlersOnResponse.
void callHandlersOnResponse(MessageUpdatableContext context, boolean handleFault) {
// Lets copy all the MessageContext.OUTBOUND_ATTACHMENT_PROPERTY to the message
Map<String, DataHandler> atts = (Map<String, DataHandler>) context.get(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS);
AttachmentSet attSet = context.packet.getMessage().getAttachments();
for (Entry<String, DataHandler> entry : atts.entrySet()) {
String cid = entry.getKey();
Attachment att = new DataHandlerAttachment(cid, atts.get(cid));
attSet.add(att);
}
try {
// SERVER-SIDE
processor.callHandlersResponse(HandlerProcessor.Direction.OUTBOUND, context, handleFault);
} catch (RuntimeException wse) {
// no rewrapping
throw wse;
}
}
use of com.sun.xml.ws.message.DataHandlerAttachment in project metro-jax-ws by eclipse-ee4j.
the class DispatchImpl method setOutboundAttachments.
protected AttachmentSet setOutboundAttachments() {
HashMap<String, DataHandler> attachments = (HashMap<String, DataHandler>) getRequestContext().get(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS);
if (attachments != null) {
List<Attachment> alist = new ArrayList();
for (Map.Entry<String, DataHandler> att : attachments.entrySet()) {
DataHandlerAttachment dha = new DataHandlerAttachment(att.getKey(), att.getValue());
alist.add(dha);
}
return new AttachmentSetImpl(alist);
}
return new AttachmentSetImpl();
}
Aggregations