use of com.sun.xml.ws.api.addressing.WSEndpointReference in project metro-jax-ws by eclipse-ee4j.
the class EprExtensionsContributorTest method testEprOnServerSide.
/**
* Tests server-side access to EPR extensions specified in WSDL
*
* @throws Exception
*/
public void testEprOnServerSide() throws Exception {
HelloService service = new HelloService();
Hello hello = service.getHelloPort();
W3CEndpointReference serverEpr = hello.getW3CEPR();
// printEPR(serverEpr);
WSEndpointReference wsepr = new WSEndpointReference(serverEpr);
assertTrue(wsepr.getEPRExtensions().size() == 1);
WSEndpointReference.EPRExtension idExtn = wsepr.getEPRExtension(new QName("http://example.com/addressingidentity", "Identity"));
assertTrue(idExtn != null && idExtn.getQName().equals(new QName("http://example.com/addressingidentity", "Identity")));
}
use of com.sun.xml.ws.api.addressing.WSEndpointReference in project metro-jax-ws by eclipse-ee4j.
the class EprExtensionsContributorTest method testEprWithDispatchWithWSDL.
/**
* Tests client-side access to EPR extensions specified in WSDL
*
* @throws Exception
*/
public void testEprWithDispatchWithWSDL() throws Exception {
Service service = new HelloService();
Dispatch dispatch = service.createDispatch(portName, Source.class, Service.Mode.PAYLOAD);
WSEndpointReference wsepr = ((WSBindingProvider) dispatch).getWSEndpointReference();
assertTrue(wsepr.getEPRExtensions().size() == 1);
WSEndpointReference.EPRExtension idExtn = wsepr.getEPRExtension(new QName("http://example.com/addressingidentity", "Identity"));
assertTrue(idExtn != null && idExtn.getQName().equals(new QName("http://example.com/addressingidentity", "Identity")));
}
use of com.sun.xml.ws.api.addressing.WSEndpointReference in project metro-jax-ws by eclipse-ee4j.
the class EprExtensionsContributorTest method testEprInPublishedWSDL.
/**
* Tests the published wsdl for EPR extensions
* @throws Exception
*/
public void testEprInPublishedWSDL() throws Exception {
HelloService service = new HelloService();
Hello hello = service.getHelloPort();
WSDLPort wsdlModel = ((WSBindingProvider) hello).getPortInfo().getPort();
WSEndpointReference wsdlepr = wsdlModel.getExtension(WSEndpointReference.class);
assertTrue(wsdlepr.getEPRExtensions().size() == 1);
WSEndpointReference.EPRExtension idExtn = wsdlepr.getEPRExtension(new QName("http://example.com/addressingidentity", "Identity"));
assertTrue(idExtn != null && idExtn.getQName().equals(new QName("http://example.com/addressingidentity", "Identity")));
}
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().getClassLoader().getResourceAsStream("newAddress.epr.xml"))), true);
}
use of com.sun.xml.ws.api.addressing.WSEndpointReference in project metro-jax-ws by eclipse-ee4j.
the class WSEndpointReferenceTest method testCreateViaSpec.
public void testCreateViaSpec() throws Exception {
W3CEndpointReference spec = new W3CEndpointReference(new StreamSource(getClass().getClassLoader().getResource("test-epr.xml").toExternalForm()));
new WSEndpointReference(spec, W3C);
}
Aggregations