use of jakarta.xml.ws.wsaddressing.W3CEndpointReference in project metro-jax-ws by eclipse-ee4j.
the class W3CEprTest method testWriteTo.
public void testWriteTo() {
StreamSource source = new StreamSource(new ByteArrayInputStream(epr.getBytes()));
W3CEndpointReference epr = new W3CEndpointReference(source);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
epr.writeTo(new StreamResult(baos));
System.out.println(baos.toString());
// dummy assertion
assertTrue(baos.toString().contains("xmlns:wsns=\"http://foobar.org/\""));
}
use of jakarta.xml.ws.wsaddressing.W3CEndpointReference in project metro-jax-ws by eclipse-ee4j.
the class W3CEPRTest method testW3CEprBuilder_withWSDL_ServiceName.
public void testW3CEprBuilder_withWSDL_ServiceName() throws Exception {
W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
builder = builder.address(getEndpointAddress());
builder = builder.serviceName(SERVICE_QNAME);
builder = builder.endpointName(PORT_QNAME);
builder = builder.wsdlDocumentLocation(getEndpointAddress() + "?wsdl");
DOMSource domsrc = makeDOMSource(xmlRefParam1);
Document document = (Document) domsrc.getNode();
builder = builder.referenceParameter(document.getDocumentElement());
domsrc = makeDOMSource(xmlRefParam2);
document = (Document) domsrc.getNode();
builder = builder.referenceParameter(document.getDocumentElement());
W3CEndpointReference epr = builder.build();
DOMResult result = new DOMResult();
epr.writeTo(result);
assertTrue(EprUtil.validateEPR(result.getNode(), W3CEndpointReference.class, getEndpointAddress(), SERVICE_QNAME, PORT_QNAME, null, getEndpointAddress() + "?wsdl"));
// ByteArrayOutputStream baos = new ByteArrayOutputStream();
// epr.writeTo(new StreamResult(baos));
// baos.writeTo(System.out);
}
use of jakarta.xml.ws.wsaddressing.W3CEndpointReference in project metro-jax-ws by eclipse-ee4j.
the class W3CEPRTest method testW3CEprBuilder_withWSDL.
public void testW3CEprBuilder_withWSDL() throws Exception {
W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
builder = builder.address(getEndpointAddress());
builder = builder.wsdlDocumentLocation(getEndpointAddress() + "?wsdl");
W3CEndpointReference epr = builder.build();
DOMResult result = new DOMResult();
epr.writeTo(result);
assertTrue(EprUtil.validateEPR(result.getNode(), W3CEndpointReference.class, getEndpointAddress(), null, null, null, null));
// ByteArrayOutputStream baos = new ByteArrayOutputStream();
// epr.writeTo(new StreamResult(baos));
// baos.writeTo(System.out);
}
use of jakarta.xml.ws.wsaddressing.W3CEndpointReference 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() == 2);
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 jakarta.xml.ws.wsaddressing.W3CEndpointReference in project metro-jax-ws by eclipse-ee4j.
the class HelloLiteralTest method testDispatchGetEPRMethodNoArg.
// functionality above needs to be clarified
public void testDispatchGetEPRMethodNoArg() {
EndpointReference epr = ((BindingProvider) getDispatchJAXB()).getEndpointReference();
assertTrue(epr != null);
assertTrue(epr instanceof W3CEndpointReference);
}
Aggregations