com.sun.xml.internal.ws.streaming.MtomStreamWriter Java Examples
The following examples show how to use
com.sun.xml.internal.ws.streaming.MtomStreamWriter.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JAXBMessage.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
@Override public void writePayloadTo(XMLStreamWriter sw) throws XMLStreamException { try { // MtomCodec sets its own AttachmentMarshaller AttachmentMarshaller am = (sw instanceof MtomStreamWriter) ? ((MtomStreamWriter)sw).getAttachmentMarshaller() : new AttachmentMarshallerImpl(attachmentSet); // Get the encoding of the writer String encoding = XMLStreamWriterUtil.getEncoding(sw); // Get output stream and use JAXB UTF-8 writer OutputStream os = bridge.supportOutputStream() ? XMLStreamWriterUtil.getOutputStream(sw) : null; if (rawContext != null) { Marshaller m = rawContext.createMarshaller(); m.setProperty("jaxb.fragment", Boolean.TRUE); m.setAttachmentMarshaller(am); if (os != null) { m.marshal(jaxbObject, os); } else { m.marshal(jaxbObject, sw); } } else { if (os != null && encoding != null && encoding.equalsIgnoreCase(SOAPBindingCodec.UTF8_ENCODING)) { bridge.marshal(jaxbObject, os, sw.getNamespaceContext(), am); } else { bridge.marshal(jaxbObject, sw, am); } } //cleanup() is not needed since JAXB doesn't keep ref to AttachmentMarshaller //am.cleanup(); } catch (JAXBException e) { // bug 6449684, spec 4.3.4 throw new WebServiceException(e); } }
Example #2
Source File: JAXBDispatchMessage.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
@Override @SuppressWarnings("unchecked") public void writeTo(XMLStreamWriter sw) throws XMLStreamException { try { // MtomCodec sets its own AttachmentMarshaller AttachmentMarshaller am = (sw instanceof MtomStreamWriter) ? ((MtomStreamWriter) sw).getAttachmentMarshaller() : new AttachmentMarshallerImpl(attachmentSet); // Get the encoding of the writer String encoding = XMLStreamWriterUtil.getEncoding(sw); // Get output stream and use JAXB UTF-8 writer OutputStream os = bridge.supportOutputStream() ? XMLStreamWriterUtil.getOutputStream(sw) : null; if (rawContext != null) { Marshaller m = rawContext.createMarshaller(); m.setProperty("jaxb.fragment", Boolean.FALSE); m.setAttachmentMarshaller(am); if (os != null) { m.marshal(jaxbObject, os); } else { m.marshal(jaxbObject, sw); } } else { if (os != null && encoding != null && encoding.equalsIgnoreCase(SOAPBindingCodec.UTF8_ENCODING)) { bridge.marshal(jaxbObject, os, sw.getNamespaceContext(), am); } else { bridge.marshal(jaxbObject, sw, am); } } //cleanup() is not needed since JAXB doesn't keep ref to AttachmentMarshaller } catch (JAXBException e) { // bug 6449684, spec 4.3.4 throw new WebServiceException(e); } }
Example #3
Source File: JAXBMessage.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
@Override public void writePayloadTo(XMLStreamWriter sw) throws XMLStreamException { try { // MtomCodec sets its own AttachmentMarshaller AttachmentMarshaller am = (sw instanceof MtomStreamWriter) ? ((MtomStreamWriter)sw).getAttachmentMarshaller() : new AttachmentMarshallerImpl(attachmentSet); // Get the encoding of the writer String encoding = XMLStreamWriterUtil.getEncoding(sw); // Get output stream and use JAXB UTF-8 writer OutputStream os = bridge.supportOutputStream() ? XMLStreamWriterUtil.getOutputStream(sw) : null; if (rawContext != null) { Marshaller m = rawContext.createMarshaller(); m.setProperty("jaxb.fragment", Boolean.TRUE); m.setAttachmentMarshaller(am); if (os != null) { m.marshal(jaxbObject, os); } else { m.marshal(jaxbObject, sw); } } else { if (os != null && encoding != null && encoding.equalsIgnoreCase(SOAPBindingCodec.UTF8_ENCODING)) { bridge.marshal(jaxbObject, os, sw.getNamespaceContext(), am); } else { bridge.marshal(jaxbObject, sw, am); } } //cleanup() is not needed since JAXB doesn't keep ref to AttachmentMarshaller //am.cleanup(); } catch (JAXBException e) { // bug 6449684, spec 4.3.4 throw new WebServiceException(e); } }
Example #4
Source File: JAXBDispatchMessage.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
@Override @SuppressWarnings("unchecked") public void writeTo(XMLStreamWriter sw) throws XMLStreamException { try { // MtomCodec sets its own AttachmentMarshaller AttachmentMarshaller am = (sw instanceof MtomStreamWriter) ? ((MtomStreamWriter) sw).getAttachmentMarshaller() : new AttachmentMarshallerImpl(attachmentSet); // Get the encoding of the writer String encoding = XMLStreamWriterUtil.getEncoding(sw); // Get output stream and use JAXB UTF-8 writer OutputStream os = bridge.supportOutputStream() ? XMLStreamWriterUtil.getOutputStream(sw) : null; if (rawContext != null) { Marshaller m = rawContext.createMarshaller(); m.setProperty("jaxb.fragment", Boolean.FALSE); m.setAttachmentMarshaller(am); if (os != null) { m.marshal(jaxbObject, os); } else { m.marshal(jaxbObject, sw); } } else { if (os != null && encoding != null && encoding.equalsIgnoreCase(SOAPBindingCodec.UTF8_ENCODING)) { bridge.marshal(jaxbObject, os, sw.getNamespaceContext(), am); } else { bridge.marshal(jaxbObject, sw, am); } } //cleanup() is not needed since JAXB doesn't keep ref to AttachmentMarshaller } catch (JAXBException e) { // bug 6449684, spec 4.3.4 throw new WebServiceException(e); } }
Example #5
Source File: JAXBMessage.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
@Override public void writePayloadTo(XMLStreamWriter sw) throws XMLStreamException { try { // MtomCodec sets its own AttachmentMarshaller AttachmentMarshaller am = (sw instanceof MtomStreamWriter) ? ((MtomStreamWriter)sw).getAttachmentMarshaller() : new AttachmentMarshallerImpl(attachmentSet); // Get the encoding of the writer String encoding = XMLStreamWriterUtil.getEncoding(sw); // Get output stream and use JAXB UTF-8 writer OutputStream os = bridge.supportOutputStream() ? XMLStreamWriterUtil.getOutputStream(sw) : null; if (rawContext != null) { Marshaller m = rawContext.createMarshaller(); m.setProperty("jaxb.fragment", Boolean.TRUE); m.setAttachmentMarshaller(am); if (os != null) { m.marshal(jaxbObject, os); } else { m.marshal(jaxbObject, sw); } } else { if (os != null && encoding != null && encoding.equalsIgnoreCase(SOAPBindingCodec.UTF8_ENCODING)) { bridge.marshal(jaxbObject, os, sw.getNamespaceContext(), am); } else { bridge.marshal(jaxbObject, sw, am); } } //cleanup() is not needed since JAXB doesn't keep ref to AttachmentMarshaller //am.cleanup(); } catch (JAXBException e) { // bug 6449684, spec 4.3.4 throw new WebServiceException(e); } }
Example #6
Source File: JAXBDispatchMessage.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
@Override @SuppressWarnings("unchecked") public void writeTo(XMLStreamWriter sw) throws XMLStreamException { try { // MtomCodec sets its own AttachmentMarshaller AttachmentMarshaller am = (sw instanceof MtomStreamWriter) ? ((MtomStreamWriter) sw).getAttachmentMarshaller() : new AttachmentMarshallerImpl(attachmentSet); // Get the encoding of the writer String encoding = XMLStreamWriterUtil.getEncoding(sw); // Get output stream and use JAXB UTF-8 writer OutputStream os = bridge.supportOutputStream() ? XMLStreamWriterUtil.getOutputStream(sw) : null; if (rawContext != null) { Marshaller m = rawContext.createMarshaller(); m.setProperty("jaxb.fragment", Boolean.FALSE); m.setAttachmentMarshaller(am); if (os != null) { m.marshal(jaxbObject, os); } else { m.marshal(jaxbObject, sw); } } else { if (os != null && encoding != null && encoding.equalsIgnoreCase(SOAPBindingCodec.UTF8_ENCODING)) { bridge.marshal(jaxbObject, os, sw.getNamespaceContext(), am); } else { bridge.marshal(jaxbObject, sw, am); } } //cleanup() is not needed since JAXB doesn't keep ref to AttachmentMarshaller } catch (JAXBException e) { // bug 6449684, spec 4.3.4 throw new WebServiceException(e); } }
Example #7
Source File: JAXBMessage.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
@Override public void writePayloadTo(XMLStreamWriter sw) throws XMLStreamException { try { // MtomCodec sets its own AttachmentMarshaller AttachmentMarshaller am = (sw instanceof MtomStreamWriter) ? ((MtomStreamWriter)sw).getAttachmentMarshaller() : new AttachmentMarshallerImpl(attachmentSet); // Get the encoding of the writer String encoding = XMLStreamWriterUtil.getEncoding(sw); // Get output stream and use JAXB UTF-8 writer OutputStream os = bridge.supportOutputStream() ? XMLStreamWriterUtil.getOutputStream(sw) : null; if (rawContext != null) { Marshaller m = rawContext.createMarshaller(); m.setProperty("jaxb.fragment", Boolean.TRUE); m.setAttachmentMarshaller(am); if (os != null) { m.marshal(jaxbObject, os); } else { m.marshal(jaxbObject, sw); } } else { if (os != null && encoding != null && encoding.equalsIgnoreCase(SOAPBindingCodec.UTF8_ENCODING)) { bridge.marshal(jaxbObject, os, sw.getNamespaceContext(), am); } else { bridge.marshal(jaxbObject, sw, am); } } //cleanup() is not needed since JAXB doesn't keep ref to AttachmentMarshaller //am.cleanup(); } catch (JAXBException e) { // bug 6449684, spec 4.3.4 throw new WebServiceException(e); } }
Example #8
Source File: JAXBDispatchMessage.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
@Override @SuppressWarnings("unchecked") public void writeTo(XMLStreamWriter sw) throws XMLStreamException { try { // MtomCodec sets its own AttachmentMarshaller AttachmentMarshaller am = (sw instanceof MtomStreamWriter) ? ((MtomStreamWriter) sw).getAttachmentMarshaller() : new AttachmentMarshallerImpl(attachmentSet); // Get the encoding of the writer String encoding = XMLStreamWriterUtil.getEncoding(sw); // Get output stream and use JAXB UTF-8 writer OutputStream os = bridge.supportOutputStream() ? XMLStreamWriterUtil.getOutputStream(sw) : null; if (rawContext != null) { Marshaller m = rawContext.createMarshaller(); m.setProperty("jaxb.fragment", Boolean.FALSE); m.setAttachmentMarshaller(am); if (os != null) { m.marshal(jaxbObject, os); } else { m.marshal(jaxbObject, sw); } } else { if (os != null && encoding != null && encoding.equalsIgnoreCase(SOAPBindingCodec.UTF8_ENCODING)) { bridge.marshal(jaxbObject, os, sw.getNamespaceContext(), am); } else { bridge.marshal(jaxbObject, sw, am); } } //cleanup() is not needed since JAXB doesn't keep ref to AttachmentMarshaller } catch (JAXBException e) { // bug 6449684, spec 4.3.4 throw new WebServiceException(e); } }
Example #9
Source File: JAXBMessage.java From hottub with GNU General Public License v2.0 | 5 votes |
@Override public void writePayloadTo(XMLStreamWriter sw) throws XMLStreamException { try { // MtomCodec sets its own AttachmentMarshaller AttachmentMarshaller am = (sw instanceof MtomStreamWriter) ? ((MtomStreamWriter)sw).getAttachmentMarshaller() : new AttachmentMarshallerImpl(attachmentSet); // Get the encoding of the writer String encoding = XMLStreamWriterUtil.getEncoding(sw); // Get output stream and use JAXB UTF-8 writer OutputStream os = bridge.supportOutputStream() ? XMLStreamWriterUtil.getOutputStream(sw) : null; if (rawContext != null) { Marshaller m = rawContext.createMarshaller(); m.setProperty("jaxb.fragment", Boolean.TRUE); m.setAttachmentMarshaller(am); if (os != null) { m.marshal(jaxbObject, os); } else { m.marshal(jaxbObject, sw); } } else { if (os != null && encoding != null && encoding.equalsIgnoreCase(SOAPBindingCodec.UTF8_ENCODING)) { bridge.marshal(jaxbObject, os, sw.getNamespaceContext(), am); } else { bridge.marshal(jaxbObject, sw, am); } } //cleanup() is not needed since JAXB doesn't keep ref to AttachmentMarshaller //am.cleanup(); } catch (JAXBException e) { // bug 6449684, spec 4.3.4 throw new WebServiceException(e); } }
Example #10
Source File: JAXBDispatchMessage.java From hottub with GNU General Public License v2.0 | 5 votes |
@Override @SuppressWarnings("unchecked") public void writeTo(XMLStreamWriter sw) throws XMLStreamException { try { // MtomCodec sets its own AttachmentMarshaller AttachmentMarshaller am = (sw instanceof MtomStreamWriter) ? ((MtomStreamWriter) sw).getAttachmentMarshaller() : new AttachmentMarshallerImpl(attachmentSet); // Get the encoding of the writer String encoding = XMLStreamWriterUtil.getEncoding(sw); // Get output stream and use JAXB UTF-8 writer OutputStream os = bridge.supportOutputStream() ? XMLStreamWriterUtil.getOutputStream(sw) : null; if (rawContext != null) { Marshaller m = rawContext.createMarshaller(); m.setProperty("jaxb.fragment", Boolean.FALSE); m.setAttachmentMarshaller(am); if (os != null) { m.marshal(jaxbObject, os); } else { m.marshal(jaxbObject, sw); } } else { if (os != null && encoding != null && encoding.equalsIgnoreCase(SOAPBindingCodec.UTF8_ENCODING)) { bridge.marshal(jaxbObject, os, sw.getNamespaceContext(), am); } else { bridge.marshal(jaxbObject, sw, am); } } //cleanup() is not needed since JAXB doesn't keep ref to AttachmentMarshaller } catch (JAXBException e) { // bug 6449684, spec 4.3.4 throw new WebServiceException(e); } }
Example #11
Source File: JAXBMessage.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
@Override public void writePayloadTo(XMLStreamWriter sw) throws XMLStreamException { try { // MtomCodec sets its own AttachmentMarshaller AttachmentMarshaller am = (sw instanceof MtomStreamWriter) ? ((MtomStreamWriter)sw).getAttachmentMarshaller() : new AttachmentMarshallerImpl(attachmentSet); // Get the encoding of the writer String encoding = XMLStreamWriterUtil.getEncoding(sw); // Get output stream and use JAXB UTF-8 writer OutputStream os = bridge.supportOutputStream() ? XMLStreamWriterUtil.getOutputStream(sw) : null; if (rawContext != null) { Marshaller m = rawContext.createMarshaller(); m.setProperty("jaxb.fragment", Boolean.TRUE); m.setAttachmentMarshaller(am); if (os != null) { m.marshal(jaxbObject, os); } else { m.marshal(jaxbObject, sw); } } else { if (os != null && encoding != null && encoding.equalsIgnoreCase(SOAPBindingCodec.UTF8_ENCODING)) { bridge.marshal(jaxbObject, os, sw.getNamespaceContext(), am); } else { bridge.marshal(jaxbObject, sw, am); } } //cleanup() is not needed since JAXB doesn't keep ref to AttachmentMarshaller //am.cleanup(); } catch (JAXBException e) { // bug 6449684, spec 4.3.4 throw new WebServiceException(e); } }
Example #12
Source File: JAXBDispatchMessage.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
@Override @SuppressWarnings("unchecked") public void writeTo(XMLStreamWriter sw) throws XMLStreamException { try { // MtomCodec sets its own AttachmentMarshaller AttachmentMarshaller am = (sw instanceof MtomStreamWriter) ? ((MtomStreamWriter) sw).getAttachmentMarshaller() : new AttachmentMarshallerImpl(attachmentSet); // Get the encoding of the writer String encoding = XMLStreamWriterUtil.getEncoding(sw); // Get output stream and use JAXB UTF-8 writer OutputStream os = bridge.supportOutputStream() ? XMLStreamWriterUtil.getOutputStream(sw) : null; if (rawContext != null) { Marshaller m = rawContext.createMarshaller(); m.setProperty("jaxb.fragment", Boolean.FALSE); m.setAttachmentMarshaller(am); if (os != null) { m.marshal(jaxbObject, os); } else { m.marshal(jaxbObject, sw); } } else { if (os != null && encoding != null && encoding.equalsIgnoreCase(SOAPBindingCodec.UTF8_ENCODING)) { bridge.marshal(jaxbObject, os, sw.getNamespaceContext(), am); } else { bridge.marshal(jaxbObject, sw, am); } } //cleanup() is not needed since JAXB doesn't keep ref to AttachmentMarshaller } catch (JAXBException e) { // bug 6449684, spec 4.3.4 throw new WebServiceException(e); } }
Example #13
Source File: JAXBMessage.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
@Override public void writePayloadTo(XMLStreamWriter sw) throws XMLStreamException { try { // MtomCodec sets its own AttachmentMarshaller AttachmentMarshaller am = (sw instanceof MtomStreamWriter) ? ((MtomStreamWriter)sw).getAttachmentMarshaller() : new AttachmentMarshallerImpl(attachmentSet); // Get the encoding of the writer String encoding = XMLStreamWriterUtil.getEncoding(sw); // Get output stream and use JAXB UTF-8 writer OutputStream os = bridge.supportOutputStream() ? XMLStreamWriterUtil.getOutputStream(sw) : null; if (rawContext != null) { Marshaller m = rawContext.createMarshaller(); m.setProperty("jaxb.fragment", Boolean.TRUE); m.setAttachmentMarshaller(am); if (os != null) { m.marshal(jaxbObject, os); } else { m.marshal(jaxbObject, sw); } } else { if (os != null && encoding != null && encoding.equalsIgnoreCase(SOAPBindingCodec.UTF8_ENCODING)) { bridge.marshal(jaxbObject, os, sw.getNamespaceContext(), am); } else { bridge.marshal(jaxbObject, sw, am); } } //cleanup() is not needed since JAXB doesn't keep ref to AttachmentMarshaller //am.cleanup(); } catch (JAXBException e) { // bug 6449684, spec 4.3.4 throw new WebServiceException(e); } }
Example #14
Source File: JAXBDispatchMessage.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
@Override @SuppressWarnings("unchecked") public void writeTo(XMLStreamWriter sw) throws XMLStreamException { try { // MtomCodec sets its own AttachmentMarshaller AttachmentMarshaller am = (sw instanceof MtomStreamWriter) ? ((MtomStreamWriter) sw).getAttachmentMarshaller() : new AttachmentMarshallerImpl(attachmentSet); // Get the encoding of the writer String encoding = XMLStreamWriterUtil.getEncoding(sw); // Get output stream and use JAXB UTF-8 writer OutputStream os = bridge.supportOutputStream() ? XMLStreamWriterUtil.getOutputStream(sw) : null; if (rawContext != null) { Marshaller m = rawContext.createMarshaller(); m.setProperty("jaxb.fragment", Boolean.FALSE); m.setAttachmentMarshaller(am); if (os != null) { m.marshal(jaxbObject, os); } else { m.marshal(jaxbObject, sw); } } else { if (os != null && encoding != null && encoding.equalsIgnoreCase(SOAPBindingCodec.UTF8_ENCODING)) { bridge.marshal(jaxbObject, os, sw.getNamespaceContext(), am); } else { bridge.marshal(jaxbObject, sw, am); } } //cleanup() is not needed since JAXB doesn't keep ref to AttachmentMarshaller } catch (JAXBException e) { // bug 6449684, spec 4.3.4 throw new WebServiceException(e); } }