You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fx-dev@ws.apache.org by Ruben DF <rd...@yahoo.es> on 2006/05/04 17:02:45 UTC

An example based on testsuite1

Hi,

I'm trying a simple example with testsuite1 which work
ok (as initiatorApp does not work properly, i dont
know the reason)

I want to do this: i have an simple operation called
modificateString(String var)in a WS called EjKandula1,
wich contains an class variable (static variable)
which i modify it.

By other hand, i have an other WS (called EjKandula2)
which contains other operation what modify other
static variable called modificateString2(String var).

These two WS are based in testsuite1soapbindingimpl
examples, i.e, it use J2EE geronimo as transaction
manager. My question is: Can I call to the methods
begin, commit, rollback...etc from the CLIENT?? (as
initiatorApp example). In testsuite1 example the
methods like begin, commit, rollback..etc are called
from the SERVER..

My idea is to have a client like this:

public void modificate(String var1, String var2)
throws Exception{

		TransactionManagerImpl wstm =
TransactionManagerImpl.getInstance();		

		EjKandula1SoapBindingStub binding1;
		EjKandula2SoapBindingStub binding2;
		try {
			binding1 = (EjKandula1SoapBindingStub) new
EjKandula1PortTypeServiceLocator().getEjKandula1();
			binding2 = (EjKandula2SoapBindingStub) new
EjKandula2PortTypeServiceLocator().getEjKandula2();
		} catch (javax.xml.rpc.ServiceException jre) {
			if (jre.getLinkedCause() != null)
				jre.getLinkedCause().printStackTrace();
			throw new junit.framework.AssertionFailedError(
					"JAX-RPC ServiceException caught: " + jre);
		}
		assertNotNull("binding is null", binding1);
		assertNotNull("binding is null", binding2);

		wstm.begin();
		
		// Time out after a minute
		binding1.setTimeout(60000);
		binding2.setTimeout(60000);

		// Test operation
		binding1.modificateString(var1);
		binding2.modificateString2(var2);

		wstm.commit();

		// TBD - validate results

	}

is it correct? would it work ok the commit? In the
servers stubs (EjKandula1SoapBindingImpl and
EjKandula2SoapBindingImpl) the operations called
modificateString and modificateString2 respectly only
had the modification of the variable static, whitout
the methods begin and commit/rollback, didn't have it?
like this (to one WS, the other is equal)

public void modificateString(String var) throws
RemoteException{
		try {
			EjKandulaPortType p = new
EjKandulaPortTypeServiceLocator().getEjKandula();
	p.enlistXA_OKOnPrepareResourceOperation();
			A=var;//modification of static   variable A
		} catch (ServiceException e) {
			e.printStackTrace();
		}
	}

Thanks in advance
Regards

Ruben


		
______________________________________________ 
LLama Gratis a cualquier PC del Mundo. 
Llamadas a fijos y móviles desde 1 céntimo por minuto. 
http://es.voice.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: kandula-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: kandula-dev-help@ws.apache.org


Re: An example based on testsuite1

Posted by Ruben DF <rd...@yahoo.es>.
I answer you..

 --- Dasarath Weeratunge <dw...@purdue.edu>
escribió:

> Quoting Ruben DF <rd...@yahoo.es>:
> 
> > I'm trying a simple example with testsuite1 which
> work
> > ok (as initiatorApp does not work properly, i dont
> > know the reason)
> 
> please let us know the problem you are having with
> interopibm sample.
> we will be happy to help you and if indeed there is
> a problem we could also 
> fix it.
> 

I have this problem since a long time ago. You said to
me that it could be my application did not locate my
client-config.wsdd since i have no headers in SOAP
messages.I also tested with the client-config.wsdd
that there is in /kandula_home/src/samples/interopibm
but i have the same result. I dont know which the
problem is. You said to me that i had to have the tag
callbackRef in headers SOAP but i have no headers SOAP
directly. any idea?

> > initiatorApp example). In testsuite1 example the
> > methods like begin, commit, rollback..etc are
> called
> > from the SERVER..
> 
> the reason for this is in the new Kandula code, we
> use async porttypes.
> So we need to use a server on the client side as
> well to listen to messages
> sent to the client (e.g. replies) by the server. So
> both the client and the
> server run inside a web container, need not be the
> same container of course.
> 

I have some doubts about this...Do you mean that in
interopibm you use sync porttypes in the standalone
client and in testsuite you use async porttypes in the
j2ee client?

