public void add(Attachment att) { attMap.put('<'+att.getContentId()+'>', att); } }
public void add(Attachment att) { attMap.put('<'+att.getContentId()+'>', att); } }
public void add(Attachment att) { atts.put(att.getContentId(), att); }
public void add(Attachment att) { attMap.put('<'+att.getContentId()+'>', att); } }
public void add(Attachment att) { atts.put(att.getContentId(), att); }
public void add(Attachment att) { atts.put(att.getContentId(), att); }
public Attachment get(String contentId) { for( int i=attList.size()-1; i>=0; i-- ) { Attachment a = attList.get(i); if(a.getContentId().equals(contentId)) return a; } return null; }
public Attachment get(String contentId) { for( int i=attList.size()-1; i>=0; i-- ) { Attachment a = attList.get(i); if(a.getContentId().equals(contentId)) return a; } return null; }
public Attachment get(String contentId) { for( int i=attList.size()-1; i>=0; i-- ) { Attachment a = attList.get(i); if(a.getContentId().equals(contentId)) return a; } return null; }
public Object get(Object key) { if(key == null) return null; Object value = asMapIncludingInvocationProperties.get(key); //add the attachments from the Message to the corresponding attachment property if(key.equals(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS) || key.equals(MessageContext.INBOUND_MESSAGE_ATTACHMENTS)){ Map<String, DataHandler> atts = (Map<String, DataHandler>) value; if(atts == null) atts = new HashMap<String, DataHandler>(); AttachmentSet attSet = packet.getMessage().getAttachments(); for(Attachment att : attSet){ String cid = att.getContentId(); if (cid.indexOf("@jaxws.sun.com") == -1) { Object a = atts.get(cid); if (a == null) { a = atts.get("<" + cid + ">"); if (a == null) atts.put(att.getContentId(), att.asDataHandler()); } } else { atts.put(att.getContentId(), att.asDataHandler()); } } return atts; } return value; }
public Object get(Object key) { if(packet.supports(key)) return packet.get(key); // strongly typed if(packet.getHandlerScopePropertyNames(true).contains(key)) return null; // no such application-scope property Object value = packet.invocationProperties.get(key); //add the attachments from the Message to the corresponding attachment property if(key.equals(MessageContext.INBOUND_MESSAGE_ATTACHMENTS)){ Map<String, DataHandler> atts = (Map<String, DataHandler>) value; if(atts == null) atts = new HashMap<String, DataHandler>(); AttachmentSet attSet = packet.getMessage().getAttachments(); for(Attachment att : attSet){ atts.put(att.getContentId(), att.asDataHandler()); } return atts; } return value; }
@Override @SuppressWarnings("element-type-mismatch") public Object get(Object key) { if (packet.supports(key)) { return packet.get(key); // strongly typed } if (packet.getHandlerScopePropertyNames(true).contains(key)) { return null; // no such application-scope property } Object value = packet.invocationProperties.get(key); //add the attachments from the Message to the corresponding attachment property if(key.equals(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS) || key.equals(MessageContext.INBOUND_MESSAGE_ATTACHMENTS)){ Map<String, DataHandler> atts = (Map<String, DataHandler>) value; if(atts == null) atts = new HashMap<String, DataHandler>(); AttachmentSet attSet = packet.getMessage().getAttachments(); for(Attachment att : attSet){ atts.put(att.getContentId(), att.asDataHandler()); } return atts; } return value; }
public Object get(Object key) { if(packet.supports(key)) return packet.get(key); // strongly typed if(packet.getHandlerScopePropertyNames(true).contains(key)) return null; // no such application-scope property Object value = packet.invocationProperties.get(key); //add the attachments from the Message to the corresponding attachment property if(key.equals(MessageContext.INBOUND_MESSAGE_ATTACHMENTS)){ Map<String, DataHandler> atts = (Map<String, DataHandler>) value; if(atts == null) atts = new HashMap<String, DataHandler>(); AttachmentSet attSet = packet.getMessage().getAttachments(); for(Attachment att : attSet){ atts.put(att.getContentId(), att.asDataHandler()); } return atts; } return value; }
@Override @SuppressWarnings("element-type-mismatch") public Object get(Object key) { if (packet.supports(key)) { return packet.get(key); // strongly typed } if (packet.getHandlerScopePropertyNames(true).contains(key)) { return null; // no such application-scope property } Object value = packet.invocationProperties.get(key); //add the attachments from the Message to the corresponding attachment property if(key.equals(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS) || key.equals(MessageContext.INBOUND_MESSAGE_ATTACHMENTS)){ Map<String, DataHandler> atts = (Map<String, DataHandler>) value; if(atts == null) atts = new HashMap<String, DataHandler>(); AttachmentSet attSet = packet.getMessage().getAttachments(); for(Attachment att : attSet){ atts.put(att.getContentId(), att.asDataHandler()); } return atts; } return value; }
public Object get(Object key) { if(packet.supports(key)) return packet.get(key); // strongly typed if(packet.getHandlerScopePropertyNames(true).contains(key)) return null; // no such application-scope property Object value = packet.invocationProperties.get(key); //add the attachments from the Message to the corresponding attachment property if(key.equals(MessageContext.INBOUND_MESSAGE_ATTACHMENTS)){ Map<String, DataHandler> atts = (Map<String, DataHandler>) value; if(atts == null) atts = new HashMap<String, DataHandler>(); AttachmentSet attSet = packet.getMessage().getAttachments(); for(Attachment att : attSet){ atts.put(att.getContentId(), att.asDataHandler()); } return atts; } return value; }
@Override @SuppressWarnings("element-type-mismatch") public Object get(Object key) { if (packet.supports(key)) { return packet.get(key); // strongly typed } if (packet.getHandlerScopePropertyNames(true).contains(key)) { return null; // no such application-scope property } Object value = packet.invocationProperties.get(key); //add the attachments from the Message to the corresponding attachment property if(key.equals(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS) || key.equals(MessageContext.INBOUND_MESSAGE_ATTACHMENTS)){ Map<String, DataHandler> atts = (Map<String, DataHandler>) value; if(atts == null) atts = new HashMap<String, DataHandler>(); AttachmentSet attSet = packet.getMessage().getAttachments(); for(Attachment att : attSet){ atts.put(att.getContentId(), att.asDataHandler()); } return atts; } return value; }
@SuppressWarnings("resource") private void writeNonMtomAttachments(AttachmentSet attachments, OutputStream out, String boundary) throws IOException { for (Attachment att : attachments) { DataHandler dh = att.asDataHandler(); if (dh instanceof StreamingDataHandler) { StreamingDataHandler sdh = (StreamingDataHandler) dh; // If DataHandler has href Content-ID, it is MTOM, so skip. if (sdh.getHrefCid() != null) continue; } // build attachment frame writeln("--" + boundary, out); writeMimeHeaders(att.getContentType(), att.getContentId(), out); att.writeTo(out); writeln(out); // write \r\n } }
@SuppressWarnings("resource") private void writeNonMtomAttachments(AttachmentSet attachments, OutputStream out, String boundary) throws IOException { for (Attachment att : attachments) { DataHandler dh = att.asDataHandler(); if (dh instanceof StreamingDataHandler) { StreamingDataHandler sdh = (StreamingDataHandler) dh; // If DataHandler has href Content-ID, it is MTOM, so skip. if (sdh.getHrefCid() != null) continue; } // build attachment frame writeln("--" + boundary, out); writeMimeHeaders(att.getContentType(), att.getContentId(), out); att.writeTo(out); writeln(out); // write \r\n } }
@SuppressWarnings("resource") private void writeNonMtomAttachments(AttachmentSet attachments, OutputStream out, String boundary) throws IOException { for (Attachment att : attachments) { DataHandler dh = att.asDataHandler(); if (dh instanceof StreamingDataHandler) { StreamingDataHandler sdh = (StreamingDataHandler) dh; // If DataHandler has href Content-ID, it is MTOM, so skip. if (sdh.getHrefCid() != null) continue; } // build attachment frame writeln("--" + boundary, out); writeMimeHeaders(att.getContentType(), att.getContentId(), out); att.writeTo(out); writeln(out); // write \r\n } }
public SOAPMessage readAsSOAPMessage() throws SOAPException { if (!parsedMessage) { return sm; } else { SOAPMessage msg = soapVersion.getMessageFactory().createMessage(); addAttributes(msg.getSOAPPart().getEnvelope(),envelopeAttrs); SOAPBody newBody = msg.getSOAPPart().getEnvelope().getBody(); addAttributes(newBody, bodyAttrs); for (Element part : bodyParts) { Node n = newBody.getOwnerDocument().importNode(part, true); newBody.appendChild(n); } addAttributes(msg.getSOAPHeader(),headerAttrs); for (Header header : headers.asList()) { header.writeTo(msg); } for (Attachment att : getAttachments()) { AttachmentPart part = msg.createAttachmentPart(); part.setDataHandler(att.asDataHandler()); part.setContentId('<' + att.getContentId() + '>'); addCustomMimeHeaders(att, part); msg.addAttachmentPart(part); } msg.saveChanges(); return msg; } }