use of com.sun.xml.ws.api.addressing.WSEndpointReference in project metro-jax-ws by eclipse-ee4j.
the class WSEndpointReferenceTest method testReplace.
public void testReplace() throws Exception {
WSEndpointReference n = createEPR().createWithAddress("newAddress");
System.out.println(n);
assertEquals("newAddress", n.getAddress());
XMLAssert.assertXMLIdentical(compareXML(n.toString(), new InputStreamReader(getClass().getResourceAsStream("newAddress.epr.xml"))), true);
}
use of com.sun.xml.ws.api.addressing.WSEndpointReference in project metro-jax-ws by eclipse-ee4j.
the class EPRWithNSDeclarationsTest method test1.
public void test1() throws Exception {
URL fileurl = getResource("hello_literal_identity1.wsdl");
WSDLModel doc = RuntimeWSDLParser.parse(fileurl, new StreamSource(fileurl.toExternalForm()), getResolver(), true, null);
WSDLService service = doc.getService(new QName("urn:test", "Hello"));
WSDLPort port = service.getFirstPort();
WSEndpointReference wsepr = port.getExtension(WSEndpointReference.class);
QName q = new QName("http://schemas.xmlsoap.org/ws/2006/02/addressingidentity", "Identity");
WSEndpointReference.EPRExtension eprExtn = wsepr.getEPRExtension(q);
XMLStreamReader xsr = eprExtn.readAsXMLStreamReader();
if (xsr.getEventType() == XMLStreamConstants.START_DOCUMENT)
xsr.next();
assertEquals(q.getNamespaceURI(), xsr.getNamespaceURI());
assertEquals(q.getLocalPart(), xsr.getLocalName());
}
use of com.sun.xml.ws.api.addressing.WSEndpointReference in project metro-jax-ws by eclipse-ee4j.
the class EPRWithNSDeclarationsTest method test3.
public void test3() throws Exception {
URL fileurl = getResource("hello_literal_identity3.wsdl");
WSDLModel doc = RuntimeWSDLParser.parse(fileurl, new StreamSource(fileurl.toExternalForm()), getResolver(), true, null);
WSDLService service = doc.getService(new QName("urn:test", "Hello2"));
WSDLPort port = service.getFirstPort();
WSEndpointReference wsepr = port.getExtension(WSEndpointReference.class);
QName q = new QName("http://schemas.xmlsoap.org/ws/2006/02/addressingidentity", "Identity");
WSEndpointReference.EPRExtension eprExtn = wsepr.getEPRExtension(q);
XMLStreamReader xsr = eprExtn.readAsXMLStreamReader();
if (xsr.getEventType() == XMLStreamConstants.START_DOCUMENT)
xsr.next();
assertEquals(q.getNamespaceURI(), xsr.getNamespaceURI());
assertEquals(q.getLocalPart(), xsr.getLocalName());
}
use of com.sun.xml.ws.api.addressing.WSEndpointReference in project metro-jax-ws by eclipse-ee4j.
the class EPRWithNSDeclarationsTest method test2.
public void test2() throws Exception {
URL fileurl = getResource("hello_literal_identity2.wsdl");
WSDLModel doc = RuntimeWSDLParser.parse(fileurl, new StreamSource(fileurl.toExternalForm()), getResolver(), true, null);
WSDLService service = doc.getService(new QName("urn:test", "Hello2"));
WSDLPort port = service.getFirstPort();
WSEndpointReference wsepr = port.getExtension(WSEndpointReference.class);
QName q = new QName("http://schemas.xmlsoap.org/ws/2006/02/addressingidentity", "Identity");
WSEndpointReference.EPRExtension eprExtn = wsepr.getEPRExtension(q);
XMLStreamReader xsr = eprExtn.readAsXMLStreamReader();
if (xsr.getEventType() == XMLStreamConstants.START_DOCUMENT)
xsr.next();
assertEquals(q.getNamespaceURI(), xsr.getNamespaceURI());
assertEquals(q.getLocalPart(), xsr.getLocalName());
}
use of com.sun.xml.ws.api.addressing.WSEndpointReference in project metro-jax-ws by eclipse-ee4j.
the class EPRWriteNReadTest method test2.
public void test2() throws Exception {
URL fileurl = getResource("hello_literal_identity2.wsdl");
WSDLModel doc = RuntimeWSDLParser.parse(fileurl, new StreamSource(fileurl.toExternalForm()), getResolver(), true, null);
WSDLService service = doc.getService(new QName("urn:test", "Hello2"));
WSDLPort port = service.getFirstPort();
WSEndpointReference wsepr = port.getExtension(WSEndpointReference.class);
verifyEPR(wsepr);
}
Aggregations