However, kandula1 runs on Axis1.3, which supports sync
messages ONLY, am i right?, so, to support async
messages you need to use a server on the client side
as well in order to listen to messages sent to the
client, through WS-addressing, am i right?. Axis2 has
been designed to support this type of operations
(async messages) and wouldn't be problems here, isn't
it?

> > 
> > 		wstm.begin();
> > 		
> > 		// Time out after a minute
> > 		binding1.setTimeout(60000);
> > 		binding2.setTimeout(60000);
> > 
> > 		// Test operation
> > 		binding1.modificateString(var1);
> > 		binding2.modificateString2(var2);
> > 
> > 		wstm.commit();
> > 
> > 		// TBD - validate results
> > 
> > 	}
> 
> unless you run this inside axis, the commit will
> hang. because it expects a
> reply from the server ("Committed" message) which it
> cannot receive as a 
> standalone client. your approach is correct
> otherwise. Since this is causing
> a lot of trouble I think I will modify the code to
> allow standalone clients to
> use sync porttypes soon. this is not a problem in
> axis2 since axis2 has been 
> designed to support this type of operations.
> 

Then, I think I need (since interopibm does not work
properly..) a standalone client to support sync
porttypes to be able to do the calls of begin and
commit/rollback method from the CLIENT. I just had to
modify testsuit client, didn't I? or by contrast
should I modify parts of the server implementation
(stubimpl) or TxHandler, Mediator and Bridge classes
of Geronimo??

Thanks in advance
Regards

Ruben


> > 
> > is it correct? would it work ok the commit? In the
> > servers stubs (EjKandula1SoapBindingImpl and
> > EjKandula2SoapBindingImpl) the operations called
> > modificateString and modificateString2 respectly
> only
> > had the modification of the variable static,
> whitout
> > the methods begin and commit/rollback, didn't have
> it?
> > like this (to one WS, the other is equal)
> 
> I don't understand your question, could you please
> explain it again.
> 
> thanks,
> --dasarath
> 
> > 
> > public void modificateString(String var) throws
> > RemoteException{
> > 		try {
> > 			EjKandulaPortType p = new
> > EjKandulaPortTypeServiceLocator().getEjKandula();
> > 	p.enlistXA_OKOnPrepareResourceOperation();
> > 			A=var;//modification of static   variable A
> > 		} catch (ServiceException e) {
> > 			e.printStackTrace();
> > 		}
> > 	}
> > 
> > Thanks in advance
> > Regards
> > 
> > Ruben
> > 
> > 
> > 		
> > ______________________________________________ 
> > LLama Gratis a cualquier PC del Mundo. 
> > Llamadas a fijos y móviles desde 1 céntimo por
> minuto. 
> > http://es.voice.yahoo.com
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> kandula-dev-unsubscribe@ws.apache.org
> > For additional commands, e-mail:
> kandula-dev-help@ws.apache.org
> > 
> > 
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> kandula-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail:
> kandula-dev-help@ws.apache.org
> 
> 


		
______________________________________________ 
LLama Gratis a cualquier PC del Mundo. 
Llamadas a fijos y móviles desde 1 céntimo por minuto. 
http://es.voice.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: kandula-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: kandula-dev-help@ws.apache.org


Re: An example based on testsuite1

Posted by Ruben DF <rd...@yahoo.es>.
I answer you..

 --- Dasarath Weeratunge <dw...@purdue.edu>
escribió:

> Quoting Ruben DF <rd...@yahoo.es>:
> 
> > I'm trying a simple example with testsuite1 which
> work
> > ok (as initiatorApp does not work properly, i dont
> > know the reason)
> 
> please let us know the problem you are having with
> interopibm sample.
> we will be happy to help you and if indeed there is
> a problem we could also 
> fix it.
> 

I have this problem since a long time ago. You said to
me that it could be my application did not locate my
client-config.wsdd since i have no headers in SOAP
messages.I also tested with the client-config.wsdd
that there is in /kandula_home/src/samples/interopibm
but i have the same result. I dont know which the
problem is. You said to me that i had to have the tag
callbackRef in headers SOAP but i have no headers SOAP
directly. any idea?

> > initiatorApp example). In testsuite1 example the
> > methods like begin, commit, rollback..etc are
> called
> > from the SERVER..
> 
> the reason for this is in the new Kandula code, we
> use async porttypes.
> So we need to use a server on the client side as
> well to listen to messages
> sent to the client (e.g. replies) by the server. So
> both the client and the
> server run inside a web container, need not be the
> same container of course.
> 

