Author: thomas.diesler(a)jboss.com
Date: 2006-11-20 17:22:10 -0500 (Mon, 20 Nov 2006)
New Revision: 1475
Added:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/
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/TestEndpoint.java
branches/tdiesler/trunk/src/test/resources/jaxws/jbws1178/
branches/tdiesler/trunk/src/test/resources/jaxws/jbws1178/WEB-INF/
branches/tdiesler/trunk/src/test/resources/jaxws/jbws1178/WEB-INF/web.xml
Removed:
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/TestEndpoint.java
branches/tdiesler/trunk/src/test/resources/jaxws/jbws1178/WEB-INF/
branches/tdiesler/trunk/src/test/resources/jaxws/jbws1178/WEB-INF/web.xml
Modified:
branches/tdiesler/trunk/.classpath
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/ServiceEndpoint.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/ServiceEndpointManager.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/ServiceEndpointManagerMBean.java
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/WSDLRequestHandler.java
branches/tdiesler/trunk/src/main/resources/jbossws.beans/META-INF/jboss-beans.xml
branches/tdiesler/trunk/src/test/ant/build-jars-jaxws.xml
branches/tdiesler/trunk/version.properties
Log:
[JBWS-1178] Multiple virtual host and soap:address problem
Modified: branches/tdiesler/trunk/.classpath
===================================================================
--- branches/tdiesler/trunk/.classpath 2006-11-20 19:11:07 UTC (rev 1474)
+++ branches/tdiesler/trunk/.classpath 2006-11-20 22:22:10 UTC (rev 1475)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry
excluding="org/jboss/ws/integration/jboss50/ServiceRefHandler.java"
kind="src" path="src/main/java"/>
<classpathentry excluding="org/jboss/test/ws/interop/" kind="src"
path="src/test/java"/>
<classpathentry kind="lib" path="thirdparty/activation.jar"/>
<classpathentry kind="lib" path="thirdparty/mailapi.jar"/>
Modified: branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/ServiceEndpoint.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/ServiceEndpoint.java 2006-11-20
19:11:07 UTC (rev 1474)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/ServiceEndpoint.java 2006-11-20
22:22:10 UTC (rev 1475)
@@ -36,6 +36,7 @@
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPMessage;
+import org.jboss.kernel.Kernel;
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.binding.BindingException;
@@ -123,17 +124,23 @@
/** Handle a WSDL request or a request for an included resource
*/
- public void handleWSDLRequest(OutputStream outStream, URL requestURL, String
resourcePath) throws IOException
+ public void handleWSDLRequest(OutputStream outStream, URL reqURL, String resPath)
throws IOException
{
ServiceEndpointInfo sepInfo = getServiceEndpointInfo();
EndpointMetaData epMetaData = sepInfo.getServerEndpointMetaData();
- String urlString = requestURL.toExternalForm();
- String requestURI = requestURL.getPath();
- String hostPath = urlString.substring(0, urlString.indexOf(requestURI));
-
+ String wsdlHost = reqURL.getHost();
+
+ ServiceEndpointManagerFactory factory =
ServiceEndpointManagerFactory.getInstance();
+ ServiceEndpointManager epManager = factory.getServiceEndpointManager();
+ if (epManager.getWebServiceHost().equals(ServiceEndpointManager.UNDEFINED_HOSTNAME)
== false)
+ {
+ wsdlHost = epManager.getWebServiceHost();
+ }
+ log.debug("WSDL request, using host: " + wsdlHost);
+
WSDLRequestHandler wsdlRequestHandler = new WSDLRequestHandler(epMetaData);
- Document document = wsdlRequestHandler.getDocumentForPath(hostPath, requestURI,
resourcePath);
+ Document document = wsdlRequestHandler.getDocumentForPath(reqURL, wsdlHost,
resPath);
OutputStreamWriter writer = new OutputStreamWriter(outStream);
new DOMWriter(writer).setPrettyprint(true).print(document.getDocumentElement());
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
19:11:07 UTC (rev 1474)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/ServiceEndpointManager.java 2006-11-20
22:22:10 UTC (rev 1475)
@@ -85,14 +85,16 @@
// provide logging
private static final Logger log = Logger.getLogger(ServiceEndpointManager.class);
- // default bean name
+ // Default bean name
public static final String BEAN_NAME = "ServiceEndpointManager";
+ // The host name that is returned if there is no other defined
+ public static String UNDEFINED_HOSTNAME = "jbossws.undefined.host";
// maps serviceID to EndpointInfo
private Map<ObjectName, ServiceEndpoint> registry = new
ConcurrentHashMap<ObjectName, ServiceEndpoint>();
// The webservice host name that will be used when updating the wsdl
- private String webServiceHost;
+ private String webServiceHost = UNDEFINED_HOSTNAME;
// The webservice port that will be used when updating the wsdl
private int webServicePort;
// The webservice port that will be used when updating the wsdl
@@ -128,21 +130,19 @@
return alwaysModifySOAPAddress;
}
- public void setWebServiceHost(String host)
+ public void setWebServiceHost(String host) throws UnknownHostException
{
+ if (host == null || host.trim().length() == 0)
+ {
+ log.debug("Using undefined host: " + UNDEFINED_HOSTNAME);
+ host = UNDEFINED_HOSTNAME;
+ }
if ("0.0.0.0".equals(host))
{
- try
- {
- InetAddress localHost = InetAddress.getLocalHost();
- host = localHost.getHostName();
- }
- catch (UnknownHostException e)
- {
- log.error("Cannot map host: " + host, e);
- }
+ InetAddress localHost = InetAddress.getLocalHost();
+ log.debug("Using local host: " + localHost.getHostName());
+ host = localHost.getHostName();
}
-
this.webServiceHost = host;
}
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/ServiceEndpointManagerMBean.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/ServiceEndpointManagerMBean.java 2006-11-20
19:11:07 UTC (rev 1474)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/ServiceEndpointManagerMBean.java 2006-11-20
22:22:10 UTC (rev 1475)
@@ -21,6 +21,7 @@
*/
package org.jboss.ws.server;
+import java.net.UnknownHostException;
import java.util.List;
import javax.management.ObjectName;
@@ -38,7 +39,7 @@
static final ObjectName OBJECT_NAME =
ObjectNameFactory.create("jboss.ws:service=ServiceEndpointManager");
String getWebServiceHost();
- void setWebServiceHost(String host);
+ void setWebServiceHost(String host) throws UnknownHostException;
int getWebServicePort();
void setWebServicePort(int port);
Modified:
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/WSDLRequestHandler.java
===================================================================
---
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/WSDLRequestHandler.java 2006-11-20
19:11:07 UTC (rev 1474)
+++
branches/tdiesler/trunk/src/main/java/org/jboss/ws/server/WSDLRequestHandler.java 2006-11-20
22:22:10 UTC (rev 1475)
@@ -25,11 +25,12 @@
import java.io.File;
import java.io.IOException;
+import java.net.MalformedURLException;
import java.net.URL;
import org.jboss.logging.Logger;
+import org.jboss.ws.metadata.EndpointMetaData;
import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.metadata.EndpointMetaData;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -64,10 +65,10 @@
* <p/>
* Use path value of null to get the root document
*
- * @param resourcePath The wsdl resource to get, can be null for the top level wsdl
+ * @param resPath The wsdl resource to get, can be null for the top level wsdl
* @return A wsdl document, or null if it cannot be found
*/
- public Document getDocumentForPath(String hostPath, String requestURI, String
resourcePath) throws IOException
+ public Document getDocumentForPath(URL reqURL, String wsdlHost, String resPath) throws
IOException
{
String wsdlLocation = epMetaData.getServiceMetaData().getWsdlFile();
if (wsdlLocation == null)
@@ -79,7 +80,7 @@
URL wsdlURL = new URL(wsdlLocation);
// get the root wsdl
- if (resourcePath == null)
+ if (resPath == null)
{
Element wsdlElement = DOMUtils.parse(wsdlURL.openStream());
wsdlDoc = wsdlElement.getOwnerDocument();
@@ -88,21 +89,21 @@
// get some imported resource
else
{
- String resPath = new File(wsdlURL.getPath()).getParent() + File.separatorChar +
resourcePath;
- File resFile = new File(resPath);
+ String impResourcePath = new File(wsdlURL.getPath()).getParent() +
File.separatorChar + resPath;
+ File impResourceFile = new File(impResourcePath);
- Element wsdlElement = DOMUtils.parse(resFile.toURL().openStream());
+ Element wsdlElement = DOMUtils.parse(impResourceFile.toURL().openStream());
wsdlDoc = wsdlElement.getOwnerDocument();
}
- modifyImportLocations(hostPath, requestURI, resourcePath,
wsdlDoc.getDocumentElement());
+ modifyAddressReferences(reqURL, wsdlHost, resPath, wsdlDoc.getDocumentElement());
return wsdlDoc;
}
/**
* Modify the location of wsdl and schema imports
*/
- private void modifyImportLocations(String hostPath, String requestURI, String
resourcePath, Element element)
+ private void modifyAddressReferences(URL reqURL, String wsdlHost, String resPath,
Element element) throws MalformedURLException
{
// map wsdl definition imports
NodeList nlist = element.getChildNodes();
@@ -123,23 +124,50 @@
{
String orgLocation = locationAttr.getNodeValue();
boolean isAbsolute = orgLocation.startsWith("http://") ||
orgLocation.startsWith("https://");
- if (isAbsolute == false && orgLocation.startsWith(requestURI)
== false)
+ if (isAbsolute == false &&
orgLocation.startsWith(reqURL.getPath()) == false)
{
String newResourcePath = orgLocation;
- if (resourcePath != null &&
resourcePath.indexOf("/") > 0)
- newResourcePath = resourcePath.substring(0,
resourcePath.lastIndexOf("/") + 1) + orgLocation;
+ if (resPath != null && resPath.indexOf("/") >
0)
+ newResourcePath = resPath.substring(0,
resPath.lastIndexOf("/") + 1) + orgLocation;
- String newLocation = hostPath + requestURI +
"?wsdl&resource=" + newResourcePath;
+ String reqProtocol = reqURL.getProtocol();
+ int reqPort = reqURL.getPort();
+ String hostAndPort = wsdlHost + (reqPort > 0 ? ":" +
reqPort : "");
+ String reqPath = reqURL.getPath();
+
+ String newLocation = reqProtocol + "://" + hostAndPort +
reqPath + "?wsdl&resource=" + newResourcePath;
locationAttr.setNodeValue(newLocation);
log.debug("Mapping import from '" + orgLocation +
"' to '" + newLocation + "'");
}
}
}
+ else if ("address".equals(nodeName))
+ {
+ Attr locationAttr = childElement.getAttributeNode("location");
+ if (locationAttr != null)
+ {
+ String orgLocation = locationAttr.getNodeValue();
+
+ URL locURL = new URL(orgLocation);
+ String locProtocol = locURL.getProtocol();
+ String locPath = locURL.getPath();
+ if (reqURL.getProtocol().equals(locProtocol) &&
reqURL.getPath().equals(locPath))
+ {
+ int locPort = locURL.getPort();
+ String hostAndPort = wsdlHost + (locPort > 0 ? ":" +
locPort : "");
+
+ String newLocation = locProtocol + "://" + hostAndPort +
locPath;
+ locationAttr.setNodeValue(newLocation);
+
+ log.debug("Mapping address from '" + orgLocation +
"' to '" + newLocation + "'");
+ }
+ }
+ }
else
{
- modifyImportLocations(hostPath, requestURI, resourcePath, childElement);
+ modifyAddressReferences(reqURL, wsdlHost, resPath, childElement);
}
}
}
Modified:
branches/tdiesler/trunk/src/main/resources/jbossws.beans/META-INF/jboss-beans.xml
===================================================================
---
branches/tdiesler/trunk/src/main/resources/jbossws.beans/META-INF/jboss-beans.xml 2006-11-20
19:11:07 UTC (rev 1474)
+++
branches/tdiesler/trunk/src/main/resources/jbossws.beans/META-INF/jboss-beans.xml 2006-11-20
22:22:10 UTC (rev 1475)
@@ -7,11 +7,13 @@
<bean name="ServiceEndpointManager"
class="org.jboss.ws.server.ServiceEndpointManager">
<!--
- The WSDL, that is a required deployment artifact for an endpoint, has a
<soap:address>
- element which points to the location of the endpoint. JBoss supports rewriting of
that SOAP address.
-
- If the content of <soap:address> is a valid URL, JBossWS will not rewrite it
unless AlwaysModifySOAPAddress is true.
- If the content of <soap:address> is not a valid URL, JBossWS will rewrite it
using the attribute values given below.
+ The WSDL, that is a required deployment artifact for an endpoint, has a
<soap:address>
+ element which points to the location of the endpoint. JBoss supports rewriting of
that SOAP address.
+
+ If the content of <soap:address> is a valid URL, JBossWS will not rewrite
it unless 'alwaysModifySOAPAddress' is true.
+ If the content of <soap:address> is not a valid URL, JBossWS will rewrite
it using the attribute values given below.
+
+ If 'webServiceHost' is an empty string, JBossWS uses requesters host when
rewriting the <soap:address>.
-->
<property
name="webServiceHost">${jboss.bind.address}</property>
<property name="webServiceSecurePort">8443</property>
Modified: branches/tdiesler/trunk/src/test/ant/build-jars-jaxws.xml
===================================================================
--- branches/tdiesler/trunk/src/test/ant/build-jars-jaxws.xml 2006-11-20 19:11:07 UTC (rev
1474)
+++ branches/tdiesler/trunk/src/test/ant/build-jars-jaxws.xml 2006-11-20 22:22:10 UTC (rev
1475)
@@ -106,6 +106,13 @@
</fileset>
</jar>
+ <!-- jaxws-jbws1178 -->
+ <war destfile="${build.test.dir}/libs/jaxws-jbws1178.war"
webxml="${build.test.dir}/resources/jaxws/jbws1178/WEB-INF/web.xml">
+ <classes dir="${build.test.dir}/classes">
+ <include
name="org/jboss/test/ws/jaxws/jbws1178/TestEndpoint.class"/>
+ </classes>
+ </war>
+
<!-- jaxws-jsr181-complex -->
<war warfile="${build.test.dir}/libs/jaxws-jsr181-complex.war"
webxml="${build.test.dir}/resources/jaxws/jsr181/complex/WEB-INF/web.xml">
<classes dir="${build.test.dir}/classes">
Copied: branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178 (from rev
1149, branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/jbws1178)
Deleted:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCase.java
===================================================================
---
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCase.java 2006-10-05
20:45:43 UTC (rev 1149)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCase.java 2006-11-20
22:22:10 UTC (rev 1475)
@@ -1,100 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.test.ws.jaxws.jbws1178;
-
-import java.net.InetAddress;
-import java.net.URL;
-
-import javax.management.Attribute;
-import javax.management.ObjectName;
-import javax.xml.namespace.QName;
-import javax.xml.rpc.Service;
-import javax.xml.rpc.ServiceFactory;
-
-import junit.framework.Test;
-
-import org.jboss.test.ws.JBossWSTest;
-import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.jaxrpc.CallImpl;
-
-/**
- * Multiple virtual host and soap:address problem
- *
- *
http://jira.jboss.org/jira/browse/JBWS-1178
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 05-Oct-2006
- */
-public class JBWS1178TestCase extends JBossWSTest
-{
- String webServiceHost;
-
- public static Test suite()
- {
- return JBossWSTestSetup.newTestSetup(JBWS1178TestCase.class,
"jaxws-jbws1178.war");
- }
-
- public void setUp() throws Exception
- {
- ObjectName objectName = new
ObjectName("jboss.ws:service=ServiceEndpointManager");
- webServiceHost = (String)getServer().getAttribute(objectName,
"WebServiceHost");
- // Setting the WebServiceHost to an empty string, causes the request host to be
used
- getServer().setAttribute(objectName, new Attribute("WebServiceHost",
""));
- }
-
- public void tearDown() throws Exception
- {
- ObjectName objectName = new
ObjectName("jboss.ws:service=ServiceEndpointManager");
- getServer().setAttribute(objectName, new Attribute("WebServiceHost",
webServiceHost));
- }
-
- public void testHostAddress() throws Exception
- {
- InetAddress inetAddr = InetAddress.getByName(getServerHost());
- System.out.println(inetAddr.getHostAddress());
- URL wsdlURL = new URL("http://" + inetAddr.getHostAddress() +
":8080/jaxws-jbws1178?wsdl");
-
- ServiceFactory factory = ServiceFactory.newInstance();
- QName serviceName = new QName("http://org.jboss.ws/jbws1178",
"TestEndpointService");
- QName portName = new QName("http://org.jboss.ws/jbws1178",
"TestEndpointPort");
- Service service = factory.createService(wsdlURL, serviceName);
- CallImpl call = (CallImpl)service.createCall(portName);
- URL epURL = new URL(call.getEndpointMetaData().getEndpointAddress());
-
- assertEquals(wsdlURL.getHost(), epURL.getHost());
- }
-
- public void testHostName() throws Exception
- {
- InetAddress inetAddr = InetAddress.getByName(getServerHost());
- URL wsdlURL = new URL("http://" + inetAddr.getHostName() +
":8080/jaxws-jbws1178?wsdl");
-
- ServiceFactory factory = ServiceFactory.newInstance();
- QName serviceName = new QName("http://org.jboss.ws/jbws1178",
"TestEndpointService");
- QName portName = new QName("http://org.jboss.ws/jbws1178",
"TestEndpointPort");
- Service service = factory.createService(wsdlURL, serviceName);
- CallImpl call = (CallImpl)service.createCall(portName);
- URL epURL = new URL(call.getEndpointMetaData().getEndpointAddress());
-
- assertEquals(wsdlURL.getHost(), epURL.getHost());
- }
-}
Copied:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCase.java
(from rev 1149,
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCase.java)
===================================================================
---
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCase.java 2006-10-05
20:45:43 UTC (rev 1149)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/JBWS1178TestCase.java 2006-11-20
22:22:10 UTC (rev 1475)
@@ -0,0 +1,99 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jbws1178;
+
+import java.net.InetAddress;
+import java.net.URL;
+
+import javax.management.Attribute;
+import javax.management.ObjectName;
+import javax.xml.namespace.QName;
+import javax.xml.rpc.Service;
+import javax.xml.rpc.ServiceFactory;
+
+import junit.framework.Test;
+
+import org.jboss.test.ws.JBossWSTest;
+import org.jboss.test.ws.JBossWSTestSetup;
+import org.jboss.ws.jaxrpc.CallImpl;
+
+/**
+ * Multiple virtual host and soap:address problem
+ *
+ *
http://jira.jboss.org/jira/browse/JBWS-1178
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 05-Oct-2006
+ */
+public class JBWS1178TestCase extends JBossWSTest
+{
+ String webServiceHost;
+
+ public static Test suite()
+ {
+ return JBossWSTestSetup.newTestSetup(JBWS1178TestCase.class,
"jaxws-jbws1178.war");
+ }
+
+ public void setUp() throws Exception
+ {
+ ObjectName objectName = new
ObjectName("jboss.ws:service=ServiceEndpointManager");
+ webServiceHost = (String)getServer().getAttribute(objectName,
"WebServiceHost");
+ // Setting the WebServiceHost to an empty string, causes the request host to be
used
+ getServer().setAttribute(objectName, new Attribute("WebServiceHost",
""));
+ }
+
+ public void tearDown() throws Exception
+ {
+ ObjectName objectName = new
ObjectName("jboss.ws:service=ServiceEndpointManager");
+ getServer().setAttribute(objectName, new Attribute("WebServiceHost",
webServiceHost));
+ }
+
+ public void testHostAddress() throws Exception
+ {
+ InetAddress inetAddr = InetAddress.getByName(getServerHost());
+ URL wsdlURL = new URL("http://" + inetAddr.getHostAddress() +
":8080/jaxws-jbws1178?wsdl");
+
+ ServiceFactory factory = ServiceFactory.newInstance();
+ QName serviceName = new QName("http://org.jboss.ws/jbws1178",
"TestEndpointService");
+ QName portName = new QName("http://org.jboss.ws/jbws1178",
"TestEndpointPort");
+ Service service = factory.createService(wsdlURL, serviceName);
+ CallImpl call = (CallImpl)service.createCall(portName);
+ URL epURL = new URL(call.getEndpointMetaData().getEndpointAddress());
+
+ assertEquals(wsdlURL.getHost(), epURL.getHost());
+ }
+
+ public void testHostName() throws Exception
+ {
+ InetAddress inetAddr = InetAddress.getByName(getServerHost());
+ URL wsdlURL = new URL("http://" + inetAddr.getHostName() +
":8080/jaxws-jbws1178?wsdl");
+
+ ServiceFactory factory = ServiceFactory.newInstance();
+ QName serviceName = new QName("http://org.jboss.ws/jbws1178",
"TestEndpointService");
+ QName portName = new QName("http://org.jboss.ws/jbws1178",
"TestEndpointPort");
+ Service service = factory.createService(wsdlURL, serviceName);
+ CallImpl call = (CallImpl)service.createCall(portName);
+ URL epURL = new URL(call.getEndpointMetaData().getEndpointAddress());
+
+ assertEquals(wsdlURL.getHost(), epURL.getHost());
+ }
+}
Deleted:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/TestEndpoint.java
===================================================================
---
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/jbws1178/TestEndpoint.java 2006-10-05
20:45:43 UTC (rev 1149)
+++
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/TestEndpoint.java 2006-11-20
22:22:10 UTC (rev 1475)
@@ -1,37 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.test.ws.jaxws.jbws1178;
-
-import javax.jws.WebMethod;
-import javax.jws.WebService;
-import javax.jws.soap.SOAPBinding;
-
-@WebService(name = "TestEndpoint", targetNamespace =
"http://org.jboss.ws/jbws1178")
-@SOAPBinding(style = SOAPBinding.Style.RPC)
-public class TestEndpoint
-{
- @WebMethod
- public String echo(String input)
- {
- return input;
- }
-}
Copied:
branches/tdiesler/trunk/src/test/java/org/jboss/test/ws/jaxws/jbws1178/TestEndpoint.java
(from rev 1149,
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxws/jbws1178/TestEndpoint.java)
Copied: branches/tdiesler/trunk/src/test/resources/jaxws/jbws1178 (from rev 1149,
branches/jbossws-1.0/src/test/resources/jaxws/jbws1178)
Copied: branches/tdiesler/trunk/src/test/resources/jaxws/jbws1178/WEB-INF (from rev 1149,
branches/jbossws-1.0/src/test/resources/jaxws/jbws1178/WEB-INF)
Deleted: branches/tdiesler/trunk/src/test/resources/jaxws/jbws1178/WEB-INF/web.xml
===================================================================
--- branches/jbossws-1.0/src/test/resources/jaxws/jbws1178/WEB-INF/web.xml 2006-10-05
20:45:43 UTC (rev 1149)
+++ branches/tdiesler/trunk/src/test/resources/jaxws/jbws1178/WEB-INF/web.xml 2006-11-20
22:22:10 UTC (rev 1475)
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
-
- <servlet>
- <servlet-name>TestEndpoint</servlet-name>
-
<servlet-class>org.jboss.test.ws.jaxws.jbws1178.TestEndpoint</servlet-class>
- </servlet>
-
- <servlet-mapping>
- <servlet-name>TestEndpoint</servlet-name>
- <url-pattern>/*</url-pattern>
- </servlet-mapping>
-</web-app>
\ No newline at end of file
Copied: branches/tdiesler/trunk/src/test/resources/jaxws/jbws1178/WEB-INF/web.xml (from
rev 1149, branches/jbossws-1.0/src/test/resources/jaxws/jbws1178/WEB-INF/web.xml)
Modified: branches/tdiesler/trunk/version.properties
===================================================================
--- branches/tdiesler/trunk/version.properties 2006-11-20 19:11:07 UTC (rev 1474)
+++ branches/tdiesler/trunk/version.properties 2006-11-20 22:22:10 UTC (rev 1475)
@@ -5,7 +5,7 @@
specification.vendor=JBoss (
http://www.jboss.org)
specification.version=jbossws-2.0
-version.id=2.0.0.CR2.DEV
+version.id=2.0.0.CR3.DEV
repository.id=snapshot
implementation.title=JBoss Web Services (JBossWS)