public ProtocolSourceMessage(Source source, SOAPVersion soapVersion) { XMLStreamReader reader = SourceReaderFactory.createSourceReader(source, true); com.sun.xml.ws.api.pipe.StreamSOAPCodec codec = Codecs.createSOAPEnvelopeXmlCodec(soapVersion); sm = codec.decode(reader); }
public ProtocolSourceMessage(Source source, SOAPVersion soapVersion) { XMLStreamReader reader = SourceReaderFactory.createSourceReader(source, true); com.sun.xml.ws.api.pipe.StreamSOAPCodec codec = Codecs.createSOAPEnvelopeXmlCodec(soapVersion); sm = codec.decode(reader); }
public void decode(InputStream in, String contentType, Packet response) throws IOException { response.setMessage( _soapCodec.decode(getXMLStreamReader(in))); }
public ProtocolSourceMessage(Source source, SOAPVersion soapVersion) { XMLStreamReader reader = SourceReaderFactory.createSourceReader(source, true); com.sun.xml.ws.api.pipe.StreamSOAPCodec codec = Codecs.createSOAPEnvelopeXmlCodec(soapVersion); sm = codec.decode(reader); }
public void decode(InputStream in, String contentType, Packet response) throws IOException { response.setMessage( _soapCodec.decode(getXMLStreamReader(in))); }
public void decode(InputStream in, String contentType, Packet response) throws IOException { response.setMessage( _soapCodec.decode(getXMLStreamReader(in))); }
/** * Creates a {@link Message} from {@link XMLStreamReader} that points to * the start of the envelope. * * @param reader * can point to the start document or the start element (of <s:Envelope>) */ public static @NotNull Message create(@NotNull XMLStreamReader reader) { // skip until the root element if(reader.getEventType()!=XMLStreamConstants.START_ELEMENT) XMLStreamReaderUtil.nextElementContent(reader); assert reader.getEventType()== XMLStreamConstants.START_ELEMENT :reader.getEventType(); SOAPVersion ver = SOAPVersion.fromNsUri(reader.getNamespaceURI()); return Codecs.createSOAPEnvelopeXmlCodec(ver).decode(reader); }
/** * Creates a {@link Message} from {@link XMLStreamReader} that points to * the start of the envelope. * * @param reader * can point to the start document or the start element (of <s:Envelope>) */ public static @NotNull Message create(@NotNull XMLStreamReader reader) { // skip until the root element if(reader.getEventType()!=XMLStreamConstants.START_ELEMENT) XMLStreamReaderUtil.nextElementContent(reader); assert reader.getEventType()== XMLStreamConstants.START_ELEMENT :reader.getEventType(); SOAPVersion ver = SOAPVersion.fromNsUri(reader.getNamespaceURI()); return Codecs.createSOAPEnvelopeXmlCodec(ver).decode(reader); }
/** * Creates a {@link Message} from {@link XMLStreamReader} that points to * the start of the envelope. * * @param reader * can point to the start document or the start element (of <s:Envelope>) */ public static @NotNull Message create(@NotNull XMLStreamReader reader) { // skip until the root element if(reader.getEventType()!=XMLStreamConstants.START_ELEMENT) XMLStreamReaderUtil.nextElementContent(reader); assert reader.getEventType()== XMLStreamConstants.START_ELEMENT :reader.getEventType(); SOAPVersion ver = SOAPVersion.fromNsUri(reader.getNamespaceURI()); return Codecs.createSOAPEnvelopeXmlCodec(ver).decode(reader); }
@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()); }
public void decode(ReadableByteChannel in, String contentType, Packet packet) { if (contentType == null) { throw new UnsupportedMediaException(); } preDecode(packet); try { if(isMultipartRelated(contentType)) super.decode(in, contentType, packet); else if(isFastInfoset(contentType)) { if (packet.contentNegotiation == ContentNegotiation.none) throw noFastInfosetForDecoding(); useFastInfosetForEncoding = true; fiSoapCodec.decode(in, contentType, packet); } else xmlSoapCodec.decode(in, contentType, packet); } catch(RuntimeException we) { if (we instanceof ExceptionHasMessage || we instanceof UnsupportedMediaException) { throw we; } else { throw new MessageCreationException(version, we); } } postDecode(packet); }
public void decode(ReadableByteChannel in, String contentType, Packet packet) { if (contentType == null) { throw new UnsupportedMediaException(); } preDecode(packet); try { if(isMultipartRelated(contentType)) super.decode(in, contentType, packet); else if(isFastInfoset(contentType)) { if (packet.contentNegotiation == ContentNegotiation.none) throw noFastInfosetForDecoding(); useFastInfosetForEncoding = true; fiSoapCodec.decode(in, contentType, packet); } else xmlSoapCodec.decode(in, contentType, packet); } catch(RuntimeException we) { if (we instanceof ExceptionHasMessage || we instanceof UnsupportedMediaException) { throw we; } else { throw new MessageCreationException(version, we); } } postDecode(packet); }
public void decode(ReadableByteChannel in, String contentType, Packet packet) { if (contentType == null) { throw new UnsupportedMediaException(); } preDecode(packet); try { if(isMultipartRelated(contentType)) super.decode(in, contentType, packet); else if(isFastInfoset(contentType)) { if (packet.contentNegotiation == ContentNegotiation.none) throw noFastInfosetForDecoding(); useFastInfosetForEncoding = true; fiSoapCodec.decode(in, contentType, packet); } else xmlSoapCodec.decode(in, contentType, packet); } catch(RuntimeException we) { if (we instanceof ExceptionHasMessage || we instanceof UnsupportedMediaException) { throw we; } else { throw new MessageCreationException(version, we); } } postDecode(packet); }
public void decode(InputStream in, String contentType, Packet packet) throws IOException { if (contentType == null) { contentType = xmlMimeType; } packet.setContentType(new ContentTypeImpl(contentType)); preDecode(packet); try { if(isMultipartRelated(contentType)) // parse the multipart portion and then decide whether it's MTOM or SwA super.decode(in, contentType, packet); else if(isFastInfoset(contentType)) { if (!ignoreContentNegotiationProperty && packet.contentNegotiation == ContentNegotiation.none) throw noFastInfosetForDecoding(); useFastInfosetForEncoding = true; fiSoapCodec.decode(in, contentType, packet); } else xmlSoapCodec.decode(in, contentType, packet); } catch(RuntimeException we) { if (we instanceof ExceptionHasMessage || we instanceof UnsupportedMediaException) { throw we; } else { throw new MessageCreationException(version, we); } } postDecode(packet); }
public void decode(InputStream in, String contentType, Packet packet) throws IOException { if (contentType == null) { contentType = xmlMimeType; } packet.setContentType(new ContentTypeImpl(contentType)); preDecode(packet); try { if(isMultipartRelated(contentType)) // parse the multipart portion and then decide whether it's MTOM or SwA super.decode(in, contentType, packet); else if(isFastInfoset(contentType)) { if (!ignoreContentNegotiationProperty && packet.contentNegotiation == ContentNegotiation.none) throw noFastInfosetForDecoding(); useFastInfosetForEncoding = true; fiSoapCodec.decode(in, contentType, packet); } else xmlSoapCodec.decode(in, contentType, packet); } catch(RuntimeException we) { if (we instanceof ExceptionHasMessage || we instanceof UnsupportedMediaException) { throw we; } else { throw new MessageCreationException(version, we); } } postDecode(packet); }
public void decode(InputStream in, String contentType, Packet packet) throws IOException { if (contentType == null) { contentType = xmlMimeType; } packet.setContentType(new ContentTypeImpl(contentType)); preDecode(packet); try { if(isMultipartRelated(contentType)) // parse the multipart portion and then decide whether it's MTOM or SwA super.decode(in, contentType, packet); else if(isFastInfoset(contentType)) { if (!ignoreContentNegotiationProperty && packet.contentNegotiation == ContentNegotiation.none) throw noFastInfosetForDecoding(); useFastInfosetForEncoding = true; fiSoapCodec.decode(in, contentType, packet); } else xmlSoapCodec.decode(in, contentType, packet); } catch(RuntimeException we) { if (we instanceof ExceptionHasMessage || we instanceof UnsupportedMediaException) { throw we; } else { throw new MessageCreationException(version, we); } } postDecode(packet); }