[JBoss JIRA] Created: (JBWS-1402) Ejb3 JMSTransportSupport
by John Gilbert (JIRA)
Ejb3 JMSTransportSupport
------------------------
Key: JBWS-1402
URL: http://jira.jboss.com/jira/browse/JBWS-1402
Project: JBoss Web Services
Issue Type: Patch
Security Level: Public (Everyone can see)
Environment: I made these changes to work with JBossWS 1.0.3 and JBoss AS 4.0.4.
Reporter: John Gilbert
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( { @SOAPMessageHandler(className = "org.jboss.ws.wsse.WSSecurityHandlerInbound") })
@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) {
this.type = Type.MDB21;
} 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) {
StatelessContainer slc = (StatelessContainer) container;
UnifiedBeanMetaData uslc = new UnifiedBeanMetaData();
uslc.setEjbName(slc.getEjbName());
uslc.setEjbClass(slc.getBeanClassName());
beans.add(uslc);
}
if (container instanceof MDB) {
MDB mdc = (MDB) container;
if (mdc.resolveAnnotation(WebService.class) != null) {
UnifiedBeanMetaData umdc = new UnifiedMessageDrivenMetaData();
umdc.setEjbName(mdc.getEjbName());
umdc.setEjbClass(mdc.getBeanClassName());
ActivationConfigPropertyMetaData p = (ActivationConfigPropertyMetaData) mdc
.getActivationConfigProperties().get("destination");
((UnifiedMessageDrivenMetaData) umdc)
.setDestinationJndiName(p.getValue());
beans.add(umdc);
}
}
}
...
}
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) {
isWebserviceDeployment = true;
break;
}
}
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.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 9 months
[JBoss JIRA] Created: (JBWS-1459) Java to WSDL - Incorrect handling of arrays with bare parameter style
by Darran Lofthouse (JIRA)
Java to WSDL - Incorrect handling of arrays with bare parameter style
---------------------------------------------------------------------
Key: JBWS-1459
URL: http://jira.jboss.com/jira/browse/JBWS-1459
Project: JBoss Web Services
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: wstools
Affects Versions: jbossws-1.2.0.CR2
Reporter: Darran Lofthouse
Assigned To: Darran Lofthouse
Fix For: jbossws-1.2.1
Java to WSDL - Incorrect handling of arrays with bare parameter style
The following method on a SEI: -
public String[] lookup(final String[] person) throws RemoteException;
The following type is generated in the WSDL: -
<complexType name='String.Array'>
<sequence>
<element maxOccurs='unbounded' minOccurs='0' name='value' nillable='true' type='string'/>
</sequence>
</complexType>
This type is not mapped in the generated JAX-RPC mapping so the following error is reported on deployment: -
Caused by: org.jboss.ws.WSException: Cannot obtain java type mapping for: {http://www.jboss.org/support/phonebook/types}String.Array
at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCMetaDataBuilder.processDocElement(JAXRPCMetaDataBuilder.java:613)
at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCMetaDataBuilder.buildParameterMetaDataDoc(JAXRPCMetaDataBuilder.java:865)
at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCMetaDataBuilder.setupOperationsFromWSDL(JAXRPCMetaDataBuilder.java:214)
at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCServerMetaDataBuilder.buildMetaData(JAXRPCServerMetaDataBuilder.java:219)
at org.jboss.ws.core.server.ServiceEndpointDeployer.create(ServiceEndpointDeployer.java:81)
at org.jboss.ws.integration.jboss42.DeployerInterceptor.createServiceEndpoint(DeployerInterceptor.java:127)
at org.jboss.ws.integration.jboss42.DeployerInterceptorJSE.createServiceEndpoint(DeployerInterceptorJSE.java:130)
at org.jboss.ws.integration.jboss42.DeployerInterceptor.create(DeployerInterceptor.java:78)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
16 years, 9 months