use of jakarta.xml.soap.SOAPMessage in project metro-jax-ws by eclipse-ee4j.
the class AddNumbersClient method testDispatchEPRGetPort.
// UsingAddressing wsdl:required=true
public void testDispatchEPRGetPort() throws Exception {
if (ClientServerTestUtil.useLocal()) {
System.out.println("HTTP Transport Only Exiting");
return;
}
Dispatch<SOAPMessage> dispatch = createDispatchWithWSDL();
EndpointReference epr = dispatch.getEndpointReference(MemberSubmissionEndpointReference.class);
// wsdl has addressing required
AddNumbersPortType port = epr.getPort(AddNumbersPortType.class);
assertTrue(port != null);
System.out.println("Adding numbers 2 and 4");
int result = port.addNumbers(2, 4);
assert (result == 6);
System.out.println("Addinion of 2 and 4 successful");
}
use of jakarta.xml.soap.SOAPMessage in project metro-jax-ws by eclipse-ee4j.
the class AddNumbersClient method testDispatchEPRGetPort.
public void testDispatchEPRGetPort() throws Exception {
if (ClientServerTestUtil.useLocal()) {
System.out.println("HTTP Transport Only Exiting");
return;
}
Dispatch<SOAPMessage> dispatch = createDispatchWithWSDL();
EndpointReference epr = dispatch.getEndpointReference(MemberSubmissionEndpointReference.class);
// wsdl has addressing required
AddNumbersPortType port = epr.getPort(AddNumbersPortType.class);
assertTrue(port != null);
System.out.println("Adding numbers 2 and 4");
int result = port.addNumbers(2, 4);
assert (result == 6);
System.out.println("Addinion of 2 and 4 successful");
}
use of jakarta.xml.soap.SOAPMessage in project metro-jax-ws by eclipse-ee4j.
the class AddNumbersClient method testCreateDispatchSMWsdlWEPR.
public void testCreateDispatchSMWsdlWEPR() throws Exception {
String eprString = "<EndpointReference xmlns=\"http://www.w3.org/2005/08/addressing\"><Address>" + "http://localhost:8080/jaxrpc-client_jaxws21_service_dispatch_features/hello</Address>" + "<Metadata><wsaw:ServiceName xmlns:wsaw=\"http://www.w3.org/2006/05/addressing/wsdl\" xmlns:wsns=\"http://example.com/\" EndpointName=\"AddNumbersPort\">wsns:AddNumbersService</wsaw:ServiceName>" + "</Metadata></EndpointReference>";
if (ClientServerTestUtil.useLocal()) {
System.out.println("HTTP Transport Only Exiting");
return;
}
RespectBindingFeature rbf = new RespectBindingFeature(false);
WebServiceFeature[] wse = new WebServiceFeature[] { rbf };
Service service = createServiceWithWSDL();
EndpointReference w3cEPR = createEPRStubServiceWithWSDL(service);
// W3CEPRString = w3cEPR.toString();
W3CEPRString = eprString;
Dispatch<SOAPMessage> dispatch = service.createDispatch(EndpointReference.readFrom(makeStreamSource(W3CEPRString)), SOAPMessage.class, Service.Mode.MESSAGE);
SOAPMessage sm = dispatch.invoke(getSOAPMessage(makeStreamSource(SMMsg)));
sm.writeTo(System.out);
// System.out.println("Adding numbers 2 and 4");
// int result = dispatch.invoke(getSOAPMessage())
// assert(result == 6);
// System.out.println("Addinion of 2 and 4 successful");
}
use of jakarta.xml.soap.SOAPMessage in project metro-jax-ws by eclipse-ee4j.
the class DispatchHelloLiteralTest method testHelloAsyncPollSOAPMessage.
public void testHelloAsyncPollSOAPMessage() throws Exception {
Dispatch dispatch = getDispatchSOAPMessage();
SOAPMessage msg = getSOAPMessage(makeStreamSource(helloSM));
try {
Response<SOAPMessage> result = dispatch.invokeAsync(msg);
assertTrue(result != null);
SOAPMessage resultmsg = result.get();
assertTrue(resultmsg != null);
System.out.println("-----------------------------------------");
System.out.println("SOAPMessage Result = ");
resultmsg.writeTo(System.out);
System.out.println("-----------------------------------------");
} catch (Exception e) {
e.printStackTrace();
fail("Test fails");
}
}
use of jakarta.xml.soap.SOAPMessage in project metro-jax-ws by eclipse-ee4j.
the class AddNumbersClient method testDispatchEPRGetPort.
public void testDispatchEPRGetPort() throws Exception {
if (ClientServerTestUtil.useLocal()) {
System.out.println("HTTP Transport Only Exiting");
return;
}
Dispatch<SOAPMessage> dispatch = createDispatchWithWSDL();
EndpointReference epr = dispatch.getEndpointReference(MemberSubmissionEndpointReference.class);
// wsdl has addressing required
AddNumbersPortType port = epr.getPort(AddNumbersPortType.class);
assertTrue(port != null);
System.out.println("Adding numbers 2 and 4");
int result = port.addNumbers(2, 4);
assert (result == 6);
System.out.println("Addinion of 2 and 4 successful");
}
Aggregations