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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]