Created
May 16, 2012 08:29
-
-
Save paulrobinson/2708704 to your computer and use it in GitHub Desktop.
Bridging without TXFramework
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Stateless @Remote(Bistro.class) | |
@WebService() | |
@HandlerChain(file = "jaxws-handlers-server.xml") | |
@TransactionAttribute(TransactionAttributeType.MANDATORY) | |
public class BistroImpl implements Bistro | |
{ | |
@PersistenceContext protected EntityManager em; | |
@WebMethod | |
@ServiceRequest | |
public void bookSeats(int howMany) { | |
//Use em to increase booking count in DB | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Restaurant restaurant = //get Web service port | |
List<Handler> handlers = new ArrayList<Handler>(1); | |
handlers.add(new JaxWSTxOutboundBridgeHandler()); | |
handlers.add(new JaxWSHeaderContextProcessor()); | |
BindingProvider bindingProvider = (BindingProvider) restaurant; | |
bindingProvider.getBinding().setHandlerChain(handlers); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<handler-chains | |
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee javaee_web_services_1_2.xsd" | |
...> | |
<handler-chain> | |
<protocol-bindings>##SOAP11_HTTP</protocol-bindings> | |
<handler> | |
<handler-name>TransactionBridgeHandler</handler-name> | |
<handler-class> | |
org.jboss.jbossts.txbridge.inbound.JaxWSTxInboundBridgeHandler | |
</handler-class> | |
</handler> | |
<handler> | |
<handler-name>WebServicesTxContextHandler</handler-name> | |
<handler-class> | |
com.arjuna.mw.wst11.service.JaxWSHeaderContextProcessor | |
</handler-class> | |
</handler> | |
</handler-chain> | |
</handler-chains> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment