bpe.getServiceUnitManager().start("loanbroker");
//
// Message for bank1 and bank2
//
MessageExchange me = client.createInOutExchange();
me.setService(new QName("urn:logicblaze:soa:loanbroker", "LoanBrokerService"));
me.setOperation(new QName("getLoanQuote"));
me.getMessage("in").setContent(new StringSource(
"<getLoanQuoteRequest xmlns=\"urn:logicblaze:soa:loanbroker\">"
+ "<ssn>1234341</ssn><amount>100000.0</amount><duration>12</duration>"
+ "</getLoanQuoteRequest>"));
long t0 = System.currentTimeMillis();
client.sendSync(me);
long t1 = System.currentTimeMillis();
if (me.getError() != null) {
throw me.getError();
}
assertEquals(ExchangeStatus.ACTIVE, me.getStatus());
String out = new SourceTransformer().contentToString(me.getMessage("out"));
log.info(out);
log.info("Time: " + (t1 - t0));
client.done(me);
//
// Message for bank3 and bank4
//
me = client.createInOutExchange();
me.setService(new QName("urn:logicblaze:soa:loanbroker", "LoanBrokerService"));
me.setOperation(new QName("getLoanQuote"));
me.getMessage("in").setContent(new StringSource(
"<getLoanQuoteRequest xmlns=\"urn:logicblaze:soa:loanbroker\">"
+ "<ssn>1234341</ssn><amount>50000.0</amount><duration>12</duration>"
+ "</getLoanQuoteRequest>"));
t0 = System.currentTimeMillis();
client.sendSync(me);
t1 = System.currentTimeMillis();
if (me.getError() != null) {
throw me.getError();
}
assertEquals(ExchangeStatus.ACTIVE, me.getStatus());
out = new SourceTransformer().contentToString(me.getMessage("out"));
log.info(out);
log.info("Time: " + (t1 - t0));
client.done(me);
//
// Message for bank5
//
me = client.createInOutExchange();
me.setService(new QName("urn:logicblaze:soa:loanbroker", "LoanBrokerService"));
me.setOperation(new QName("getLoanQuote"));
me.getMessage("in").setContent(new StringSource(
"<getLoanQuoteRequest xmlns=\"urn:logicblaze:soa:loanbroker\">"
+ "<ssn>1234341</ssn><amount>1200.0</amount><duration>12</duration>"
+ "</getLoanQuoteRequest>"));
t0 = System.currentTimeMillis();
client.sendSync(me);
t1 = System.currentTimeMillis();
if (me.getError() != null) {
throw me.getError();
}
assertEquals(ExchangeStatus.ACTIVE, me.getStatus());
out = new SourceTransformer().contentToString(me.getMessage("out"));
log.info(out);
log.info("Time: " + (t1 - t0));
client.done(me);
}