Search in sources :

Example 6 with DataHandlerAttachment

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;
    }
}
Also used : AttachmentSet(com.sun.xml.ws.api.message.AttachmentSet) DataHandlerAttachment(com.sun.xml.ws.message.DataHandlerAttachment) DataHandlerAttachment(com.sun.xml.ws.message.DataHandlerAttachment) Attachment(com.sun.xml.ws.api.message.Attachment) DataHandler(jakarta.activation.DataHandler)

Example 7 with DataHandlerAttachment

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;
    }
}
Also used : AttachmentSet(com.sun.xml.ws.api.message.AttachmentSet) DataHandlerAttachment(com.sun.xml.ws.message.DataHandlerAttachment) DataHandlerAttachment(com.sun.xml.ws.message.DataHandlerAttachment) Attachment(com.sun.xml.ws.api.message.Attachment) DataHandler(jakarta.activation.DataHandler) Map(java.util.Map)

Example 8 with DataHandlerAttachment

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();
}
Also used : DataHandlerAttachment(com.sun.xml.ws.message.DataHandlerAttachment) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) DataHandlerAttachment(com.sun.xml.ws.message.DataHandlerAttachment) Attachment(com.sun.xml.ws.api.message.Attachment) DataHandler(jakarta.activation.DataHandler) AttachmentSetImpl(com.sun.xml.ws.message.AttachmentSetImpl) Map(java.util.Map) HashMap(java.util.HashMap)

Aggregations

Attachment (com.sun.xml.ws.api.message.Attachment)8 DataHandlerAttachment (com.sun.xml.ws.message.DataHandlerAttachment)8 DataHandler (jakarta.activation.DataHandler)7 AttachmentSet (com.sun.xml.ws.api.message.AttachmentSet)6 Map (java.util.Map)3 WebServiceException (jakarta.xml.ws.WebServiceException)2 HashMap (java.util.HashMap)2 JavaCallInfo (com.oracle.webservices.api.databinding.JavaCallInfo)1 Databinding (com.sun.xml.ws.api.databinding.Databinding)1 DatabindingConfig (com.sun.xml.ws.api.databinding.DatabindingConfig)1 Packet (com.sun.xml.ws.api.message.Packet)1 WSDLPort (com.sun.xml.ws.api.model.wsdl.WSDLPort)1 SOAPMessageContextImpl (com.sun.xml.ws.handler.SOAPMessageContextImpl)1 AttachmentSetImpl (com.sun.xml.ws.message.AttachmentSetImpl)1 CommandMap (jakarta.activation.CommandMap)1 MailcapCommandMap (jakarta.activation.MailcapCommandMap)1 WebServiceFeature (jakarta.xml.ws.WebServiceFeature)1 Image (java.awt.Image)1 Method (java.lang.reflect.Method)1 URL (java.net.URL)1