1 5 6 package javax.xml.ws; 7 8 import javax.xml.bind.annotation.XmlTransient; 9 import javax.xml.transform.Result ; 10 import javax.xml.transform.Source ; 11 import javax.xml.transform.stream.StreamResult ; 12 import javax.xml.ws.spi.Provider; 13 import javax.xml.ws.wsaddressing.W3CEndpointReference; 14 import java.io.StringWriter ; 15 16 66 @XmlTransient public abstract class EndpointReference { 68 protected EndpointReference(){}; 72 73 88 public static EndpointReference readFrom(Source eprInfoset) { 89 return Provider.provider().readEndpointReference(eprInfoset); 90 } 91 92 101 public abstract void writeTo(Result result); 102 103 104 156 public <T> T getPort(Class <T> serviceEndpointInterface, 157 WebServiceFeature... features) { 158 return Provider.provider().getPort(this, serviceEndpointInterface, 159 features); 160 } 161 162 165 public String toString() { 166 StringWriter w = new StringWriter (); 167 writeTo(new StreamResult (w)); 168 return w.toString(); 169 } 170 } 171 | Popular Tags |