use of org.apache.cxf.systest.ws.addr_feature.AddNumbersService in project cxf by apache.
the class WSADisableTest method getService.
private AddNumbersService getService() {
URL wsdl = getClass().getResource("/wsdl_systest_wsspec/add_numbers.wsdl");
assertNotNull("WSDL is null", wsdl);
AddNumbersService service = new AddNumbersService(wsdl, serviceName);
assertNotNull("Service is null ", service);
return service;
}
use of org.apache.cxf.systest.ws.addr_feature.AddNumbersService in project cxf by apache.
the class WSAFromWSDLTest method getPort.
private AddNumbersPortTypeProxy getPort() throws Exception {
URL wsdl = getClass().getResource("/wsdl_systest_wsspec/add_numbers.wsdl");
assertNotNull("WSDL is null", wsdl);
AddNumbersService service = new AddNumbersService(wsdl, serviceName);
assertNotNull("Service is null ", service);
AddNumbersPortTypeProxy port = service.getAddNumbersPort(new AddressingFeature());
updateAddressPort(port, PORT);
return port;
}
use of org.apache.cxf.systest.ws.addr_feature.AddNumbersService in project cxf by apache.
the class WSAPureWsdlTest method getPort.
private AddNumbersPortType getPort() {
URL wsdl = getClass().getResource("/wsdl_systest_wsspec/add_numbers.wsdl");
assertNotNull("WSDL is null", wsdl);
AddNumbersService service = new AddNumbersService(wsdl, serviceName);
assertNotNull("Service is null ", service);
return service.getAddNumbersPort();
}
use of org.apache.cxf.systest.ws.addr_feature.AddNumbersService in project cxf by apache.
the class WSAPureWsdlTest method testBasicDispatchInvocation.
@Test
public void testBasicDispatchInvocation() throws Exception {
String req = "<addNumbers xmlns=\"http://apache.org/cxf/systest/ws/addr_feature/\">" + "<number1>1</number1><number2>2</number2></addNumbers>";
String base = "http://apache.org/cxf/systest/ws/addr_feature/AddNumbersPortType/";
ByteArrayOutputStream input = setupInLogging();
ByteArrayOutputStream output = setupOutLogging();
URL wsdl = getClass().getResource("/wsdl_systest_wsspec/add_numbers.wsdl");
assertNotNull("WSDL is null", wsdl);
AddNumbersService service = new AddNumbersService(wsdl, serviceName);
Dispatch<Source> disp = service.createDispatch(AddNumbersService.AddNumbersPort, Source.class, Mode.PAYLOAD);
disp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://localhost:" + PORT + "/jaxws/add");
disp.invoke(new StreamSource(new StringReader(req)));
assertLogContains(output.toString(), "//wsa:Action", base + "addNumbersRequest");
assertLogContains(input.toString(), "//wsa:Action", base + "addNumbersResponse");
output.reset();
input.reset();
disp = service.createDispatch(AddNumbersService.AddNumbersPort, Source.class, Mode.PAYLOAD);
disp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://localhost:" + PORT + "/jaxws/add");
// set the operation name so action can be pulled from the wsdl
disp.getRequestContext().put(MessageContext.WSDL_OPERATION, new QName("http://apache.org/cxf/systest/ws/addr_feature/", "addNumbers"));
disp.invoke(new StreamSource(new StringReader(req)));
assertLogContains(output.toString(), "//wsa:Action", base + "addNumbersRequest");
assertLogContains(input.toString(), "//wsa:Action", base + "addNumbersResponse");
}
use of org.apache.cxf.systest.ws.addr_feature.AddNumbersService in project cxf by apache.
the class WSAPureWsdlTest method testDispatchActionMissmatch.
@Test
public void testDispatchActionMissmatch() throws Exception {
String req = "<S:Envelope xmlns:S=\"http://schemas.xmlsoap.org/soap/envelope/\">" + "<S:Body><addNumbers3 xmlns=\"http://apache.org/cxf/systest/ws/addr_feature/\">" + "<number1>1</number1><number2>2</number2></addNumbers3>" + "</S:Body></S:Envelope>";
// String base = "http://apache.org/cxf/systest/ws/addr_feature/AddNumbersPortType/";
String expectedOut = "http://bad.action";
URL wsdl = getClass().getResource("/wsdl_systest_wsspec/add_numbers.wsdl");
assertNotNull("WSDL is null", wsdl);
AddNumbersService service = new AddNumbersService(wsdl, serviceName);
Dispatch<Source> disp = service.createDispatch(AddNumbersService.AddNumbersPort, Source.class, Mode.MESSAGE);
disp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://localhost:" + PORT + "/jaxws/add");
// manually set the action
disp.getRequestContext().put(BindingProvider.SOAPACTION_URI_PROPERTY, expectedOut);
disp.getRequestContext().put(ContextUtils.ACTION, expectedOut + "/wsaAction");
try {
disp.invoke(new StreamSource(new StringReader(req)));
fail("no exception");
} catch (SOAPFaultException f) {
// expected
}
}
Aggregations