Re: AxisCallback stuck the application

2007-10-15 Thread Huitang Li
As mentioned in my previous post, it looks like a bug 
http://issues.apache.org/jira/browse/AXIS2-3265


There is nothing wrong with the wsdl. I am using resin 3.1.3 as the 
server. Probably this is something related to the xmlStreamReader 
implemented by resin? Right now I have no time to verify this. However, 
it will be awesome if I can know whether it is a true axis2 bug. If it 
is not, probably I will try to find time to debug resin. 

Since the old Callback works fine in the same resin server, I would 
assume that it is an Axi2 1.3 bug, though.


Thanks.

Huitang



Amila Suriarachchi wrote:



On 10/12/07, *Huitang Li* [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED] wrote:



With further debugging, I found something interesting: when the
onMessage() method is done in AxisCallback, the application
proceeds on
the method  public void run()  in class
OutInAxisOperationClient, and
then somehow the application seems hanging for ever.


I think the problem is here. The correct class to use is AxisCallback. 
Callback class is a  depricated class.

(see the  class comments).
If it work fine when we change to the depricated class that means 
generated code works fine.
on the other hand it is ok to leave onComple method without doing any 
thing. since it is a method to

use if some one need it.
(It is better to add this method to generated callback class and 
expose it to user)


Can you send your wsdl or a part to repoduce the problem?

Amila.

I have not downloaded the axis2 source code to debug, but  I believe
that something is not right after the AxisCallback finishes
onMessage()
and then returns the control to the run() method in
OutInAxisOperationClient.


Thanks.



Rajith Attapattu wrote:
 Put you notification logic in the

  public void onComplete() {
 //nothing here
 }

 So when it completes (either fault/error or sucess) , this
method will
 be called.

 Here is a faily elementry example (not the most elegant)
 Modify the generated class as follows.

  public void onComplete() {
 _complete = true;
 }

 and add a isComplete Method

 boolean isComplete()
 {
   return _complete;
 }

 you can now use it like the old Callback class.

 while ( !_axisCallBack.isComplete())
 {
Thread.sleep(1000);
 }

 Hope this helps.

 On 10/12/07, *Huitang Li*  [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] wrote:

 Thanks, Deepal. I will be happy to create a JRIA. But can
you show
 me a
 good example using this new API in the client code? I am
working on a
 project, and I cannot wait for the next Axis2 release.

 Thanks.

 Huitang



 Deepal jayasinghe wrote:
  Hi Huitang ,
  Definitely a bug in codegen , please create a JRIA.
 
  Thanks
  Deepal
 
  All these codes are auto-generated by Axis2 1.3 wsdl2java
 command. I
  do not know whether it is an old callback or not. But it
