use of jakarta.xml.ws.wsaddressing.W3CEndpointReference in project metro-jax-ws by eclipse-ee4j.
the class EprMarshalUnmarshalTester method testMSEprMarshalling.
public void testMSEprMarshalling() throws JAXBException {
HelloService service = new HelloService();
BindingProvider bp = (BindingProvider) service.getHelloPort();
// validate w3c epr
W3CEndpointReference w3cEpr = (W3CEndpointReference) bp.getEndpointReference();
w3cEpr.writeTo(new StreamResult(System.out));
// assertTrue(EprUtil.validateEPR(w3cEpr, endpointAddress, serviceName, portName, portTypeName, true));
assertTrue(EprUtil.validateEPR(w3cEpr, endpointAddress, null, null, null, false));
Marshaller m = jaxbCtx.createMarshaller();
DOMResult w3cResult = new DOMResult();
m.marshal(w3cEpr, w3cResult);
// assertTrue(EprUtil.validateEPR(w3cResult.getNode(), W3CEndpointReference.class, endpointAddress, serviceName, portName, portTypeName, true));
assertTrue(EprUtil.validateEPR(w3cResult.getNode(), W3CEndpointReference.class, endpointAddress, null, null, null, false));
// validate ms epr
MemberSubmissionEndpointReference msEpr = bp.getEndpointReference(MemberSubmissionEndpointReference.class);
w3cEpr.writeTo(new StreamResult(System.out));
assertTrue(EprUtil.validateEPR(msEpr, endpointAddress, serviceName, portName, portTypeName, false));
DOMResult msResult = new DOMResult();
m.marshal(msEpr, msResult);
assertTrue(EprUtil.validateEPR(msResult.getNode(), MemberSubmissionEndpointReference.class, endpointAddress, serviceName, portName, portTypeName, true));
}
use of jakarta.xml.ws.wsaddressing.W3CEndpointReference in project metro-jax-ws by eclipse-ee4j.
the class EprMarshalUnmarshalTester method testW3CEPRBuilder.
public void testW3CEPRBuilder() throws Exception {
try {
String xmlParam1 = "<myns:MyParam1 xmlns:myns=\"http://cptestservice.org/wsdl\">Hello</myns:MyParam1>";
Node n1 = DOMUtil.createDOMNode(new ByteArrayInputStream(xmlParam1.getBytes()));
String metadata = "<myMetadata>This is not useful metadata</myMetadata>";
Node n2 = createDOMNodeNoNS(new ByteArrayInputStream(metadata.getBytes()));
W3CEndpointReferenceBuilder eprBuilder = new W3CEndpointReferenceBuilder();
eprBuilder.address(endpointAddress);
eprBuilder.referenceParameter((Element) n1.getFirstChild());
eprBuilder.metadata((Element) n2.getFirstChild());
W3CEndpointReference epr = eprBuilder.build();
epr.writeTo(new StreamResult(System.out));
} catch (Exception e) {
e.printStackTrace();
assertTrue(false);
}
}
use of jakarta.xml.ws.wsaddressing.W3CEndpointReference in project metro-jax-ws by eclipse-ee4j.
the class AddNumbersClient method testDefaultOutputAction.
public void testDefaultOutputAction() throws Exception {
if (ClientServerTestUtil.useLocal()) {
return;
}
AddNumbers proxy = createProxy();
W3CEndpointReference epr = proxy.getW3CEPR();
System.out.println("---------------------------------------");
epr.writeTo(new StreamResult(System.out));
System.out.println("---------------------------------------");
// EprUtil.validateEPR(epr, endpointAddress, serviceName, portName, portTypeName, Boolean.TRUE);
EprUtil.validateEPR(epr, endpointAddress, null, null, null, false);
// AddNumbers newProxy = epr.getPort(AddNumbers.class);
// int result = newProxy.addNumbersNoAction(10, 10);
// assertEquals(20, result);
}
use of jakarta.xml.ws.wsaddressing.W3CEndpointReference in project metro-jax-ws by eclipse-ee4j.
the class HelloLiteralTest method testDispatchWithPortsGetW3CEPRFromClass.
public void testDispatchWithPortsGetW3CEPRFromClass() {
if (ClientServerTestUtil.useLocal()) {
System.out.println("http transport only exiting");
return;
}
EndpointReference epr = ((BindingProvider) getDispatchSOAPMessageSourceWithPorts()).getEndpointReference(W3CEndpointReference.class);
assertTrue(epr != null);
assertTrue(epr instanceof W3CEndpointReference);
}
use of jakarta.xml.ws.wsaddressing.W3CEndpointReference in project metro-jax-ws by eclipse-ee4j.
the class HelloLiteralTest method testGetW3CEPRFromClass.
public void testGetW3CEPRFromClass() {
EndpointReference epr = ((BindingProvider) stub).getEndpointReference(W3CEndpointReference.class);
assertTrue(epr != null);
assertTrue(epr instanceof W3CEndpointReference);
}
Aggregations