I have some doubts about this...Do you mean that in
interopibm you use sync porttypes in the standalone
client and in testsuite you use async porttypes in the
j2ee client?

However, kandula1 runs on Axis1.3, which supports sync
messages ONLY, am i right?, so, to support async
messages you need to use a server on the client side
as well in order to listen to messages sent to the
client, through WS-addressing, am i right?. Axis2 has
been designed to support this type of operations
(async messages) and wouldn't be problems here, isn't
it?

> > 
> > 		wstm.begin();
> > 		
> > 		// Time out after a minute
> > 		binding1.setTimeout(60000);
> > 		binding2.setTimeout(60000);
> > 
> > 		// Test operation
> > 		binding1.modificateString(var1);
> > 		binding2.modificateString2(var2);
> > 
> > 		wstm.commit();
> > 
> > 		// TBD - validate results
> > 
> > 	}
> 
> unless you run this inside axis, the commit will
> hang. because it expects a
> reply from the server ("Committed" message) which it
> cannot receive as a 
> standalone client. your approach is correct
> otherwise. Since this is causing
> a lot of trouble I think I will modify the code to
> allow standalone clients to
> use sync porttypes soon. this is not a problem in
> axis2 since axis2 has been 
> designed to support this type of operations.
> 

Then, I think I need (since interopibm does not work
properly..) a standalone client to support sync
porttypes to be able to do the calls of begin and
commit/rollback method from the CLIENT. I just had to
modify testsuit client, didn't I? or by contrast
should I modify parts of the server implementation
(stubimpl) or TxHandler, Mediator and Bridge classes
of Geronimo??

Thanks in advance
Regards

Ruben


> > 
> > is it correct? would it work ok the commit? In the
> > servers stubs (EjKandula1SoapBindingImpl and
> > EjKandula2SoapBindingImpl) the operations called
> > modificateString and modificateString2 respectly
> only
> > had the modification of the variable static,
> whitout
> > the methods begin and commit/rollback, didn't have
> it?
> > like this (to one WS, the other is equal)
> 
> I don't understand your question, could you please
> explain it again.
> 
> thanks,
> --dasarath
> 
> > 
> > public void modificateString(String var) throws
> > RemoteException{
> > 		try {
> > 			EjKandulaPortType p = new
> > EjKandulaPortTypeServiceLocator().getEjKandula();
> > 	p.enlistXA_OKOnPrepareResourceOperation();
> > 			A=var;//modification of static   variable A
> > 		} catch (ServiceException e) {
> > 			e.printStackTrace();
> > 		}
> > 	}
> > 
> > Thanks in advance
> > Regards
> > 
> > Ruben
> > 
> > 
> > 		
> > ______________________________________________ 
> > LLama Gratis a cualquier PC del Mundo. 
> > Llamadas a fijos y móviles desde 1 céntimo por
> minuto. 
> > http://es.voice.yahoo.com
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> kandula-dev-unsubscribe@ws.apache.org
> > For additional commands, e-mail:
> kandula-dev-help@ws.apache.org
> > 
> > 
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> kandula-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail:
> kandula-dev-help@ws.apache.org
> 
> 


		
______________________________________________ 
LLama Gratis a cualquier PC del Mundo. 
Llamadas a fijos y móviles desde 1 céntimo por minuto. 
http://es.voice.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: kandula-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: kandula-dev-help@ws.apache.org


Re: An example based on testsuite1

Posted by Dasarath Weeratunge <dw...@purdue.edu>.
Quoting Ruben DF <rd...@yahoo.es>:

> I'm trying a simple example with testsuite1 which work
> ok (as initiatorApp does not work properly, i dont
> know the reason)

please let us know the problem you are having with interopibm sample.
we will be happy to help you and if indeed there is a problem we could also 
fix it.

> initiatorApp example). In testsuite1 example the
> methods like begin, commit, rollback..etc are called
> from the SERVER..

the reason for this is in the new Kandula code, we use async porttypes.
So we need to use a server on the client side as well to listen to messages
sent to the client (e.g. replies) by the server. So both the client and the
server run inside a web container, need not be the same container of course.