does says:
 
  _operationClient.setCallback(new
  org.apache.axis2.client.async.AxisCallback() {
  // all the codes that I pasted in my previous email.
  }
 
  In the generated code, the onComplete() method looks like
this:
 
  public void onComplete() {
 // Do nothing by default
 }
 
 
  Maybe there is something incorrectly generated by wsdl2java?
 
 
 
 
  Rajith Attapattu wrote:
 
  What do you mean by the application is stuck ? How
does your
  application figure out if a response is received?
  Can you please cut paste the code that uses the
AxisCallback.
 
  Does the onMessage, onError or onFault methods get called?
  If so why do u say it is stuck?
 
  Looks like the onMessage and onError methods get called,
bcos
 u seem
  to have put the old callback there and you mentioned that it
 works.
 
 
  public void onComplete() {
  //nothing here
  }
 
 
  I also see that the onComplete method is empty.
 
  --
  Rajith Attapattu
  Red Hat
  Blog http://mutlix.blogspot.com/
 
 

-

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

Re: AxisCallback stuck the application

2007-10-14 Thread Amila Suriarachchi
On 10/12/07, Huitang Li [EMAIL PROTECTED] wrote:


 With further debugging, I found something interesting: when the
 onMessage() method is done in AxisCallback, the application proceeds on
 the method  public void run()  in class OutInAxisOperationClient, and
 then somehow the application seems hanging for ever.


I think the problem is here. The correct class to use is AxisCallback.
Callback class is a  depricated class.
(see the  class comments).
If it work fine when we change to the depricated class that means generated
code works fine.
on the other hand it is ok to leave onComple method without doing any thing.
since it is a method to
use if some one need it.
(It is better to add this method to generated callback class and expose it
to user)

Can you send your wsdl or a part to repoduce the problem?

Amila.

I have not downloaded the axis2 source code to debug, but  I believe
 that something is not right after the AxisCallback finishes onMessage()
 and then returns the control to the run() method in
 OutInAxisOperationClient.


 Thanks.



 Rajith Attapattu wrote:
  Put you notification logic in the
 
   public void onComplete() {
  //nothing here
  }
 
  So when it completes (either fault/error or sucess) , this method will
  be called.
 
  Here is a faily elementry example (not the most elegant)
  Modify the generated class as follows.
 
   public void onComplete() {
  _complete = true;
  }
 
  and add a isComplete Method
 
  boolean isComplete()
  {
return _complete;
  }
 
  you can now use it like the old Callback class.
 
  while ( !_axisCallBack.isComplete())
  {
 Thread.sleep(1000);
  }
 
  Hope this helps.
 
  On 10/12/07, *Huitang Li* [EMAIL PROTECTED]
  mailto:[EMAIL PROTECTED] wrote:
 
  Thanks, Deepal. I will be happy to create a JRIA. But can you show
  me a
  good example using this new API in the client code? I am working on
 a
  project, and I cannot wait for the next Axis2 release.
 
  Thanks.
 
  Huitang
 
 
 
  Deepal jayasinghe wrote:
   Hi Huitang ,
   Definitely a bug in codegen , please create a JRIA.
  
   Thanks
   Deepal
  
   All these codes are auto-generated by Axis2 1.3 wsdl2java
  command. I
   do not know whether it is an old callback or not. But it does
 says:
  
   _operationClient.setCallback(new
   org.apache.axis2.client.async.AxisCallback() {
   // all the codes that I pasted in my previous email.
   }
  
   In the generated code, the onComplete() method looks like this:
  
   public void onComplete() {
  // Do nothing by default
  }
  
  
   Maybe there is something incorrectly generated by wsdl2java?
  
  
  
  
   Rajith Attapattu wrote:
  
   What do you mean by the application is stuck ? How does your
   application figure out if a response is received?
   Can you please cut paste the code that uses the AxisCallback.
  
   Does the onMessage, onError or onFault methods get called?
   If so why do u say it is stuck?
  
   Looks like the onMessage and onError methods get called, bcos
  u seem
   to have put the old callback there and you mentioned that it
  works.
  
  
   public void onComplete() {
   //nothing here
   }
  
  
   I also see that the onComplete method is empty.
  
   --
   Rajith Attapattu
   Red Hat
   Blog http://mutlix.blogspot.com/
  
  
 
 -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
  mailto:[EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  mailto:[EMAIL PROTECTED]
  
  
  
  
  
  
 
 
 -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  mailto:[EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  mailto:[EMAIL PROTECTED]
 
 
 
 
  --
  Rajith Attapattu
  Red Hat
  Blog http://mutlix.blogspot.com/

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




-- 
Amila Suriarachchi,
WSO2 Inc.


Re: AxisCallback stuck the application

2007-10-12 Thread Deepal jayasinghe
Hi Huitang ,
Definitely a bug in codegen , please create a JRIA.

Thanks
Deepal
 All these codes are auto-generated by Axis2 1.3 wsdl2java command. I
 do not know whether it is an old callback or not. But it does says:

 _operationClient.setCallback(new
 org.apache.axis2.client.async.AxisCallback() {
 // all the codes that I pasted in my previous email.
 }

 In the generated code, the onComplete() method looks like this:

 public void onComplete() {
// Do nothing by default
}


 Maybe there is something incorrectly generated by wsdl2java?




 Rajith Attapattu wrote:
 What do you mean by the application is stuck ? How does your
 application figure out if a response is received?
 Can you please cut paste the code that uses the AxisCallback.

 Does the onMessage, onError or onFault methods get called?
 If so why do u say it is stuck?

 Looks like the onMessage and onError methods get called, bcos u seem
 to have put the old callback there and you mentioned that it works.
  

 public void onComplete() {
 //nothing here
 }


 I also see that the onComplete method is empty.

 -- 
 Rajith Attapattu
 Red Hat
 Blog http://mutlix.blogspot.com/ 

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




-- 
Thanks,
Deepal

The highest tower is built one brick at a time


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



Re: AxisCallback stuck the application

2007-10-12 Thread Huitang Li


With further debugging, I found something interesting: when the 
onMessage() method is done in AxisCallback, the application proceeds on 
the method  public void run()  in class OutInAxisOperationClient, and 
then somehow the application seems hanging for ever.


I have not downloaded the axis2 source code to debug, but  I believe 
that something is not right after the AxisCallback finishes onMessage() 
and then returns the control to the run() method in 
OutInAxisOperationClient.



Thanks.



Rajith Attapattu wrote:

Put you notification logic in the

 public void onComplete() {
//nothing here
}

So when it completes (either fault/error or sucess) , this method will 
be called.


Here is a faily elementry example (not the most elegant)
Modify the generated class as follows.

 public void onComplete() {
_complete = true;
}

and add a isComplete Method

boolean isComplete()
{
  return _complete;
}

you can now use it like the old Callback class.

while ( !_axisCallBack.isComplete())
{
   Thread.sleep(1000);
}

Hope this helps.

On 10/12/07, *Huitang Li* [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED] wrote:


Thanks, Deepal. I will be happy to create a JRIA. But can you show
me a
good example using this new API in the client code? I am working on a
project, and I cannot wait for the next Axis2 release.

Thanks.

Huitang



Deepal jayasinghe wrote:
 Hi Huitang ,
 Definitely a bug in codegen , please create a JRIA.

 Thanks
 Deepal

 All these codes are auto-generated by Axis2 1.3 wsdl2java
command. I
 do not know whether it is an old callback or not. But it does says:

 _operationClient.setCallback(new
 org.apache.axis2.client.async.AxisCallback() {
 // all the codes that I pasted in my previous email.
 }

 In the generated code, the onComplete() method looks like this:

 public void onComplete() {
// Do nothing by default
}


 Maybe there is something incorrectly generated by wsdl2java?




 Rajith Attapattu wrote:

 What do you mean by the application is stuck ? How does your
 application figure out if a response is received?
 Can you please cut paste the code that uses the AxisCallback.

 Does the onMessage, onError or onFault methods get called?
 If so why do u say it is stuck?

 Looks like the onMessage and onError methods get called, bcos
u seem
 to have put the old callback there and you mentioned that it
works.


 public void onComplete() {
 //nothing here
 }


 I also see that the onComplete method is empty.

 --
 Rajith Attapattu
 Red Hat
 Blog http://mutlix.blogspot.com/


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







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




--
Rajith Attapattu
Red Hat
Blog http://mutlix.blogspot.com/ 


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



Re: AxisCallback stuck the application

2007-10-12 Thread Rajith Attapattu
Put you notification logic in the

 public void onComplete() {
//nothing here
}

So when it completes (either fault/error or sucess) , this method will be
called.

Here is a faily elementry example (not the most elegant)
Modify the generated class as follows.

 public void onComplete() {
_complete = true;
}

and add a isComplete Method

boolean isComplete()
{
  return _complete;
}

you can now use it like the old Callback class.

while ( !_axisCallBack.isComplete())
{
   Thread.sleep(1000);
}

Hope this helps.

On 10/12/07, Huitang Li [EMAIL PROTECTED] wrote:

 Thanks, Deepal. I will be happy to create a JRIA. But can you show me a
 good example using this new API in the client code? I am working on a
 project, and I cannot wait for the next Axis2 release.

 Thanks.

 Huitang



 Deepal jayasinghe wrote:
  Hi Huitang ,
  Definitely a bug in codegen , please create a JRIA.
 
  Thanks
  Deepal
 
  All these codes are auto-generated by Axis2 1.3 wsdl2java command. I
  do not know whether it is an old callback or not. But it does says:
 
  _operationClient.setCallback(new
  org.apache.axis2.client.async.AxisCallback() {
  // all the codes that I pasted in my previous email.
  }
 
  In the generated code, the onComplete() method looks like this:
 
  public void onComplete() {
 // Do nothing by default
 }
 
 
  Maybe there is something incorrectly generated by wsdl2java?
 
 
 
 
  Rajith Attapattu wrote:
 
  What do you mean by the application is stuck ? How does your
  application figure out if a response is received?
  Can you please cut paste the code that uses the AxisCallback.
 
  Does the onMessage, onError or onFault methods get called?
  If so why do u say it is stuck?
 
  Looks like the onMessage and onError methods get called, bcos u seem
  to have put the old callback there and you mentioned that it works.
 
 
  public void onComplete() {
  //nothing here
  }
 
 
  I also see that the onComplete method is empty.
 
  --
  Rajith Attapattu
  Red Hat
  Blog http://mutlix.blogspot.com/
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 
 

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




-- 
Rajith Attapattu
Red Hat
Blog http://mutlix.blogspot.com/


Re: AxisCallback stuck the application

2007-10-12 Thread Huitang Li
Thanks, Deepal. I will be happy to create a JRIA. But can you show me a 
good example using this new API in the client code? I am working on a 
project, and I cannot wait for the next Axis2 release.


Thanks.

Huitang



Deepal jayasinghe wrote:

Hi Huitang ,
Definitely a bug in codegen , please create a JRIA.

Thanks
Deepal
  

All these codes are auto-generated by Axis2 1.3 wsdl2java command. I
do not know whether it is an old callback or not. But it does says:

_operationClient.setCallback(new
org.apache.axis2.client.async.AxisCallback() {
// all the codes that I pasted in my previous email.
}

In the generated code, the onComplete() method looks like this:

public void onComplete() {
   // Do nothing by default
   }


Maybe there is something incorrectly generated by wsdl2java?




Rajith Attapattu wrote:


What do you mean by the application is stuck ? How does your
application figure out if a response is received?
Can you please cut paste the code that uses the AxisCallback.

Does the onMessage, onError or onFault methods get called?
If so why do u say it is stuck?

Looks like the onMessage and onError methods get called, bcos u seem
to have put the old callback there and you mentioned that it works.
 


public void onComplete() {
//nothing here
}


I also see that the onComplete method is empty.

--
Rajith Attapattu
Red Hat
Blog http://mutlix.blogspot.com/ 
  

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






  


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



AxisCallback stuck the application

2007-10-11 Thread Huitang Li

Hi,

When I use the new API AxisCallback, the application seems stuck, and it 
is taking forever to get any response. However, when I switched to the 
Callback class, I got the response from web service quickly.


Any idea?


Thanks.



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



Re: AxisCallback stuck the application

2007-10-11 Thread Rajith Attapattu
How did u use it?
Can you cut paste the code here.

Regards,

Rajith Attapattu
Red Hat.

On 10/11/07, Huitang Li [EMAIL PROTECTED] wrote:

 Hi,

 When I use the new API AxisCallback, the application seems stuck, and it
 is taking forever to get any response. However, when I switched to the
 Callback class, I got the response from web service quickly.

 Any idea?


 Thanks.



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




Re: AxisCallback stuck the application

2007-10-11 Thread Rajith Attapattu
What do you mean by the application is stuck ? How does your application
figure out if a response is received?
Can you please cut paste the code that uses the AxisCallback.

Does the onMessage, onError or onFault methods get called?
If so why do u say it is stuck?

Looks like the onMessage and onError methods get called, bcos u seem to have
put the old callback there and you mentioned that it works.


public void onComplete() {
 //nothing here
 }


I also see that the onComplete method is empty.

-- 
Rajith Attapattu
Red Hat
Blog http://mutlix.blogspot.com/


Re: AxisCallback stuck the application

2007-10-11 Thread Huitang Li
I used Axis2-generated adb client with a little modification. In the 
client, the generated code uses AxisCallback. I think that is very 
common piece of code in Axis2-generated ADB client. Because the 
application stuck, I replaced AxisCallback object with an Callback 
object, and it works fine.


Maybe there is something incorrect in the generated code?

Thanks.

Here is the code for AxisCallback:


   public void onMessage(
   org.apache.axis2.context.MessageContext resultContext) {
   try {
   org.apache.axiom.soap.SOAPEnvelope resultEnv = 
resultContext.getEnvelope();


   java.lang.Object object = fromOM(resultEnv.getBody()
   .getFirstElement(),
   
.clients.adb.xxxServicesServiceStub.xxxUserResponse.class,

   getEnvelopeNamespaces(resultEnv));
   
callback.receiveResultxxxUser((.clients.adb.xxxServicesServiceStub.xxxUserResponse) 
object);

   } catch (org.apache.axis2.AxisFault e) {
   callback.receiveErrorxxxUser(e);
   }
   }

   public void onError(java.lang.Exception error) {
   if (error instanceof org.apache.axis2.AxisFault) {
   org.apache.axis2.AxisFault f = 
(org.apache.axis2.AxisFault) error;

   org.apache.axiom.om.OMElement faultElt = f.getDetail();

   if (faultElt != null) {
   if (faultExceptionNameMap.containsKey(
   faultElt.getQName())) {
   //make the fault by reflection
   try {
   java.lang.String exceptionClassName = 
(java.lang.String) faultExceptionClassNameMap.get(faultElt.getQName());
   java.lang.Class exceptionClass = 
java.lang.Class.forName(exceptionClassName);
   java.lang.Exception ex = 
(java.lang.Exception) exceptionClass.newInstance();


   //message class
   java.lang.String messageClassName = 
(java.lang.String) faultMessageMap.get(faultElt.getQName());
   java.lang.Class messageClass = 
java.lang.Class.forName(messageClassName);
   java.lang.Object messageObject = 
fromOM(faultElt,

   messageClass, null);
   java.lang.reflect.Method m = 
exceptionClass.getMethod(setFaultMessage,
   new 
java.lang.Class[]{messageClass});

   m.invoke(ex,
   new 
java.lang.Object[]{messageObject});


   callback.receiveErrorxxxUser(new 
java.rmi.RemoteException(

   ex.getMessage(), ex));
   } catch (java.lang.ClassCastException e) {
   // we cannot intantiate the class - 
throw the original Axis fault

   callback.receiveErrorxxxUser(f);
   } catch (java.lang.ClassNotFoundException e) {
   // we cannot intantiate the class - 
throw the original Axis fault

   callback.receiveErrorxxxUser(f);
   } catch (java.lang.NoSuchMethodException e) {
   // we cannot intantiate the class - 
throw the original Axis fault

   callback.receiveErrorxxxUser(f);
   } catch 
(java.lang.reflect.InvocationTargetException e) {
   // we cannot intantiate the class - 
throw the original Axis fault

   callback.receiveErrorxxxUser(f);
   } catch (java.lang.IllegalAccessException e) {
   // we cannot intantiate the class - 
throw the original Axis fault

   callback.receiveErrorxxxUser(f);
   } catch (java.lang.InstantiationException e) {
   // we cannot intantiate the class - 
throw the original Axis fault

   callback.receiveErrorxxxUser(f);
   } catch (org.apache.axis2.AxisFault e) {
   // we cannot intantiate the class - 
throw the original Axis fault

   callback.receiveErrorxxxUser(f);
   }
   } else {
   callback.receiveErrorxxxUser(f);
   }
   } else {
   callback.receiveErrorxxxUser(f);
   }
   } else {
   callback.receiveErrorremoveUser(error);
   }
   }

   public

Re: AxisCallback stuck the application

2007-10-11 Thread Huitang Li
All these codes are auto-generated by Axis2 1.3 wsdl2java command. I do 
not know whether it is an old callback or not. But it does says:


_operationClient.setCallback(new 
org.apache.axis2.client.async.AxisCallback() {

// all the codes that I pasted in my previous email.
}

In the generated code, the onComplete() method looks like this:

public void onComplete() {
   // Do nothing by default
   }


Maybe there is something incorrectly generated by wsdl2java?




Rajith Attapattu wrote:
What do you mean by the application is stuck ? How does your 
application figure out if a response is received?

Can you please cut paste the code that uses the AxisCallback.

Does the onMessage, onError or onFault methods get called?
If so why do u say it is stuck?

Looks like the onMessage and onError methods get called, bcos u seem 
to have put the old callback there and you mentioned that it works.
 


public void onComplete() {
//nothing here
}


I also see that the onComplete method is empty.

--
Rajith Attapattu
Red Hat
Blog http://mutlix.blogspot.com/ 


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