Author: thomas.diesler(a)jboss.com
Date: 2006-11-20 17:48:06 -0500 (Mon, 20 Nov 2006)
New Revision: 1476
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/annotation/PortComponent.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/deployment/AnnotationsMetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/deployment/JSR109ServerMetaDataBuilder.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/JBossServiceEndpointServlet.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/ServiceObjectFactory.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/handler/HandlerDelegateJAXRPC.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/handler/HandlerResolverImpl.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/ClientEndpointMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/EndpointMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/ServerEndpointMetaData.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/ServiceEndpointManager.java
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCase.java
branches/tdiesler/trunk/src/test/resources/jaxws/jbws1178/WEB-INF/web.xml
Log:
[JBWS-864] soap:address in wsdl ignores <url-pattern>
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/annotation/PortComponent.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/annotation/PortComponent.java 2006-11-20
22:22:10 UTC (rev 1475)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/annotation/PortComponent.java 2006-11-20
22:48:06 UTC (rev 1476)
@@ -47,6 +47,13 @@
String contextRoot() default "";
/**
+ * The virtual hosts that the web service endpoint is deployed to.
+ *
+ * Applies to server side port components only.
+ */
+ String[] virtualHosts() default {};
+
+ /**
* Relative path that is appended to the contextRoot to form fully qualified
* endpoint address for the web service endpoint.
*
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/deployment/AnnotationsMetaDataBuilder.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/deployment/AnnotationsMetaDataBuilder.java 2006-11-20
22:22:10 UTC (rev 1475)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/deployment/AnnotationsMetaDataBuilder.java 2006-11-20
22:48:06 UTC (rev 1476)
@@ -27,9 +27,9 @@
import org.jboss.logging.Logger;
import org.jboss.ws.annotation.PortComponent;
-import org.jboss.ws.deployment.UnifiedDeploymentInfo.DeploymentType;
import org.jboss.ws.metadata.EndpointMetaData;
import org.jboss.ws.metadata.ServerEndpointMetaData;
+import org.jboss.ws.metadata.j2ee.UnifiedWebMetaData;
/** An abstract annotation meta data builder.
*
@@ -55,81 +55,77 @@
}
}
- protected void processPortComponent(UnifiedDeploymentInfo udi, Class wsClass, String
linkName, ServerEndpointMetaData sepMetaData)
+ protected void processPortComponent(UnifiedDeploymentInfo udi, Class wsClass, String
linkName, ServerEndpointMetaData epMetaData)
{
+ // Setting the defaults
+ String contextRoot = "/" + udi.shortName.substring(0,
udi.shortName.indexOf('.'));
+ String urlPattern = "/" + linkName;
+
+ // Init contextRoot from jboss-web.xml
+ if (udi.metaData instanceof UnifiedWebMetaData)
+ {
+ UnifiedWebMetaData webMetaData = (UnifiedWebMetaData)udi.metaData;
+ if (webMetaData.getContextRoot() != null)
+ contextRoot = webMetaData.getContextRoot();
+
+ urlPattern = webMetaData.getServletMappings().get(linkName);
+
+ epMetaData.setTransportGuarantee(getTransportGuarantee(webMetaData, linkName));
+ }
+
+ // Process @PortComponent
PortComponent anPortComponent =
(PortComponent)wsClass.getAnnotation(PortComponent.class);
if (anPortComponent != null)
{
// setup config name
- if (anPortComponent.configName().length() > 0)
- {
- String configName = anPortComponent.configName();
- sepMetaData.setConfigName(configName);
- }
+ String configName = anPortComponent.configName();
+ if (configName.length() > 0)
+ epMetaData.setConfigName(configName);
// setup config file
- if (anPortComponent.configFile().length() > 0)
- {
- String configFile = anPortComponent.configFile();
- sepMetaData.setConfigFile(configFile);
- }
+ String configFile = anPortComponent.configFile();
+ if (configFile.length() > 0)
+ epMetaData.setConfigFile(configFile);
- boolean isJSEEndpoint = udi.type == DeploymentType.JSR181_JSE || udi.type ==
DeploymentType.JAXWS_PROVIDER_JSE;
-
- // context-root
if (anPortComponent.contextRoot().length() > 0)
{
- if (isJSEEndpoint)
- log.warn("(a)PortComponent.contextRoot is only valid on EJB
endpoints");
-
- if (isJSEEndpoint == false)
- {
- String contextRoot = anPortComponent.contextRoot();
- if (contextRoot.startsWith("/") == false)
- contextRoot = "/" + contextRoot;
-
- sepMetaData.setContextRoot(contextRoot);
- }
+ contextRoot = anPortComponent.contextRoot();
}
-
- // url-pattern
- if (anPortComponent.urlPattern().length() > 0)
+
+ String[] virtualHosts = anPortComponent.virtualHosts();
+ if (virtualHosts != null & virtualHosts.length > 0)
{
- if (isJSEEndpoint)
- log.warn("(a)PortComponent.urlPattern is only valid on EJB
endpoints");
-
- if (isJSEEndpoint == false)
- {
- String urlPattern = anPortComponent.urlPattern();
- sepMetaData.setURLPattern(urlPattern);
- }
+ epMetaData.setVirtualHosts(virtualHosts);
}
- // auth-method
- if (anPortComponent.authMethod().length() > 0)
+ if (anPortComponent.urlPattern().length() > 0)
{
- if (isJSEEndpoint)
- log.warn("(a)PortComponent.authMethod is only valid on EJB
endpoints");
-
- if (isJSEEndpoint == false)
- {
- String authMethod = anPortComponent.authMethod();
- sepMetaData.setAuthMethod(authMethod);
- }
+ urlPattern = anPortComponent.urlPattern();
}
- // transport-guarantee
- if (anPortComponent.transportGuarantee().length() > 0)
- {
- if (isJSEEndpoint)
- log.warn("(a)PortComponent.transportGuarantee is only valid on EJB
endpoints");
+ // setup authetication method
+ String authMethod = anPortComponent.authMethod();
+ if (authMethod.length() > 0)
+ epMetaData.setAuthMethod(authMethod);
- if (isJSEEndpoint == false)
+ if (epMetaData.getTransportGuarantee() == null ||
epMetaData.getTransportGuarantee().length() == 0)
+ {
+ // setup transport guarantee
+ String transportGuarantee = anPortComponent.transportGuarantee();
+ if (transportGuarantee.length() > 0)
{
- String transportGuarantee = anPortComponent.transportGuarantee();
- sepMetaData.setTransportGuarantee(transportGuarantee);
+ epMetaData.setTransportGuarantee(transportGuarantee);
}
}
}
+
+ epMetaData.setContextRoot(contextRoot);
+ epMetaData.setURLPattern(urlPattern);
+
+ String servicePath = contextRoot + urlPattern;
+ epMetaData.setEndpointAddress(getServiceEndpointAddress(null, servicePath));
+
+ // replace the SOAP address
+ replaceAddressLocation(epMetaData);
}
}
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/deployment/JSR109ServerMetaDataBuilder.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/deployment/JSR109ServerMetaDataBuilder.java 2006-11-20
22:22:10 UTC (rev 1475)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/deployment/JSR109ServerMetaDataBuilder.java 2006-11-20
22:48:06 UTC (rev 1476)
@@ -22,11 +22,7 @@
// $Id$
package org.jboss.ws.deployment;
-import java.io.File;
-import java.io.FileInputStream;
import java.io.IOException;
-import java.util.Iterator;
-import java.util.Map;
import java.util.Set;
import javax.management.ObjectName;
@@ -54,8 +50,6 @@
import org.jboss.ws.metadata.wsdl.WSDLEndpoint;
import org.jboss.ws.metadata.wsdl.WSDLService;
import org.jboss.ws.metadata.wsse.WSSecurityConfiguration;
-import org.jboss.ws.utils.DOMUtils;
-import org.w3c.dom.Element;
/**
* A server side meta data builder that is based on webservices.xml.
@@ -111,8 +105,7 @@
{
QName portName = pcMetaData.getWsdlPort();
- // JBWS-722
- // <wsdl-port> in webservices.xml should be qualified
+ // JBWS-722] <wsdl-port> in webservices.xml should be qualified
if (portName.getNamespaceURI().length() == 0)
{
String nsURI = wsdlDefinitions.getTargetNamespace();
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/JBossServiceEndpointServlet.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/JBossServiceEndpointServlet.java 2006-11-20
22:22:10 UTC (rev 1475)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/integration/jboss50/JBossServiceEndpointServlet.java 2006-11-20
22:48:06 UTC (rev 1476)
@@ -68,7 +68,7 @@
sepMetaData.setConfigName(configName);
sepMetaData.setConfigFile(configFile);
- List<HandlerMetaData> sepHandlers =
sepMetaData.getHandlers(HandlerType.ENDPOINT);
+ List<HandlerMetaData> sepHandlers =
sepMetaData.getHandlerMetaData(HandlerType.ENDPOINT);
sepMetaData.clearHandlers();
// Add pre handlers
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/ServiceObjectFactory.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/ServiceObjectFactory.java 2006-11-20
22:22:10 UTC (rev 1475)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/ServiceObjectFactory.java 2006-11-20
22:48:06 UTC (rev 1476)
@@ -302,7 +302,7 @@
Set<String> handlerRoles = new HashSet<String>();
ArrayList handlerInfos = new ArrayList();
- for (HandlerMetaData handlerMetaData : epMetaData.getHandlers(HandlerType.ALL))
+ for (HandlerMetaData handlerMetaData :
epMetaData.getHandlerMetaData(HandlerType.ALL))
{
HandlerMetaDataJAXRPC jaxrpcMetaData =
(HandlerMetaDataJAXRPC)handlerMetaData;
handlerRoles.addAll(jaxrpcMetaData.getSoapRoles());
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/handler/HandlerDelegateJAXRPC.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/handler/HandlerDelegateJAXRPC.java 2006-11-20
22:22:10 UTC (rev 1475)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxrpc/handler/HandlerDelegateJAXRPC.java 2006-11-20
22:48:06 UTC (rev 1476)
@@ -148,7 +148,7 @@
List<HandlerInfo> hInfos = new ArrayList<HandlerInfo>();
ServerEndpointMetaData sepMetaData = seInfo.getServerEndpointMetaData();
- for (HandlerMetaData handlerMetaData : sepMetaData.getHandlers(type))
+ for (HandlerMetaData handlerMetaData : sepMetaData.getHandlerMetaData(type))
{
HandlerMetaDataJAXRPC jaxrpcMetaData = (HandlerMetaDataJAXRPC)handlerMetaData;
handlerRoles.addAll(jaxrpcMetaData.getSoapRoles());
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/handler/HandlerResolverImpl.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/handler/HandlerResolverImpl.java 2006-11-20
22:22:10 UTC (rev 1475)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/jaxws/handler/HandlerResolverImpl.java 2006-11-20
22:48:06 UTC (rev 1476)
@@ -131,7 +131,7 @@
public void initHandlerChain(EndpointMetaData epMetaData, HandlerType type)
{
log.debug("initHandlerChain: " + type);
- for (HandlerMetaData handlerMetaData : epMetaData.getHandlers(type))
+ for (HandlerMetaData handlerMetaData : epMetaData.getHandlerMetaData(type))
{
HandlerMetaDataJAXWS jaxwsMetaData = (HandlerMetaDataJAXWS)handlerMetaData;
String handlerName = jaxwsMetaData.getHandlerName();
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/ClientEndpointMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/ClientEndpointMetaData.java 2006-11-20
22:22:10 UTC (rev 1475)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/ClientEndpointMetaData.java 2006-11-20
22:48:06 UTC (rev 1476)
@@ -168,7 +168,7 @@
{
buffer.append("\n" + opMetaData);
}
- for (HandlerMetaData hdlMetaData : getHandlers(HandlerType.ALL))
+ for (HandlerMetaData hdlMetaData : getHandlerMetaData(HandlerType.ALL))
{
buffer.append("\n" + hdlMetaData);
}
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/EndpointMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/EndpointMetaData.java 2006-11-20
22:22:10 UTC (rev 1475)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/EndpointMetaData.java 2006-11-20
22:48:06 UTC (rev 1476)
@@ -438,7 +438,7 @@
handlersInitialized = false;
}
- public List<HandlerMetaData> getHandlers(HandlerType type)
+ public List<HandlerMetaData> getHandlerMetaData(HandlerType type)
{
List<HandlerMetaData> typeHandlers = new ArrayList<HandlerMetaData>();
for (HandlerMetaData hmd : handlers)
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/ServerEndpointMetaData.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/ServerEndpointMetaData.java 2006-11-20
22:22:10 UTC (rev 1475)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/metadata/ServerEndpointMetaData.java 2006-11-20
22:48:06 UTC (rev 1476)
@@ -64,6 +64,8 @@
private ObjectName sepID;
// The HTTP context root
private String contextRoot;
+ // The HTTP virtual hosts
+ private String[] virtualHosts;
// The HTTP url parttern
private String urlPattern;
// The bean that registers with the ServiceEndpointManager
@@ -139,6 +141,16 @@
this.contextRoot = contextRoot;
}
+ public String[] getVirtualHosts()
+ {
+ return virtualHosts;
+ }
+
+ public void setVirtualHosts(String[] virtualHosts)
+ {
+ this.virtualHosts = virtualHosts;
+ }
+
public String getURLPattern()
{
return urlPattern;
@@ -267,7 +279,7 @@
{
buffer.append("\n" + opMetaData);
}
- for (HandlerMetaData hdlMetaData : getHandlers(HandlerType.ALL))
+ for (HandlerMetaData hdlMetaData : getHandlerMetaData(HandlerType.ALL))
{
buffer.append("\n" + hdlMetaData);
}
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/ServiceEndpointManager.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/ServiceEndpointManager.java 2006-11-20
22:22:10 UTC (rev 1475)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/ServiceEndpointManager.java 2006-11-20
22:48:06 UTC (rev 1476)
@@ -508,7 +508,7 @@
if (wsEndpoint != null)
{
ServerEndpointMetaData sepMetaData =
wsEndpoint.getServiceEndpointInfo().getServerEndpointMetaData();
- handlers = sepMetaData.getHandlers(HandlerType.ALL);
+ handlers = sepMetaData.getHandlerMetaData(HandlerType.ALL);
}
return handlers;
}
Modified:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCase.java
===================================================================
---
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCase.java 2006-11-20
22:22:10 UTC (rev 1475)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCase.java 2006-11-20
22:48:06 UTC (rev 1476)
@@ -37,9 +37,8 @@
import org.jboss.ws.jaxrpc.CallImpl;
/**
- * Multiple virtual host and soap:address problem
- *
- *
http://jira.jboss.org/jira/browse/JBWS-1178
+ * [JBWS-1178] Multiple virtual host and soap:address problem
+ * [JBWS-864] soap:address in wsdl ignores <url-pattern>
*
* @author Thomas.Diesler(a)jboss.com
* @since 05-Oct-2006
@@ -70,7 +69,7 @@
public void testHostAddress() throws Exception
{
InetAddress inetAddr = InetAddress.getByName(getServerHost());
- URL wsdlURL = new URL("http://" + inetAddr.getHostAddress() +
":8080/jaxws-jbws1178?wsdl");
+ URL wsdlURL = new URL("http://" + inetAddr.getHostAddress() +
":8080/jaxws-jbws1178/testpattern?wsdl");
ServiceFactory factory = ServiceFactory.newInstance();
QName serviceName = new QName("http://org.jboss.ws/jbws1178",
"TestEndpointService");
@@ -85,7 +84,7 @@
public void testHostName() throws Exception
{
InetAddress inetAddr = InetAddress.getByName(getServerHost());
- URL wsdlURL = new URL("http://" + inetAddr.getHostName() +
":8080/jaxws-jbws1178?wsdl");
+ URL wsdlURL = new URL("http://" + inetAddr.getHostName() +
":8080/jaxws-jbws1178/testpattern?wsdl");
ServiceFactory factory = ServiceFactory.newInstance();
QName serviceName = new QName("http://org.jboss.ws/jbws1178",
"TestEndpointService");
Modified: branches/tdiesler/trunk/src/test/resources/jaxws/jbws1178/WEB-INF/web.xml
===================================================================
--- branches/tdiesler/trunk/src/test/resources/jaxws/jbws1178/WEB-INF/web.xml 2006-11-20
22:22:10 UTC (rev 1475)
+++ branches/tdiesler/trunk/src/test/resources/jaxws/jbws1178/WEB-INF/web.xml 2006-11-20
22:48:06 UTC (rev 1476)
@@ -10,6 +10,7 @@
<servlet-mapping>
<servlet-name>TestEndpoint</servlet-name>
- <url-pattern>/*</url-pattern>
+ <!-- [JBWS-864] soap:address in wsdl ignores <url-pattern> -->
+ <url-pattern>/testpattern</url-pattern>
</servlet-mapping>
</web-app>
\ No newline at end of file