[jboss-user] [JBossWS] - Re: Ejb3 JMSTransportSupport

jgilbert do-not-reply at jboss.com
Wed Nov 15 12:51:54 EST 2006


I extended JMSTransportSupport and overrode processSOAPMessage() to get something to work with Ejb3 MDBs.

For starters the the WebService is implements per usual as a SLSB. I am just using the MDB as an alternate path in the WebService.

The MDB just defines the ObjectName for the real web service.


  | @MessageDriven(activationConfig = {...})
  | public class AuthorizationCallbackMDB extends MyJmsTransportSupport implements
  | 		MessageListener {
  | 	ObjectName getObjectName() {
  | 		try {
  | 			return new ObjectName(
  | 					"jboss.ws:context=payment-authorizer-0,endpoint=AuthorizationCallbackServiceMockBean");
  | 		} catch (Exception e) {
  | 			throw new RuntimeException(e);
  | 		}
  | 	}
  | }
  | 

  | public abstract class MyJmsTransportSupport extends JMSTransportSupport {
  | 
  | 	private static final long serialVersionUID = 1L;
  | 
  | 	abstract ObjectName getObjectName();
  | 
  | 	protected SOAPMessage processSOAPMessage(String fromName,
  | 			InputStream reqMessage) throws SOAPException, IOException,
  | 			RemoteException {
  | 		try {
  | 			ServiceEndpointManagerFactory factory = ServiceEndpointManagerFactory
  | 					.getInstance();
  | 			ServiceEndpointManager epManager = factory
  | 					.getServiceEndpointManager();
  | 			ServiceEndpoint sep = epManager
  | 					.getServiceEndpointByID(getObjectName());
  | 			return sep.handleRequest(null, null, reqMessage);
  | 		} catch (BindingException ex) {
  | 			throw new WSException("Cannot bind incomming soap message", ex);
  | 		}
  | 	}
  | }
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3986246#3986246

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3986246



More information about the jboss-user mailing list