fill = fill + fill;
}
System.out.println("fill size : " + fill.length());
MsgBoxClient user = new MsgBoxClient();
EndpointReference msgBoxEpr = user.createMessageBox(
"http://localhost:8080/axis2/services/MsgBoxService", 5000L);
/*
* user.storeMessage(msgBoxEpr, 500L, MsgBoxUtils .reader2OMElement(new
* StringReader( "<test>simple test message 1</test>")));
* user.storeMessage(msgBoxEpr, 500L, MsgBoxUtils .reader2OMElement(new
* StringReader( "<test>simple test message 2</test>")));
* user.storeMessage(msgBoxEpr, 500L, MsgBoxUtils .reader2OMElement(new
* StringReader( "<test>simple test message 3</test>")));
* user.storeMessage(msgBoxEpr, 500L, MsgBoxUtils .reader2OMElement(new
* StringReader( "<test>simple test message 4</test>")));
*/
EndpointReference msgBoxEprTcpMon = new EndpointReference(msgBoxEpr
.getAddress().replace("8080", "5050"));
for (int i = 0; i < 10; i++) {
String msg = String.format(
"<msg><seq>%d</seq><fill>%s</fill></msg>", i, fill);
user.storeMessage(msgBoxEpr, 500L, MsgBoxUtils
.reader2OMElement(new StringReader(msg)));
Thread.sleep(200L);
}
Iterator<OMElement> iterator = null;
try {
iterator = user.takeMessagesFromMsgBox(msgBoxEprTcpMon, 5000L);
} catch (Exception e) {
e.printStackTrace();
}
if (iterator != null)
while (iterator.hasNext()) {
System.out.println(iterator.next().toStringWithConsume());
}
System.out.println("Delete message box response : "
+ user.deleteMsgBox(msgBoxEpr, 5000L));
}