// being invoked by the SOAPClient ("http://localhost:15111/")...
test_request("soapclient-request-config-02.xml", "http://localhost:15111/", "http://localhost:15112");
}
private void test_request(String esbConfig, String wsEndpoint, final String wsdlEndpoint) throws Exception {
JBRServer wsdlServer = new JBRServer(wsdlEndpoint, new StaticRequestResponseHandler(getClass().getResourceAsStream("request-test-01.wsdl")));
StaticRequestResponseHandler wsEndpointHandler = new StaticRequestResponseHandler("<response/>");
JBRServer wsEndpointServer = new JBRServer(wsEndpoint, wsEndpointHandler);
// Check the SOAP request coming into the Server...
wsEndpointHandler.setExpectedRequest(getClass().getResourceAsStream("expected-soap-request.xml"));
wsdlServer.start();
try {
wsEndpointServer.start();
try {
new AbstractTestRunner() {
public void test() throws Exception {
ServiceInvoker invoker = new ServiceInvoker("OrderManagement", "GoodbyeService");
Message message = MessageFactory.getInstance().getMessage();
Map params = new HashMap();
params.put("sayGoodbye.message", "Goodbye Henry!!");
message.getBody().add(params);
message = invoker.deliverSync(message, 10000);
String soapResponse = (String) message.getBody().get();
assertEquals("<response/>", soapResponse);
}
}.setServiceConfig(esbConfig).run();
} finally {
wsEndpointServer.stop();
}
} finally {
wsdlServer.stop();
}
}