-
Patch
-
Resolution: Duplicate
-
Major
-
None
-
None
-
None
Allow the use of Ejb3 MDBs to support soap over jms. Note: This is a different solution then outlined in the referenced forum discussion.
Here is a sample Ejb3 MDB which is also annotated with JWS annotations:
@MessageDriven(activationConfig =
{ @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"), @ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/AuthorizationCallbackQueue"), @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "AUTO_ACKNOWLEDGE"), @ActivationConfigProperty(propertyName = "subscriptionDurability", propertyValue = "Durable") })
@WebService(name = "AuthorizationCallbackService", serviceName = "AuthorizationCallbackService")
@SOAPBinding(style = Style.RPC, use = Use.LITERAL, parameterStyle = ParameterStyle.BARE)
@SOAPMessageHandlers(
)
@SecurityDomain("portal")
public class AuthorizationCallbackMDB extends JMSTransportSupport implements MessageListener {
@WebMethod
@Oneway
public void authorizationResponse(@WebParam(name = "paymentId") long paymentId, @WebParam(name = "status") boolean status) throws java.rmi.RemoteException
}
The following changes where made to get this to work:
jbossws-core.jar -> org.jboss.ws.server.ServiceEndpointInfo constructor
} else if (udi.type == UnifiedDeploymentInfo.Type.JSR181_EJB3) {
String ejbName = sepMetaData.getLinkName();
UnifiedApplicationMetaData applMetaData = (UnifiedApplicationMetaData) udi.metaData;
UnifiedBeanMetaData beanMetaData = (UnifiedBeanMetaData) applMetaData
.getBeanByEjbName(ejbName);
if (beanMetaData instanceof UnifiedMessageDrivenMetaData)
else
{ this.type = Type.SLSB30; }}
jbossws-jboss-integration.jar -> org.jboss.ws.integration.jboss.DeployerInterceptorEJB3
protected UnifiedDeploymentInfo createUnifiedDeploymentInfo(DeploymentInfo di) throws Exception {
...
for (Object container : ejb3Module.getContainers().values()) {
if (container instanceof StatelessContainer)
if (container instanceof MDB) {
MDB mdc = (MDB) container;
if (mdc.resolveAnnotation(WebService.class) != null)
}
}
...
}
protected boolean isWebserviceDeployment(DeploymentInfo di) {
...
for (Object manager : ejb3Module.getContainers().values()) {
if (manager instanceof StatelessContainer) {
StatelessContainer container = (StatelessContainer) manager;
if (container.resolveAnnotation(WebService.class) != null)
}
if (manager instanceof MDB) {
MDB container = (MDB) manager;
if (container.resolveAnnotation(WebService.class) != null) { isWebserviceDeployment = true; break; }
}
}
...
}
The only thing I couldn't fix was the generated endpoint address in the wsdl. It still comes out like this
<soap:address location='http://localhost:8080/payment-authorizer-0/AuthorizationCallbackMDB'/>
instead of something like this
<soap:address location='jms://localhost/queue/AuthorizationCallbackQueue'/>
On a similar note I have created a straight forward jboss remoting JmsClientInvoker. It only works with Oneway messages, which is reasonable.
- duplicates
-
JBWS-1911 Support the JMS transport with JAX-WS
- Closed