WS-AT and commit

Posted on

Hello,

I am trying to call a web service in another J2EE application server, under an XTS controlled transaction that is handled by JBoss EAP (v 6.4.6). I have a stateless EJB set up with container managed transaction. I am starting JBoss using the standalone-xts.xml. Inside my EJB exposed method, I am calling some JDBC code that makes some changes in an XADataSource connection as well as a WS-AT web service call. Prior to making the web service call I inject the following handlers (which I understand are necessary for the web service call to participate in the transaction):

... setup the port to the web service in the port local variable ...
BindingProvider bindingProvider = (BindingProvider) port;
List handlers = new ArrayList<>(2);
handlers.add(new JaxWSTxOutboundBridgeHandler());
handlers.add(new JaxWSHeaderContextProcessor());
bindingProvider.getBinding().setHandlerChain(handlers);
Response response = port.callWSFunction("foo", "bar"); // <- this is the web service call
...

This seems to insert the appropriate WS-AT headers in the web service call SOAP message, and the call goes smothly, but when the EJB method returns and the two phase commit protocol kicks in, the prepare phase for the txBridge adorned XAResource reports that it is read only and thus no commit is called. What am I doing wrong/missing? Please advise.

Responses