private Packet packet(Message m) { final Packet p = new Packet(); //TODO when do we use xmlCodec? p.codec = soapCodec; if (m != null) p.setMessage(m); MTOMFeature mf = features.get(MTOMFeature.class); if (mf != null) { p.setMtomFeature(mf); } p.setSAAJFactory(saajFactory); return p; }
private Packet packet(Message m) { final Packet p = new Packet(); //TODO when do we use xmlCodec? p.codec = soapCodec; if (m != null) p.setMessage(m); MTOMFeature mf = features.get(MTOMFeature.class); if (mf != null) { p.setMtomFeature(mf); } p.setSAAJFactory(saajFactory); return p; }
private Packet packet(Message m) { final Packet p = new Packet(); //TODO when do we use xmlCodec? p.codec = soapCodec; if (m != null) p.setMessage(m); MTOMFeature mf = features.get(MTOMFeature.class); if (mf != null) { p.setMtomFeature(mf); } p.setSAAJFactory(saajFactory); return p; }
/** * Should be called after decode(). * Set the state so that such state is used by encode(). */ private void postDecode(Packet p) { p.setFastInfosetDisabled(isFastInfosetDisabled); if(features.isEnabled(MTOMFeature.class)) p.checkMtomAcceptable(); // p.setMtomAcceptable( isMtomAcceptable(p.acceptableMimeTypes) ); MTOMFeature mtomFeature = features.get(MTOMFeature.class); if (mtomFeature != null) { p.setMtomFeature(mtomFeature); } if (!useFastInfosetForEncoding) { useFastInfosetForEncoding = p.getFastInfosetAcceptable(fiMimeType); // useFastInfosetForEncoding = isFastInfosetAcceptable(p.acceptableMimeTypes); } }
/** * Should be called after decode(). * Set the state so that such state is used by encode(). */ private void postDecode(Packet p) { p.setFastInfosetDisabled(isFastInfosetDisabled); if(features.isEnabled(MTOMFeature.class)) p.checkMtomAcceptable(); // p.setMtomAcceptable( isMtomAcceptable(p.acceptableMimeTypes) ); MTOMFeature mtomFeature = features.get(MTOMFeature.class); if (mtomFeature != null) { p.setMtomFeature(mtomFeature); } if (!useFastInfosetForEncoding) { useFastInfosetForEncoding = p.getFastInfosetAcceptable(fiMimeType); // useFastInfosetForEncoding = isFastInfosetAcceptable(p.acceptableMimeTypes); } }
/** * Should be called after decode(). * Set the state so that such state is used by encode(). */ private void postDecode(Packet p) { p.setFastInfosetDisabled(isFastInfosetDisabled); if(features.isEnabled(MTOMFeature.class)) p.checkMtomAcceptable(); // p.setMtomAcceptable( isMtomAcceptable(p.acceptableMimeTypes) ); MTOMFeature mtomFeature = features.get(MTOMFeature.class); if (mtomFeature != null) { p.setMtomFeature(mtomFeature); } if (!useFastInfosetForEncoding) { useFastInfosetForEncoding = p.getFastInfosetAcceptable(fiMimeType); // useFastInfosetForEncoding = isFastInfosetAcceptable(p.acceptableMimeTypes); } }
@Override protected void decode(MimeMultipartParser mpp, Packet packet) throws IOException { //TODO shouldn't we check for SOAP1.1/SOAP1.2 and throw //TODO UnsupportedMediaException like StreamSOAPCodec String charset = null; String ct = mpp.getRootPart().getContentType(); if (ct != null) { charset = new ContentTypeImpl(ct).getCharSet(); } if (charset != null && !Charset.isSupported(charset)) { throw new UnsupportedMediaException(charset); } if (charset != null) { packet.invocationProperties.put(DECODED_MESSAGE_CHARSET, charset); } else { packet.invocationProperties.remove(DECODED_MESSAGE_CHARSET); } // we'd like to reuse those reader objects but unfortunately decoder may be reused // before the decoded message is completely used. XMLStreamReader mtomReader = new MtomXMLStreamReaderEx( mpp, XMLStreamReaderFactory.create(null, mpp.getRootPart().asInputStream(), charset, true) ); packet.setMessage(codec.decode(mtomReader, new MimeAttachmentSet(mpp))); packet.setMtomFeature(mtomFeature); packet.setContentType(mpp.getContentType()); }
@Override protected void decode(MimeMultipartParser mpp, Packet packet) throws IOException { //TODO shouldn't we check for SOAP1.1/SOAP1.2 and throw //TODO UnsupportedMediaException like StreamSOAPCodec String charset = null; String ct = mpp.getRootPart().getContentType(); if (ct != null) { charset = new ContentTypeImpl(ct).getCharSet(); } if (charset != null && !Charset.isSupported(charset)) { throw new UnsupportedMediaException(charset); } if (charset != null) { packet.invocationProperties.put(DECODED_MESSAGE_CHARSET, charset); } else { packet.invocationProperties.remove(DECODED_MESSAGE_CHARSET); } // we'd like to reuse those reader objects but unfortunately decoder may be reused // before the decoded message is completely used. XMLStreamReader mtomReader = new MtomXMLStreamReaderEx( mpp, XMLStreamReaderFactory.create(null, mpp.getRootPart().asInputStream(), charset, true) ); packet.setMessage(codec.decode(mtomReader, new MimeAttachmentSet(mpp))); packet.setMtomFeature(mtomFeature); packet.setContentType(mpp.getContentType()); }
@Override protected void decode(MimeMultipartParser mpp, Packet packet) throws IOException { //TODO shouldn't we check for SOAP1.1/SOAP1.2 and throw //TODO UnsupportedMediaException like StreamSOAPCodec String charset = null; String ct = mpp.getRootPart().getContentType(); if (ct != null) { charset = new ContentTypeImpl(ct).getCharSet(); } if (charset != null && !Charset.isSupported(charset)) { throw new UnsupportedMediaException(charset); } if (charset != null) { packet.invocationProperties.put(DECODED_MESSAGE_CHARSET, charset); } else { packet.invocationProperties.remove(DECODED_MESSAGE_CHARSET); } // we'd like to reuse those reader objects but unfortunately decoder may be reused // before the decoded message is completely used. XMLStreamReader mtomReader = new MtomXMLStreamReaderEx( mpp, XMLStreamReaderFactory.create(null, mpp.getRootPart().asInputStream(), charset, true) ); packet.setMessage(codec.decode(mtomReader, new MimeAttachmentSet(mpp))); packet.setMtomFeature(mtomFeature); packet.setContentType(mpp.getContentType()); }
p.setMtomFeature(features.get(MTOMFeature.class));
p.setMtomFeature(features.get(MTOMFeature.class));
p.setMtomFeature(features.get(MTOMFeature.class));