Java Code Examples for javax.xml.ws.EndpointReference#writeTo()

The following examples show how to use javax.xml.ws.EndpointReference#writeTo() . 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: ProviderImpl.java    From cxf with Apache License 2.0 6 votes vote down vote up
/**
 * Convert from EndpointReference to CXF internal 2005/08 EndpointReferenceType
 *
 * @param external the javax.xml.ws.EndpointReference
 * @return CXF internal 2005/08 EndpointReferenceType
 */
public static EndpointReferenceType convertToInternal(EndpointReference external) {
    if (external instanceof W3CEndpointReference) {

        Unmarshaller um = null;
        try {
            DocumentFragment frag = DOMUtils.getEmptyDocument().createDocumentFragment();
            DOMResult result = new DOMResult(frag);
            external.writeTo(result);
            W3CDOMStreamReader reader = new W3CDOMStreamReader(frag);

            // CXF internal 2005/08 EndpointReferenceType should be
            // compatible with W3CEndpointReference
            //jaxContext = ContextUtils.getJAXBContext();
            JAXBContext context = JAXBContext
                .newInstance(new Class[] {org.apache.cxf.ws.addressing.ObjectFactory.class});
            um = context.createUnmarshaller();
            return um.unmarshal(reader, EndpointReferenceType.class).getValue();
        } catch (JAXBException e) {
            throw new IllegalArgumentException("Could not unmarshal EndpointReference", e);
        } finally {
            JAXBUtils.closeUnmarshaller(um);
        }
    }
    return null;
}
 
Example 2
Source File: WSEndpointReference.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates from the spec version of {@link EndpointReference}.
 *
 * <p>
 * This method performs the data conversion, so it's slow.
 * Do not use this method in a performance critical path.
 */
public WSEndpointReference(EndpointReference epr, AddressingVersion version) {
    try {
        MutableXMLStreamBuffer xsb = new MutableXMLStreamBuffer();
        epr.writeTo(new XMLStreamBufferResult(xsb));
        this.infoset = xsb;
        this.version = version;
        this.rootElement = new QName("EndpointReference", version.nsUri);
        parse();
    } catch (XMLStreamException e) {
        throw new WebServiceException(ClientMessages.FAILED_TO_PARSE_EPR(epr),e);
    }
}
 
Example 3
Source File: WSEndpointReference.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates from the spec version of {@link EndpointReference}.
 *
 * <p>
 * This method performs the data conversion, so it's slow.
 * Do not use this method in a performance critical path.
 */
public WSEndpointReference(EndpointReference epr, AddressingVersion version) {
    try {
        MutableXMLStreamBuffer xsb = new MutableXMLStreamBuffer();
        epr.writeTo(new XMLStreamBufferResult(xsb));
        this.infoset = xsb;
        this.version = version;
        this.rootElement = new QName("EndpointReference", version.nsUri);
        parse();
    } catch (XMLStreamException e) {
        throw new WebServiceException(ClientMessages.FAILED_TO_PARSE_EPR(epr),e);
    }
}
 
Example 4
Source File: WSEndpointReference.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates from the spec version of {@link EndpointReference}.
 *
 * <p>
 * This method performs the data conversion, so it's slow.
 * Do not use this method in a performance critical path.
 */
public WSEndpointReference(EndpointReference epr, AddressingVersion version) {
    try {
        MutableXMLStreamBuffer xsb = new MutableXMLStreamBuffer();
        epr.writeTo(new XMLStreamBufferResult(xsb));
        this.infoset = xsb;
        this.version = version;
        this.rootElement = new QName("EndpointReference", version.nsUri);
        parse();
    } catch (XMLStreamException e) {
        throw new WebServiceException(ClientMessages.FAILED_TO_PARSE_EPR(epr),e);
    }
}
 
Example 5
Source File: WSEndpointReference.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates from the spec version of {@link EndpointReference}.
 *
 * <p>
 * This method performs the data conversion, so it's slow.
 * Do not use this method in a performance critical path.
 */
public WSEndpointReference(EndpointReference epr, AddressingVersion version) {
    try {
        MutableXMLStreamBuffer xsb = new MutableXMLStreamBuffer();
        epr.writeTo(new XMLStreamBufferResult(xsb));
        this.infoset = xsb;
        this.version = version;
        this.rootElement = new QName("EndpointReference", version.nsUri);
        parse();
    } catch (XMLStreamException e) {
        throw new WebServiceException(ClientMessages.FAILED_TO_PARSE_EPR(epr),e);
    }
}
 
Example 6
Source File: WSEndpointReference.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates from the spec version of {@link EndpointReference}.
 *
 * <p>
 * This method performs the data conversion, so it's slow.
 * Do not use this method in a performance critical path.
 */
public WSEndpointReference(EndpointReference epr, AddressingVersion version) {
    try {
        MutableXMLStreamBuffer xsb = new MutableXMLStreamBuffer();
        epr.writeTo(new XMLStreamBufferResult(xsb));
        this.infoset = xsb;
        this.version = version;
        this.rootElement = new QName("EndpointReference", version.nsUri);
        parse();
    } catch (XMLStreamException e) {
        throw new WebServiceException(ClientMessages.FAILED_TO_PARSE_EPR(epr),e);
    }
}
 
Example 7
Source File: WSEndpointReference.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates from the spec version of {@link EndpointReference}.
 *
 * <p>
 * This method performs the data conversion, so it's slow.
 * Do not use this method in a performance critical path.
 */
public WSEndpointReference(EndpointReference epr, AddressingVersion version) {
    try {
        MutableXMLStreamBuffer xsb = new MutableXMLStreamBuffer();
        epr.writeTo(new XMLStreamBufferResult(xsb));
        this.infoset = xsb;
        this.version = version;
        this.rootElement = new QName("EndpointReference", version.nsUri);
        parse();
    } catch (XMLStreamException e) {
        throw new WebServiceException(ClientMessages.FAILED_TO_PARSE_EPR(epr),e);
    }
}
 
Example 8
Source File: WSEndpointReference.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates from the spec version of {@link EndpointReference}.
 *
 * <p>
 * This method performs the data conversion, so it's slow.
 * Do not use this method in a performance critical path.
 */
public WSEndpointReference(EndpointReference epr, AddressingVersion version) {
    try {
        MutableXMLStreamBuffer xsb = new MutableXMLStreamBuffer();
        epr.writeTo(new XMLStreamBufferResult(xsb));
        this.infoset = xsb;
        this.version = version;
        this.rootElement = new QName("EndpointReference", version.nsUri);
        parse();
    } catch (XMLStreamException e) {
        throw new WebServiceException(ClientMessages.FAILED_TO_PARSE_EPR(epr),e);
    }
}
 
Example 9
Source File: WSEndpointReference.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates from the spec version of {@link EndpointReference}.
 *
 * <p>
 * This method performs the data conversion, so it's slow.
 * Do not use this method in a performance critical path.
 */
public WSEndpointReference(EndpointReference epr, AddressingVersion version) {
    try {
        MutableXMLStreamBuffer xsb = new MutableXMLStreamBuffer();
        epr.writeTo(new XMLStreamBufferResult(xsb));
        this.infoset = xsb;
        this.version = version;
        this.rootElement = new QName("EndpointReference", version.nsUri);
        parse();
    } catch (XMLStreamException e) {
        throw new WebServiceException(ClientMessages.FAILED_TO_PARSE_EPR(epr),e);
    }
}