> 
> 		wstm.begin();
> 		
> 		// Time out after a minute
> 		binding1.setTimeout(60000);
> 		binding2.setTimeout(60000);
> 
> 		// Test operation
> 		binding1.modificateString(var1);
> 		binding2.modificateString2(var2);
> 
> 		wstm.commit();
> 
> 		// TBD - validate results
> 
> 	}

unless you run this inside axis, the commit will hang. because it expects a
reply from the server ("Committed" message) which it cannot receive as a 
standalone client. your approach is correct otherwise. Since this is causing
a lot of trouble I think I will modify the code to allow standalone clients to
use sync porttypes soon. this is not a problem in axis2 since axis2 has been 
designed to support this type of operations.

> 
> is it correct? would it work ok the commit? In the
> servers stubs (EjKandula1SoapBindingImpl and
> EjKandula2SoapBindingImpl) the operations called
> modificateString and modificateString2 respectly only
> had the modification of the variable static, whitout
> the methods begin and commit/rollback, didn't have it?
> like this (to one WS, the other is equal)

I don't understand your question, could you please explain it again.

thanks,
--dasarath

> 
> public void modificateString(String var) throws
> RemoteException{
> 		try {
> 			EjKandulaPortType p = new
> EjKandulaPortTypeServiceLocator().getEjKandula();
> 	p.enlistXA_OKOnPrepareResourceOperation();
> 			A=var;//modification of static   variable A
> 		} catch (ServiceException e) {
> 			e.printStackTrace();
> 		}
> 	}
> 
> Thanks in advance
> Regards
> 
> Ruben
> 
> 
> 		
> ______________________________________________ 
> LLama Gratis a cualquier PC del Mundo. 
> Llamadas a fijos y móviles desde 1 céntimo por minuto. 
> http://es.voice.yahoo.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: kandula-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: kandula-dev-help@ws.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: kandula-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: kandula-dev-help@ws.apache.org


Re: An example based on testsuite1

Posted by Dasarath Weeratunge <dw...@purdue.edu>.
Quoting Ruben DF <rd...@yahoo.es>:

> I'm trying a simple example with testsuite1 which work
> ok (as initiatorApp does not work properly, i dont
> know the reason)

please let us know the problem you are having with interopibm sample.
we will be happy to help you and if indeed there is a problem we could also 
fix it.

> initiatorApp example). In testsuite1 example the
> methods like begin, commit, rollback..etc are called
> from the SERVER..

the reason for this is in the new Kandula code, we use async porttypes.
So we need to use a server on the client side as well to listen to messages
sent to the client (e.g. replies) by the server. So both the client and the
server run inside a web container, need not be the same container of course.

> 
> 		wstm.begin();
> 		
> 		// Time out after a minute
> 		binding1.setTimeout(60000);
> 		binding2.setTimeout(60000);
> 
> 		// Test operation
> 		binding1.modificateString(var1);
> 		binding2.modificateString2(var2);
> 
> 		wstm.commit();
> 
> 		// TBD - validate results
> 
> 	}

unless you run this inside axis, the commit will hang. because it expects a
reply from the server ("Committed" message) which it cannot receive as a 
standalone client. your approach is correct otherwise. Since this is causing
a lot of trouble I think I will modify the code to allow standalone clients to
use sync porttypes soon. this is not a problem in axis2 since axis2 has been 
designed to support this type of operations.

> 
> is it correct? would it work ok the commit? In the
> servers stubs (EjKandula1SoapBindingImpl and
> EjKandula2SoapBindingImpl) the operations called
> modificateString and modificateString2 respectly only
> had the modification of the variable static, whitout
> the methods begin and commit/rollback, didn't have it?
> like this (to one WS, the other is equal)

I don't understand your question, could you please explain it again.

thanks,
--dasarath

> 
> public void modificateString(String var) throws
> RemoteException{
> 		try {
> 			EjKandulaPortType p = new
> EjKandulaPortTypeServiceLocator().getEjKandula();
> 	p.enlistXA_OKOnPrepareResourceOperation();
> 			A=var;//modification of static   variable A
> 		} catch (ServiceException e) {
> 			e.printStackTrace();
> 		}
> 	}
> 
> Thanks in advance
> Regards
> 
> Ruben
> 
> 
> 		
> ______________________________________________ 
> LLama Gratis a cualquier PC del Mundo. 
> Llamadas a fijos y móviles desde 1 céntimo por minuto. 
> http://es.voice.yahoo.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: kandula-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: kandula-dev-help@ws.apache.org
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: kandula-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: kandula-dev-help@ws.apache.org