FileDocCategorySizeDatePackage
W3CEndpointReference.javaAPI DocJava SE 6 API4560Tue Jun 10 00:27:16 BST 2008javax.xml.ws.wsaddressing

W3CEndpointReference

public final class W3CEndpointReference extends EndpointReference
This class represents a W3C Addressing EndpointReferece which is a remote reference to a web service endpoint that supports the W3C WS-Addressing 1.0 - Core Recommendation.

Developers should use this class in their SEIs if they want to pass/return endpoint references that represent the W3C WS-Addressing recommendation.

JAXB will use the JAXB annotations and bind this class to XML infoset that is consistent with that defined by WS-Addressing. See WS-Addressing for more information on WS-Addressing EndpointReferences.

since
JAX-WS 2.1

Fields Summary
private static final JAXBContext
w3cjc
private Address
address
private Elements
referenceParameters
private Elements
metadata
Map
attributes
List
elements
protected static final String
NS
Constructors Summary
protected W3CEndpointReference()


      
    
public W3CEndpointReference(Source source)
Creates an EPR from infoset representation

param
source A source object containing valid XmlInfoset instance consistent with the W3C WS-Addressing Core recommendation.
throws
WebServiceException If the source does NOT contain a valid W3C WS-Addressing EndpointReference.
throws
NullPointerException If the null source value is given

        try {
            W3CEndpointReference epr = w3cjc.createUnmarshaller().unmarshal(source,W3CEndpointReference.class).getValue();
            this.address = epr.address;
            this.metadata = epr.metadata;
            this.referenceParameters = epr.referenceParameters;
        } catch (JAXBException e) {
            throw new WebServiceException("Error unmarshalling W3CEndpointReference " ,e);
        } catch (ClassCastException e) {
            throw new WebServiceException("Source did not contain W3CEndpointReference", e);
        }
    
Methods Summary
private static javax.xml.bind.JAXBContextgetW3CJaxbContext()

        try {
            return JAXBContext.newInstance(W3CEndpointReference.class);
        } catch (JAXBException e) {
            throw new WebServiceException("Error creating JAXBContext for W3CEndpointReference. ", e);
        }
    
public voidwriteTo(javax.xml.transform.Result result)
{@inheritDoc}

        try {
            Marshaller marshaller = w3cjc.createMarshaller();
            marshaller.setProperty(Marshaller.JAXB_FRAGMENT, true);
            marshaller.marshal(this, result);
        } catch (JAXBException e) {
            throw new WebServiceException("Error marshalling W3CEndpointReference. ", e);
        }