Yes you are absolutely right. Thanks; after exposing my application as
Web Service this is working now. But when I call my Web Service the
second time there is a exception at:
tm.begin();
The exception is:
AxisFault
faultCode: {http://schemas.xmlsoap.org/ws/2004/10/wscoor}InvalidState
faultSubcode:
faultString: The message was invalid for the current state of the activity.
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:The message was invalid for
the current state of the activity.
at
org.apache.kandula.coordinator.Coordinator.<clinit>(Coordinator.java:29)
at
org.apache.kandula.coordinator.CoordinatorImpl.registerOperation(CoordinatorImpl.java:63)
at
org.apache.kandula.coordinator.RegistrationImpl.registerOperation(RegistrationImpl.java:31)
This exception occurs when I invoke the second call of my TransactionWS
where I want to do exactly the same again. In this case there is no
message to the activcation coordinator but the first messages goes to
the registrationCoordinator which does not give any response.
My workflow is like this:
[BankOne] debit(1, 20)
[Bank] opening connection
[BankDBMS] isSameRM
[BankDBMS] start
[BankDBMS] debit
[BankDBMS] after debit amount = 480
[Bank] closing connection
[BankDBMS] end
true
[BankOne] credit(1, 20)
[Bank] opening connection
[BankDBMS] isSameRM
[BankDBMS] isSameRM
[BankDBMS] start
[BankDBMS] credit
[Bank] closing connection
[BankDBMS] end
true
[CallbackRegistry] registerCallback: timeout= 180000
[BankDBMS] end
[BankDBMS] end
[BankDBMS] prepare
[BankDBMS] prepare
[BankDBMS] commit
[BankDBMS] 480
[BankDBMS] commit
[BankDBMS] 520
[TransactionService] committed
Thanks,
Benjamin
Quoting Benjamin Schmeling <[EMAIL PROTECTED]>:
Thank you very much for your support (Hannes and Dasarath)
The example is really that what I needed and I got my Banking Service
working now. The only problem that remains is that the calling of the
commit() operation never returns. When I terminate my TestCase manually
and call it another time, there is a problem with the coordinator and
the transaction cannot be started again. How could I fix this?
I presume you are running your client as a standalone application-- correct?
the commit/rollback operations wait for the COMMITTED/ABORTED messages from the
coordinator. However, a standalone application cannot receive these messages.
So the solution is to run your client inside a container like Tomcat where
kandula has been deployed. That's what I've done in my example code. Whenever,
we send an async message to which we expect a reply, kandula creates a dynamic
endpoint-- axis2 does this automatically but for now we have to do it our
selves on axis1.x.
Earlier on we were able to run standalone apps without trouble b'cos we were
using sync porttypes but now that we have switched to async, this is no longer
possible. In fact, the reason you are able to even come this far is b'cos
activation and registration still use sync porttypes!
thanks,
--dasarath
TransactionManagerImpl tm =
TransactionManagerImpl.getInstance();
getBalance("1","DeutscheBankWS");
tm.begin();
sendDebit("20", "1","DeutscheBankWS");
sendCredit("20", "1","CommerzBankWS");
tm.commit(); <---
Thanks,
Benjamin
Quoting Hannes Erven <[EMAIL PROTECTED]>:
Hi Benjamin,
> * completionCoordinator is called and it returns no response
> (containing <Commit xsi:nil="true"
> xmlns="http://schemas.xmlsoap.org/ws/2004/10/wsat"/>)
> * participant is called and it returns no response
> * coordinator is called and it returns no response
> * completionInitiator is called and it returns no response
That's OK, since those calls aren't expected to return anything. The
"Commit" message just tells the coordinator to commit. Once it has, it
sends a message to the completionInitiator containing the result -
Commited or Rolled Back.
(The same pattern applies to the calls between participant ("prepare")
and coordintor.)
the reply to prepare can be either PREPARED or ABORTED. But both these
messages
are sent over seperate connections. you should be able to them however.
--dasarath
---------------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]