[ 
http://issues.apache.org/jira/browse/AXIS2-1061?page=comments#action_12429970 ] 
            
Michele Mazzucco commented on AXIS2-1061:
-----------------------------------------

Eran:

1 - It is actually possible to use the same callback object for all 
invocations. It is sufficient to override all Callback methods and, in 
particular, to make the isCompleted method return true *only* when all messages 
are received

private static final class QospCallback extends Callback {

    // Number of messages to receive (the default is 1) 
    private final int toReceive;

    // Number of received messages
    private int received;

   // constructor and other stuff here

 public void onComplete(AsyncResult result) {
    this.received++;
    //..
  }

  public void onError(Exception e) {
        this.received++;
       //..
  }

   public void setComplete(boolean complete) {
        super.setComplete(this.received == this.toReceive);
    }

   public boolean isComplete() {
        return (this.received == this.toReceive);
   }
}



2 - What does "be sure that the payload is built"? Is it not built if you reuse 
it? And why if you wait some time it is built?

> sendReceiveNonBlocking fails to send multiple (identical) requests
> ------------------------------------------------------------------
>
>                 Key: AXIS2-1061
>                 URL: http://issues.apache.org/jira/browse/AXIS2-1061
>             Project: Apache Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: client-api
>         Environment: Windows XP sp2, jdk 1.5.03, mac os X 10.4.7, jdk 1.5_06, 
> axis2 17/08/06
>            Reporter: Michele Mazzucco
>            Priority: Critical
>
> The call sendReceiveNonBlocking call fails when multiple, identical messages 
> are sent. More in detail, the first send succeeds, but the second fails 
> because the message is sent with an empty SOAP body. A workaround is to 
> interleave two consecutive send operations by (at least) 600 ms (on my 
> system).
> In other words:
> for (int i = 0; i < execution.requestNum; i++) {
>       OMElement payload = getTestOMElement();
>       sender.sendReceiveNonBlocking(payload, callback);
> }
> succeeds, while:
> OMElement payload payload = getTestOMElement();
> for (int i = 0; i < execution.requestNum; i++) {
>       sender.sendReceiveNonBlocking(payload, callback);
> }
> fails, because (from the second send) the SOAP message is empty

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to