* @return String from the service
*/
public String buildAsync(String endpointURL, URL wsdlURL, String input, int waiting, Boolean wireasync) {
String response = "ERROR!:";
try {
EchoServicePortProxy echo = new EchoServicePortProxy(wsdlURL);
echo._getDescriptor().setEndpoint(endpointURL);
// Configure SOAPAction properties
BindingProvider bp = (BindingProvider) (echo._getDescriptor()
.getProxy());
bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
endpointURL);
bp.getRequestContext().put(BindingProvider.SOAPACTION_USE_PROPERTY,
Boolean.TRUE);
bp.getRequestContext().put(BindingProvider.SOAPACTION_URI_PROPERTY,
"echoOperation");
if (wireasync) {
bp.getRequestContext().put(org.apache.axis2.jaxws.util.Constants.USE_ASYNC_MEP,
Boolean.TRUE);
}
// Set up the callback handler and create the input object
EchoServiceCallbackHandler callbackHandler = new EchoServiceCallbackHandler();
EchoStringInput echoParm =
new org.apache.axis2.jaxws.samples.echo.ObjectFactory().createEchoStringInput();
echoParm.setEchoInput(input);
System.out.println(">> CLIENT: SEI Async to " + endpointURL);
// Call the service
Future<?> resp = echo.echoOperationAsync(echoParm, callbackHandler);
Thread.sleep(1000);
while (!resp.isDone()) {
// Check for timeout
if (waiting <= 0) {
System.out