Author: heiko.braun(a)jboss.com
Date: 2007-03-22 11:42:02 -0400 (Thu, 22 Mar 2007)
New Revision: 2659
Modified:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerEJB21.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
Log:
Fix WSDD portName overrides
Modified:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerEJB21.java
===================================================================
---
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerEJB21.java 2007-03-22
15:35:26 UTC (rev 2658)
+++
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerEJB21.java 2007-03-22
15:42:02 UTC (rev 2659)
@@ -29,8 +29,12 @@
import org.jboss.virtual.VirtualFile;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
import org.jboss.ws.core.server.UnifiedDeploymentInfo.DeploymentType;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.metadata.builder.jaxrpc.JAXRPCDeployment;
+import org.w3c.dom.Element;
+import java.io.IOException;
+
/**
* A deployer JAXRPC EJB21 Endpoints
*
@@ -39,6 +43,8 @@
*/
public class JAXRPCDeployerEJB21 extends AbstractDeployerEJB
{
+ private static final String WEBSERVICES_XML = "webservices.xml";
+
@Override
protected DeploymentType getDeploymentType()
{
@@ -57,8 +63,25 @@
@Override
public boolean isWebServiceDeployment(DeploymentUnit unit)
{
- boolean hasAppMetaData = unit.getAllMetaData(ApplicationMetaData.class).size() >
0;
- return hasAppMetaData && getWebServicesFile(unit) != null;
+ boolean isWebserviceDeployment =
unit.getAllMetaData(ApplicationMetaData.class).size() > 0;
+ isWebserviceDeployment = (isWebserviceDeployment &&
getWebServicesFile(unit) != null);
+
+ if(isWebserviceDeployment)
+ {
+ // verify the DD namespace
+ try
+ {
+ Element root = DOMUtils.parse(
unit.getMetaDataFile(WEBSERVICES_XML).openStream() );
+ isWebserviceDeployment = (isWebserviceDeployment &&
root.getNamespaceURI().equals("http://java.sun.com/xml/ns/j2ee"));
+ }
+ catch (IOException e)
+ {
+ throw new IllegalArgumentException("Failed to parse
webservice.xml", e);
+ }
+ }
+
+ return isWebserviceDeployment;
+
}
private VirtualFile getWebServicesFile(DeploymentUnit unit)
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2007-03-22
15:35:26 UTC (rev 2658)
+++
trunk/jbossws-core/src/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2007-03-22
15:42:02 UTC (rev 2659)
@@ -201,10 +201,28 @@
{
for(PortComponentMetaData portComp : wsDesc.getPortComponents())
{
- if(portComp.getWsdlPort().equals(sepMetaData.getPortName()))
+ // We match portComp's by SEI first and portQName second
+ // In the first case the portComp may override the portQName that derives
from the annotation
+ String portCompSEI = portComp.getServiceEndpointInterface();
+ boolean doesMatch = portCompSEI != null ?
portCompSEI.equals(sepMetaData.getServiceEndpointInterfaceName()) : false;
+ if(!doesMatch)
{
+ doesMatch = portComp.getWsdlPort().equals(sepMetaData.getPortName());
+ }
- log.debug("Processing 'webservices.xml' handler
contributions");
+ if(doesMatch)
+ {
+
+ log.debug("Processing 'webservices.xml' contributions on
EndpointMetaData");
+
+ // PortQName overrides
+ if(portComp.getWsdlPort()!=null)
+ {
+ log.debug("Override EndpointMetaData portName " +
sepMetaData.getPortName() + " with " + portComp.getWsdlPort());
+ sepMetaData.setPortName(portComp.getWsdlPort());
+ }
+
+ // HandlerChain contributions
UnifiedHandlerChainsMetaData chainWrapper =
portComp.getHandlerChains();
if(chainWrapper!=null)
{
@@ -214,14 +232,16 @@
{
HandlerMetaDataJAXWS handlerMetaDataJAXWS =
uhmd.getHandlerMetaDataJAXWS(sepMetaData, HandlerMetaData.HandlerType.ENDPOINT);
sepMetaData.addHandler(handlerMetaDataJAXWS);
- log.debug("Handler contribution from webservices.xml:
" + handlerMetaDataJAXWS.getHandlerName());
+ log.debug("Contribute handler from webservices.xml:
" + handlerMetaDataJAXWS.getHandlerName());
}
}
}
- log.debug("Processing MTOM contributions");
+ // MTOM settings
if(portComp.isEnableMtom())
{
+ log.debug("Enabling MTOM");
+
String bindingId = sepMetaData.getBindingId();
if(bindingId.equals(Constants.SOAP11HTTP_BINDING))
sepMetaData.setBindingId(Constants.SOAP11HTTP_MTOM_BINDING);
Modified: trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
===================================================================
---
trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2007-03-22
15:35:26 UTC (rev 2658)
+++
trunk/jbossws-core/src/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2007-03-22
15:42:02 UTC (rev 2659)
@@ -153,6 +153,11 @@
return portName;
}
+ public void setPortName(QName portName)
+ {
+ this.portName = portName;
+ }
+
public QName getPortTypeName()
{
return portTypeName;