JBossWS SVN: r5020 - in stack/native/branches/jbossws-native-2.0.1.CP: src/main/java/org/jboss/ws/core/jaxws/spi and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-11-09 05:13:26 -0500 (Fri, 09 Nov 2007)
New Revision: 5020
Modified:
stack/native/branches/jbossws-native-2.0.1.CP/src/main/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java
stack/native/branches/jbossws-native-2.0.1.CP/src/main/java/org/jboss/ws/core/utils/ThreadLocalAssociation.java
stack/native/branches/jbossws-native-2.0.1.CP/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java
stack/native/branches/jbossws-native-2.0.1.CP/version.properties
Log:
JBPAPP-407: DOMUtils doesn't clear thread locals
Modified: stack/native/branches/jbossws-native-2.0.1.CP/src/main/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.CP/src/main/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java 2007-11-09 09:35:28 UTC (rev 5019)
+++ stack/native/branches/jbossws-native-2.0.1.CP/src/main/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java 2007-11-09 10:13:26 UTC (rev 5020)
@@ -38,6 +38,7 @@
import javax.xml.ws.wsaddressing.W3CEndpointReference;
import org.jboss.util.NotImplementedException;
+import org.jboss.wsf.common.DOMUtils;
import org.w3c.dom.Element;
/**
@@ -59,6 +60,7 @@
public ServiceDelegate createServiceDelegate(URL wsdlLocation, QName serviceName, Class serviceClass)
{
ServiceDelegateImpl delegate = new ServiceDelegateImpl(wsdlLocation, serviceName, serviceClass);
+ DOMUtils.clearThreadLocals();
return delegate;
}
Modified: stack/native/branches/jbossws-native-2.0.1.CP/src/main/java/org/jboss/ws/core/utils/ThreadLocalAssociation.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.CP/src/main/java/org/jboss/ws/core/utils/ThreadLocalAssociation.java 2007-11-09 09:35:28 UTC (rev 5019)
+++ stack/native/branches/jbossws-native-2.0.1.CP/src/main/java/org/jboss/ws/core/utils/ThreadLocalAssociation.java 2007-11-09 10:13:26 UTC (rev 5020)
@@ -60,7 +60,7 @@
public static void clear()
{
- msgContextAssoc.set(null);
- strTransformAssoc.set(null);
+ msgContextAssoc.remove();
+ strTransformAssoc.remove();
}
}
Modified: stack/native/branches/jbossws-native-2.0.1.CP/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.CP/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java 2007-11-09 09:35:28 UTC (rev 5019)
+++ stack/native/branches/jbossws-native-2.0.1.CP/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java 2007-11-09 10:13:26 UTC (rev 5020)
@@ -91,6 +91,7 @@
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.common.DOMWriter;
+import org.jboss.wsf.common.DOMUtils;
import org.w3c.dom.Document;
/**
@@ -316,6 +317,7 @@
// clear thread local storage
ThreadLocalAssociation.clear();
+ DOMUtils.clearThreadLocals();
}
}
Modified: stack/native/branches/jbossws-native-2.0.1.CP/version.properties
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.CP/version.properties 2007-11-09 09:35:28 UTC (rev 5019)
+++ stack/native/branches/jbossws-native-2.0.1.CP/version.properties 2007-11-09 10:13:26 UTC (rev 5020)
@@ -25,7 +25,7 @@
# Dependend integration projects
jbossws-spi=1.0.0.GA
-jbossws-common=1.0.0.GA
+jbossws-common=1.0.2.GA
jbossws-framework=2.0.1.GA
jbossws-jboss40=2.0.1.GA
jbossws-jboss42=2.0.1.GA
17 years, 2 months
JBossWS SVN: r5019 - stack/native/branches/jbossws-native-2.0.1.CP/ant-import.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-11-09 04:35:28 -0500 (Fri, 09 Nov 2007)
New Revision: 5019
Modified:
stack/native/branches/jbossws-native-2.0.1.CP/ant-import/build-deploy.xml
stack/native/branches/jbossws-native-2.0.1.CP/ant-import/build-thirdparty.xml
Log:
Fix deploy-jboss42 for AS4.2.1
Modified: stack/native/branches/jbossws-native-2.0.1.CP/ant-import/build-deploy.xml
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.CP/ant-import/build-deploy.xml 2007-11-08 17:23:55 UTC (rev 5018)
+++ stack/native/branches/jbossws-native-2.0.1.CP/ant-import/build-deploy.xml 2007-11-09 09:35:28 UTC (rev 5019)
@@ -15,6 +15,9 @@
<import file="${core.dir}/ant-import/macros-deploy-framework.xml"/>
<import file="${core.dir}/ant-import/macros-deploy-native.xml"/>
+
+ <!-- Check availability of container integration -->
+ <available property="jbossws.jboss42.available" file="${jboss42.home}/server/${jboss.server.instance}/lib/jbossws-jboss42.jar"/>
<!-- ================================================================== -->
<!-- Deployment JBoss50 -->
@@ -48,7 +51,7 @@
</target>
<!-- Deploy jbossws to jboss42 -->
- <target name="deploy-jboss42" depends="jars-jboss42,undeploy-jboss42,deploy-jboss42-endorsed" description="Deploy jbossws to jboss42">
+ <target name="deploy-jboss42" depends="jars-jboss42,undeploy-jboss42,deploy-jboss42-endorsed, deploy-jboss421" description="Deploy jbossws to jboss42">
<macro-deploy-native42
stacklibs="${core.dir}/output/lib"
thirdpartylibs="${core.dir}/thirdparty"/>
@@ -64,6 +67,12 @@
thirdpartylibs="${core.dir}/thirdparty"/>
</target>
+ <!-- Container integration is not contained in the jbossws.sar -->
+ <target name="deploy-jboss421" depends="prepare" unless="jbossws.jboss42.available">
+ <copy file="${thirdparty.dir}/jbossws-jboss421.jar" tofile="${jboss42.home}/server/${jboss.server.instance}/lib/jbossws-jboss42.jar"/>
+ <copy file="${thirdparty.dir}/jbossws-jboss421.jar" tofile="${jboss42.home}/client/jbossws-jboss42.jar"/>
+ </target>
+
<!-- Remove jbossws from jboss42 -->
<target name="undeploy-jboss42" depends="prepare,undeploy-jboss42-endorsed" description="Remove jbossws from jboss42">
<macro-undeploy-native42/>
Modified: stack/native/branches/jbossws-native-2.0.1.CP/ant-import/build-thirdparty.xml
===================================================================
--- stack/native/branches/jbossws-native-2.0.1.CP/ant-import/build-thirdparty.xml 2007-11-08 17:23:55 UTC (rev 5018)
+++ stack/native/branches/jbossws-native-2.0.1.CP/ant-import/build-thirdparty.xml 2007-11-09 09:35:28 UTC (rev 5019)
@@ -56,6 +56,7 @@
<get src="${jboss.repository}/jboss/jbossws-jboss40/${jbossws-jboss40}/lib/jbossws-jboss40.jar" dest="${thirdparty.dir}/jbossws-jboss40.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/jboss/jbossws-jboss40/${jbossws-jboss40}/lib/jbossws-jboss40-resources.zip" dest="${thirdparty.dir}/jbossws-jboss40-resources.zip" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/jboss/jbossws-jboss40/${jbossws-jboss40}/lib/jbossws-jboss40-src.zip" dest="${thirdparty.dir}/jbossws-jboss40-src.zip" usetimestamp="true" verbose="true"/>
+ <get src="${jboss.repository}/jboss/jbossws-jboss42/${jbossws-jboss42}/lib/jbossws-jboss42.jar" dest="${thirdparty.dir}/jbossws-jboss421.jar" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/jboss/jbossws-jboss42/${jbossws-jboss42}/lib/jbossws-jboss42-resources.zip" dest="${thirdparty.dir}/jbossws-jboss42-resources.zip" usetimestamp="true" verbose="true"/>
<get src="${jboss.repository}/apache-ant/${apache-ant}/lib/ant.jar" dest="${thirdparty.dir}/ant.jar" usetimestamp="true" verbose="true"/>
17 years, 2 months
JBossWS SVN: r5018 - stack/native/branches/jbossws-native-2.0.2.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-11-08 12:23:55 -0500 (Thu, 08 Nov 2007)
New Revision: 5018
Modified:
stack/native/branches/jbossws-native-2.0.2/version.properties
Log:
Update to common 1.0.2.GA
Modified: stack/native/branches/jbossws-native-2.0.2/version.properties
===================================================================
--- stack/native/branches/jbossws-native-2.0.2/version.properties 2007-11-08 16:34:07 UTC (rev 5017)
+++ stack/native/branches/jbossws-native-2.0.2/version.properties 2007-11-08 17:23:55 UTC (rev 5018)
@@ -25,7 +25,7 @@
# Dependend integration projects
jbossws-spi=1.0.0.GA
-jbossws-common=snapshot
+jbossws-common=1.0.2.GA
jbossws-framework=2.0.2.GA
jbossws-jboss40=2.0.2.GA
jbossws-jboss42=2.0.1.GA
17 years, 2 months
JBossWS SVN: r5017 - in stack/native/trunk: src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator and 14 other directories.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2007-11-08 11:34:07 -0500 (Thu, 08 Nov 2007)
New Revision: 5017
Added:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/config/
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/config/ObjectFactory.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/config/Request.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/config/RequestImpl.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/config/Response.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/config/ResponseImpl.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/config/View.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/config/ViewImpl.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/utils/
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/utils/StringUtil.java
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/common/
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/common/resources/
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/common/resources/createSequenceResponse.xml
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/common/resources/sequenceAckResponse.xml
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/common/resources/terminateSequenceResponse.xml
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/oneway/
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/oneway/WEB-INF/
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/oneway/WEB-INF/web.xml
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/oneway/config/
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/oneway/config/one-way-service-config.xml
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/oneway/resources/
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/oneway/resources/OneWayService.wsdl
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/reqres/
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/reqres/WEB-INF/
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/reqres/WEB-INF/web.xml
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/reqres/config/
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/reqres/config/req-res-service-config.xml
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/reqres/resources/
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/reqres/resources/ReqResService.wsdl
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/reqres/resources/echoResponse.xml
Removed:
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/WEB-INF/
stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/resources/
Modified:
stack/native/trunk/ant-import-tests/build-jars-jaxws.xml
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/EndpointEmulator.java
stack/native/trunk/src/test/resources/jaxws/wsrm/properties/OneWayTestCase.properties
stack/native/trunk/src/test/resources/jaxws/wsrm/properties/ReqResTestCase.properties
Log:
removing hardcoded emulator and replacing it with the first prototype following the MVC arch. pattern
Modified: stack/native/trunk/ant-import-tests/build-jars-jaxws.xml
===================================================================
--- stack/native/trunk/ant-import-tests/build-jars-jaxws.xml 2007-11-08 14:50:41 UTC (rev 5016)
+++ stack/native/trunk/ant-import-tests/build-jars-jaxws.xml 2007-11-08 16:34:07 UTC (rev 5017)
@@ -646,16 +646,26 @@
</webinf>
</war>
- <war warfile="${tests.output.dir}/libs/jaxws-wsrm-emulator.war"
- webxml="${tests.output.dir}/resources/jaxws/wsrm/emulator/WEB-INF/web.xml">
+ <war warfile="${tests.output.dir}/libs/jaxws-wsrm-one-way-emulator.war"
+ webxml="${tests.output.dir}/resources/jaxws/wsrm/emulator/oneway/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/classes">
<include name="org/jboss/test/ws/jaxws/wsrm/emulator/**/*.class"/>
</classes>
- <webinf dir="${tests.output.dir}/resources/jaxws/wsrm/emulator">
- <include name="resources/"/>
- </webinf>
+ <zipfileset dir="${tests.output.dir}/resources/jaxws/wsrm/emulator/oneway/config" prefix="config"/>
+ <zipfileset dir="${tests.output.dir}/resources/jaxws/wsrm/emulator/oneway/resources" prefix="resources"/>
+ <zipfileset dir="${tests.output.dir}/resources/jaxws/wsrm/emulator/common/resources" prefix="resources"/>
</war>
+ <war warfile="${tests.output.dir}/libs/jaxws-wsrm-req-res-emulator.war"
+ webxml="${tests.output.dir}/resources/jaxws/wsrm/emulator/reqres/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/classes">
+ <include name="org/jboss/test/ws/jaxws/wsrm/emulator/**/*.class"/>
+ </classes>
+ <zipfileset dir="${tests.output.dir}/resources/jaxws/wsrm/emulator/reqres/config" prefix="config"/>
+ <zipfileset dir="${tests.output.dir}/resources/jaxws/wsrm/emulator/reqres/resources" prefix="resources"/>
+ <zipfileset dir="${tests.output.dir}/resources/jaxws/wsrm/emulator/common/resources" prefix="resources"/>
+ </war>
+
<jar jarfile="${tests.output.dir}/libs/jaxws-wsrm-client.jar">
<metainf dir="${tests.output.dir}/resources/jaxws/wsrm/META-INF">
<include name="wsrm-jaxws-client-config.xml"/>
Modified: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/EndpointEmulator.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/EndpointEmulator.java 2007-11-08 14:50:41 UTC (rev 5016)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/EndpointEmulator.java 2007-11-08 16:34:07 UTC (rev 5017)
@@ -27,25 +27,33 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
-import java.io.StringReader;
import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
import java.util.Map;
-import java.util.Properties;
-import java.util.Random;
+import java.util.StringTokenizer;
+import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import javax.xml.parsers.DocumentBuilder;
+import javax.xml.namespace.QName;
import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import org.jboss.test.ws.jaxws.wsrm.emulator.config.ObjectFactory;
+import org.jboss.test.ws.jaxws.wsrm.emulator.config.View;
+import org.jboss.test.ws.jaxws.wsrm.emulator.utils.StringUtil;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
+import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
/**
- * Endpoint emulator
+ * This class represents Controller part of the MVC architectural pattern
*
* @author richard.opalka(a)jboss.com
*
@@ -53,143 +61,248 @@
*/
public class EndpointEmulator extends HttpServlet
{
- private static final String ADDR_NS = "http://www.w3.org/2005/08/addressing";
- private static final String WSRM_NS = "http://docs.oasis-open.org/ws-rx/wsrm/200702";
- private static final Map<String, String> wsrmActions = new HashMap<String, String>();
- private static final String CREATE_SEQUENCE_ACTION = WSRM_NS + "/CreateSequence";
- private static final String CREATE_SEQUENCE_RESPONSE_ACTION = WSRM_NS + "/CreateSequenceResponse";
- private static final String CLOSE_SEQUENCE_ACTION = WSRM_NS + "/CloseSequence";
- private static final String CLOSE_SEQUENCE_RESPONSE_ACTION = WSRM_NS + "/CloseSequenceResponse";
- private static final String TERMINATE_SEQUENCE_ACTION = WSRM_NS + "/TerminateSequence";
- private static final String TERMINATE_SEQUENCE_RESPONSE_ACTION = WSRM_NS + "/TerminateSequenceResponse";
- private static final Random generator = new Random();
- static
+ private static final String CONFIG_FILE = "config.file";
+ private List<View> views;
+
+ @Override
+ public void init(ServletConfig config) throws ServletException
{
- wsrmActions.put(CREATE_SEQUENCE_ACTION, CREATE_SEQUENCE_RESPONSE_ACTION);
- wsrmActions.put(CLOSE_SEQUENCE_ACTION, CLOSE_SEQUENCE_RESPONSE_ACTION);
- wsrmActions.put(TERMINATE_SEQUENCE_ACTION, TERMINATE_SEQUENCE_RESPONSE_ACTION);
+ super.init(config);
+
+ // ensure there's a config.file servlet init parameter specified in web.xml
+ String configFile = config.getInitParameter(CONFIG_FILE);
+ if (configFile == null)
+ throw new RuntimeException(CONFIG_FILE + " init parameter is missing");
+
+ // ensure this config.file points to correct resource inside war archive
+ InputStream is = config.getServletContext().getResourceAsStream(configFile);
+ if (is == null)
+ throw new RuntimeException("Resource '" + configFile + "' not found");
+
+ Element root = getDocument(is, false).getDocumentElement();
+ views = getViews(root, getNamespaces(root));
+
+ System.out.println(views);
}
@Override
+ protected void doPost(HttpServletRequest req, HttpServletResponse resp)
+ throws ServletException, IOException
+ {
+ handleRequest("POST", req, resp);
+ }
+
+ @Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException
{
- String pathInfo = req.getPathInfo();
- System.out.println(pathInfo);
- resp.setContentType("text/xml");
- PrintWriter writer = resp.getWriter();
- if (pathInfo.equals("/OneWayService"))
+ handleRequest("GET", req, resp);
+ }
+
+ private static Document getDocument(InputStream is, boolean nsAware) throws ServletException
+ {
+ try
{
- writer.print(getResource("WEB-INF/resources/OneWayService.wsdl"));
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ factory.setNamespaceAware(nsAware);
+ return factory.newDocumentBuilder().parse(is);
}
- else
+ catch (SAXException se)
{
- writer.print(getResource("WEB-INF/resources/ReqResService.wsdl"));
+ throw new ServletException(se);
}
- writer.flush();
- writer.close();
+ catch (ParserConfigurationException pce)
+ {
+ throw new ServletException(pce);
+ }
+ catch (IOException ie)
+ {
+ throw new ServletException(ie);
+ }
}
+
+ private static Map<String, String> getNamespaces(Element root)
+ {
+ NodeList namespaces = ((Element)root.getElementsByTagName("namespaces").item(0)).getElementsByTagName("namespace");
+ Map<String, String> retVal = new HashMap<String, String>();
+ for (int i = 0; i < namespaces.getLength(); i++)
+ {
+ Element namespace = (Element)namespaces.item(i);
+ retVal.put(namespace.getAttribute("name"), namespace.getAttribute("value"));
+ }
+ return retVal;
+ }
- @Override
- protected void doPost(HttpServletRequest req, HttpServletResponse resp)
+ private static List<View> getViews(Element root, Map<String, String> namespaces)
+ {
+ List<View> retVal = new LinkedList<View>();
+ NodeList views = root.getElementsByTagName("view");
+ for (int i = 0; i < views.getLength(); i++)
+ {
+ retVal.add(ObjectFactory.getView((Element)views.item(i), namespaces));
+ }
+ return retVal;
+ }
+
+ private void handleRequest(String httpMethod, HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException
{
- resp.setContentType("text/xml");
+ String requestMessage = getRequestMessage(req);
+ View view = getView(httpMethod, requestMessage);
+ System.out.println("Handling view: " + view.getId());
+ Map<String, String> resProperties = view.getResponse().getProperties();
+ Map<String, String> reqProperties = view.getRequest().getProperties();
+ String responseMessage = getResource(view.getResponse().getResource());
+
+ if (resProperties.size() > 0)
+ {
+ Map<String, String> initializedReqProperties = null;
+ if (reqProperties.size() > 0)
+ {
+ initializedReqProperties = initializeProperties(requestMessage, reqProperties);
+ }
+
+ Map<String, String> replaceMap = replaceProperties(initializedReqProperties, resProperties);
+ responseMessage = modifyResponse(responseMessage, replaceMap);
+ }
+
+ resp.setContentType(view.getResponse().getContentType());
PrintWriter writer = resp.getWriter();
- Properties properties = getProperties(getRequestMessage(req));
- String response = getResource("WEB-INF/resources/echoResponse.xml");
- if (properties.get("addressing.action").equals(CREATE_SEQUENCE_ACTION))
- response = getResource("WEB-INF/resources/createSequenceResponse.xml");
- if (properties.get("addressing.action").equals(TERMINATE_SEQUENCE_ACTION))
- response = getResource("WEB-INF/resources/terminateSequenceResponse.xml");
- response = modifyResponse(response, properties);
- writer.print(response);
+ writer.print(responseMessage);
writer.flush();
writer.close();
}
- private String modifyResponse(String response, Properties props)
+ private Map<String, String> initializeProperties(String req, Map<String, String> map)
+ throws ServletException, IOException
{
- response = replace("${addressing.to}", props.getProperty("addressing.replyto"), response);
- response = replace("${addressing.relatesto}", props.getProperty("addressing.messageid"), response);
- String action = props.getProperty("addressing.action");
- if (wsrmActions.containsKey(action))
+ Document requestMessage = getDocument(new ByteArrayInputStream(req.getBytes()), true);
+
+ Map<String, String> retVal = new HashMap<String, String>();
+ for (Iterator<String> i = map.keySet().iterator(); i.hasNext(); )
{
- if (action.equals(CREATE_SEQUENCE_ACTION))
+ String key = i.next();
+ String val = map.get(key);
+ Element e = getElement(requestMessage, val);
+ retVal.put(key, e.getTextContent());
+ }
+
+ return retVal;
+ }
+
+ private static Map<String, String> replaceProperties(Map<String, String> reqM, Map<String, String> resM)
+ {
+ Map<String, String> retVal = new HashMap<String, String>();
+
+ for (Iterator<String> i = resM.keySet().iterator(); i.hasNext(); )
+ {
+ String iKey = i.next();
+ String iVal = resM.get(iKey);
+ for (Iterator<String> j = reqM.keySet().iterator(); j.hasNext(); )
{
- String sequenceId = "http://wsrm.emulator.jboss/sequence/generated/" + generator.nextInt(Integer.MAX_VALUE);
- response = replace("${messaging.identifier}", sequenceId, response);
+ String jKey = j.next();
+ String jVal = reqM.get(jKey);
+ String jRef = "${" + jKey + "}";
+ if (iVal.indexOf(jRef) != -1)
+ {
+ iVal = StringUtil.replace(jRef, jVal, iVal);
+ }
}
- action = wsrmActions.get(action);
+ retVal.put(iKey, iVal);
}
- response = replace("${messaging.identifier}", props.getProperty("messaging.identifier"), response);
- response = replace("${messaging.upper}", props.getProperty("messaging.messagenumber"), response);
- response = replace("${messaging.lower}", props.getProperty("messaging.messagenumber"), response);
- response = replace("${addressing.action}", action, response);
- return response;
+
+ return retVal;
}
- private static String replace(String oldString, String newString, String data)
+ private View getView(String httpMethod, String req)
+ throws ServletException, IOException
{
- int fromIndex = 0;
- int index = 0;
- StringBuffer result = new StringBuffer();
+ boolean isPost = "POST".equalsIgnoreCase(httpMethod);
+ Document requestMessage = isPost ? getDocument(new ByteArrayInputStream(req.getBytes()), true) : null;
+ for (View view : views)
+ {
+ if (httpMethod.equalsIgnoreCase(view.getRequest().getHttpMethod()))
+ {
+ if (matches(requestMessage, view))
+ {
+ return view;
+ }
+ }
+ }
- while ((index = data.indexOf(oldString, fromIndex)) >= 0)
+ return null;
+ }
+
+ private static boolean matches(Document req, View view)
+ {
+ List<String> matches = view.getRequest().getMatches();
+ if ((matches == null) || (matches.size() == 0))
+ return true;
+
+ boolean match = true;
+ for (String matchString : matches)
{
- result.append(data.substring(fromIndex, index));
- result.append(newString);
- fromIndex = index + oldString.length();
+ match = match && elementExists(req, matchString);
}
- result.append(data.substring(fromIndex));
- return result.toString();
+
+ return match;
}
- private Properties getProperties(String message) throws IOException
+ private static boolean elementExists(Document req, String match)
{
- try
+ return getElement(req, match) != null;
+ }
+
+ private static Element getElement(Document req, String match)
+ {
+ Element e = null;
+
+ StringTokenizer st = new StringTokenizer(match, "|");
+ while (st.hasMoreTokens())
{
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- factory.setNamespaceAware(true);
- DocumentBuilder builder = factory.newDocumentBuilder();
- Document document = builder.parse(new ByteArrayInputStream(message.getBytes()));
- Properties retVal = new Properties();
- String to = document.getElementsByTagNameNS(ADDR_NS, "To").item(0).getTextContent().trim();
- retVal.put("addressing.to", to);
- String messageId = document.getElementsByTagNameNS(ADDR_NS, "MessageID").item(0).getTextContent().trim();
- retVal.put("addressing.messageid", messageId);
- String action = document.getElementsByTagNameNS(ADDR_NS, "Action").item(0).getTextContent().trim();
- retVal.put("addressing.action", action);
- String replyTo = ((Element)document.getElementsByTagNameNS(ADDR_NS, "ReplyTo").item(0))
- .getElementsByTagNameNS(ADDR_NS, "Address").item(0).getTextContent().trim();
- retVal.put("addressing.replyto", replyTo);
- NodeList sequence = document.getElementsByTagNameNS(WSRM_NS, "Sequence");
- if (sequence != null && sequence.getLength() != 0)
+ String toConvert = st.nextToken();
+ QName nodeName = QName.valueOf(toConvert);
+ e = getChildElement(e != null ? e : req, nodeName);
+ if (e == null) return null;
+ }
+
+ return e;
+ }
+
+ private static Element getChildElement(Node e, QName nodeQName)
+ {
+ NodeList childNodes = e.getChildNodes();
+ if (childNodes == null)
+ return null;
+
+ for (int i = 0; i < childNodes.getLength(); i++)
+ {
+ Node node = childNodes.item(i);
+ if (node.getNodeType() == Node.ELEMENT_NODE)
{
- String sequenceId = ((Element)sequence.item(0))
- .getElementsByTagNameNS(WSRM_NS, "Identifier").item(0).getTextContent().trim();
- retVal.put("messaging.identifier", replyTo);
- String messageNumber = ((Element)sequence.item(0))
- .getElementsByTagNameNS(WSRM_NS, "MessageNumber").item(0).getTextContent().trim();
- retVal.put("messaging.messagenumber", messageNumber);
+ Element element = (Element)node;
+ boolean namespaceMatches = nodeQName.getNamespaceURI().equals(element.getNamespaceURI());
+ boolean nodeNameMatches = nodeQName.getLocalPart().equals(element.getLocalName());
+ if (namespaceMatches && nodeNameMatches) return element;
}
- NodeList terminateSequence = document.getElementsByTagNameNS(WSRM_NS, "TerminateSequence");
- if (terminateSequence != null && terminateSequence.getLength() != 0)
+ }
+
+ return null;
+ }
+
+ private String modifyResponse(String response, Map<String, String> replaceMap)
+ {
+ if ((replaceMap != null) && (replaceMap.size() > 0))
+ {
+ for (Iterator<String> iterator = replaceMap.keySet().iterator(); iterator.hasNext(); )
{
- String sequenceId = ((Element)terminateSequence.item(0))
- .getElementsByTagNameNS(WSRM_NS, "Identifier").item(0).getTextContent().trim();
- retVal.put("messaging.identifier", sequenceId);
+ String key = iterator.next();
+ String val = replaceMap.get(key);
+ response = StringUtil.replace("${" + key + "}", val, response);
}
-
- System.out.println("Properties from message: " + retVal);
- return retVal;
}
- catch (Exception e)
- {
- e.printStackTrace();
- throw new IOException(e.getMessage());
- }
+ return response;
}
private String getResource(String resource) throws IOException
@@ -220,5 +333,5 @@
}
return baos.toString();
}
-
+
}
\ No newline at end of file
Added: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/config/ObjectFactory.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/config/ObjectFactory.java (rev 0)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/config/ObjectFactory.java 2007-11-08 16:34:07 UTC (rev 5017)
@@ -0,0 +1,58 @@
+/*
+ * 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.wsrm.emulator.config;
+
+import java.util.Map;
+
+import org.w3c.dom.Element;
+
+/**
+ * TODO: Add comment
+ *
+ * @author richard.opalka(a)jboss.com
+ *
+ * @since Nov 7, 2007
+ */
+public final class ObjectFactory
+{
+
+ private ObjectFactory()
+ {
+ // no instances
+ }
+
+ public static View getView(Element e, Map<String, String> namespaces)
+ {
+ return new ViewImpl(e, namespaces);
+ }
+
+ public static Request getRequest(Element e, Map<String, String> namespaces)
+ {
+ return new RequestImpl(e, namespaces);
+ }
+
+ public static Response getResponse(Element e, Map<String, String> namespaces)
+ {
+ return new ResponseImpl(e, namespaces);
+ }
+
+}
Property changes on: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/config/ObjectFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/config/Request.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/config/Request.java (rev 0)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/config/Request.java 2007-11-08 16:34:07 UTC (rev 5017)
@@ -0,0 +1,40 @@
+/*
+ * 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.wsrm.emulator.config;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * TODO: Add comment
+ *
+ * @author richard.opalka(a)jboss.com
+ *
+ * @since Nov 7, 2007
+ */
+public interface Request
+{
+ String getHttpMethod();
+ String getPathInfo();
+ List<String> getMatches();
+ Map<String, String> getProperties();
+}
Property changes on: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/config/Request.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/config/RequestImpl.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/config/RequestImpl.java (rev 0)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/config/RequestImpl.java 2007-11-08 16:34:07 UTC (rev 5017)
@@ -0,0 +1,129 @@
+/*
+ * 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.wsrm.emulator.config;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import org.jboss.test.ws.jaxws.wsrm.emulator.utils.StringUtil;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+/**
+ * TODO: Add comment
+ *
+ * @author richard.opalka(a)jboss.com
+ *
+ * @since Nov 7, 2007
+ */
+final class RequestImpl implements Request
+{
+
+ private final String httpMethod;
+ private final String pathInfo;
+ private final Map<String, String> properties;
+ private final List<String> matches;
+
+ RequestImpl(Element e, Map<String, String> namespaces)
+ {
+ this.httpMethod = e.getAttribute("httpMethod");
+ this.pathInfo = e.getAttribute("pathInfo");
+ NodeList contains = e.getElementsByTagName("contains");
+ if ((contains != null) && (contains.getLength() == 1))
+ {
+ NodeList nodes = ((Element)contains.item(0)).getElementsByTagName("node");
+ List<String> toFill = new LinkedList<String>();
+ this.matches = Collections.unmodifiableList(toFill);
+ for (int i = 0; i < nodes.getLength(); i++)
+ {
+ toFill.add(replace(((Element)nodes.item(i)).getAttribute("name"), namespaces));
+ }
+ }
+ else
+ {
+ this.matches = Collections.emptyList();
+ }
+ NodeList setNodes = e.getElementsByTagName("set");
+ if ((setNodes != null) && (setNodes.getLength() > 0))
+ {
+ Map<String, String> toFill = new HashMap<String, String>();
+ this.properties = Collections.unmodifiableMap(toFill);
+ for (int i = 0; i < setNodes.getLength(); i++)
+ {
+ String key = ((Element)setNodes.item(i)).getAttribute("property");
+ String val = ((Element)setNodes.item(i)).getAttribute("value");
+ toFill.put(key, replace(val, namespaces));
+ }
+ }
+ else
+ {
+ this.properties = Collections.emptyMap();
+ }
+ }
+
+ private static String replace(String s, Map<String, String> namespaces)
+ {
+ for (Iterator<String> i = namespaces.keySet().iterator(); i.hasNext(); )
+ {
+ String key = i.next();
+ String val = namespaces.get(key);
+ s = StringUtil.replace("${" + key + "}", val, s);
+ }
+ return s;
+ }
+
+ public String getHttpMethod()
+ {
+ return this.httpMethod;
+ }
+
+ public List<String> getMatches()
+ {
+ return this.matches;
+ }
+
+ public String getPathInfo()
+ {
+ return this.pathInfo;
+ }
+
+ public Map<String, String> getProperties()
+ {
+ return this.properties;
+ }
+
+ public String toString()
+ {
+ StringBuilder sb = new StringBuilder();
+ sb.append("REQUEST {");
+ sb.append("httpMethod=" + this.httpMethod + ", ");
+ sb.append("pathInfo=" + this.pathInfo + ", ");
+ sb.append("properties=" + this.properties + ", ");
+ sb.append("matches=" + this.matches + "}");
+ return sb.toString();
+ }
+
+}
Property changes on: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/config/RequestImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/config/Response.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/config/Response.java (rev 0)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/config/Response.java 2007-11-08 16:34:07 UTC (rev 5017)
@@ -0,0 +1,39 @@
+/*
+ * 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.wsrm.emulator.config;
+
+import java.util.Map;
+
+/**
+ * TODO: Add comment
+ *
+ * @author richard.opalka(a)jboss.com
+ *
+ * @since Nov 7, 2007
+ */
+public interface Response
+{
+ String getContentType();
+ String getStatusCode();
+ String getResource();
+ Map<String, String> getProperties();
+}
Property changes on: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/config/Response.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/config/ResponseImpl.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/config/ResponseImpl.java (rev 0)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/config/ResponseImpl.java 2007-11-08 16:34:07 UTC (rev 5017)
@@ -0,0 +1,113 @@
+/*
+ * 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.wsrm.emulator.config;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.jboss.test.ws.jaxws.wsrm.emulator.utils.StringUtil;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+/**
+ * TODO: Add comment
+ *
+ * @author richard.opalka(a)jboss.com
+ *
+ * @since Nov 7, 2007
+ */
+final class ResponseImpl implements Response
+{
+
+ private final String resource;
+ private final String statusCode;
+ private final String contentType;
+ private final Map<String, String> properties;
+
+ ResponseImpl(Element e, Map<String, String> namespaces)
+ {
+ this.resource = e.getAttribute("resource");
+ this.statusCode = e.getAttribute("statusCode");
+ this.contentType = e.getAttribute("contentType");
+ NodeList setNodes = e.getElementsByTagName("set");
+ if ((setNodes != null) && (setNodes.getLength() > 0))
+ {
+ Map<String, String> toFill = new HashMap<String, String>();
+ this.properties = Collections.unmodifiableMap(toFill);
+ for (int i = 0; i < setNodes.getLength(); i++)
+ {
+ String key = ((Element)setNodes.item(i)).getAttribute("property");
+ String val = ((Element)setNodes.item(i)).getAttribute("value");
+ toFill.put(key, replace(val, namespaces));
+ }
+ }
+ else
+ {
+ this.properties = Collections.emptyMap();
+ }
+ }
+
+ private static String replace(String s, Map<String, String> namespaces)
+ {
+ for (Iterator<String> i = namespaces.keySet().iterator(); i.hasNext(); )
+ {
+ String key = i.next();
+ String val = namespaces.get(key);
+ s = StringUtil.replace("${" + key + "}", val, s);
+ }
+ return s;
+ }
+
+ public String getContentType()
+ {
+ return this.contentType;
+ }
+
+ public Map<String, String> getProperties()
+ {
+ return this.properties;
+ }
+
+ public String getResource()
+ {
+ return this.resource;
+ }
+
+ public String getStatusCode()
+ {
+ return this.statusCode;
+ }
+
+ public String toString()
+ {
+ StringBuilder sb = new StringBuilder();
+ sb.append("RESPONSE {");
+ sb.append("resource=" + this.resource + ", ");
+ sb.append("statusCode=" + this.statusCode + ", ");
+ sb.append("contentType=" + this.contentType + ", ");
+ sb.append("properties=" + this.properties + "}");
+ return sb.toString();
+ }
+
+}
Property changes on: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/config/ResponseImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/config/View.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/config/View.java (rev 0)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/config/View.java 2007-11-08 16:34:07 UTC (rev 5017)
@@ -0,0 +1,36 @@
+/*
+ * 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.wsrm.emulator.config;
+
+/**
+ * TODO: Add comment
+ *
+ * @author richard.opalka(a)jboss.com
+ *
+ * @since Nov 7, 2007
+ */
+public interface View
+{
+ String getId();
+ Request getRequest();
+ Response getResponse();
+}
Property changes on: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/config/View.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/config/ViewImpl.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/config/ViewImpl.java (rev 0)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/config/ViewImpl.java 2007-11-08 16:34:07 UTC (rev 5017)
@@ -0,0 +1,77 @@
+/*
+ * 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.wsrm.emulator.config;
+
+import java.util.Map;
+
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+/**
+ * TODO: Add comment
+ *
+ * @author richard.opalka(a)jboss.com
+ *
+ * @since Nov 7, 2007
+ */
+final class ViewImpl implements View
+{
+
+ private final String id;
+ private final Request req;
+ private final Response res;
+
+ ViewImpl(Element e, Map<String, String> namespaces)
+ {
+ this.id = e.getAttribute("id");
+ NodeList response = e.getElementsByTagName("response");
+ this.res = (response == null) ? null : ObjectFactory.getResponse((Element)response.item(0), namespaces);
+ NodeList request = e.getElementsByTagName("request");
+ this.req = (request == null) ? null : ObjectFactory.getRequest((Element)request.item(0), namespaces);
+ }
+
+ public String getId()
+ {
+ return this.id;
+ }
+
+ public Request getRequest()
+ {
+ return this.req;
+ }
+
+ public Response getResponse()
+ {
+ return this.res;
+ }
+
+ public String toString()
+ {
+ StringBuilder sb = new StringBuilder();
+ sb.append("VIEW {");
+ sb.append("id=" + id + ", ");
+ sb.append("request=" + req + ", ");
+ sb.append("response=" + res + "}");
+ return sb.toString();
+ }
+
+}
Property changes on: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/config/ViewImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/utils/StringUtil.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/utils/StringUtil.java (rev 0)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/utils/StringUtil.java 2007-11-08 16:34:07 UTC (rev 5017)
@@ -0,0 +1,54 @@
+/*
+ * 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.wsrm.emulator.utils;
+
+/**
+ * TODO: Add comment
+ *
+ * @author richard.opalka(a)jboss.com
+ *
+ * @since Nov 7, 2007
+ */
+public final class StringUtil
+{
+ private StringUtil()
+ {
+
+ }
+
+ public static String replace(String oldString, String newString, String data)
+ {
+ int fromIndex = 0;
+ int index = 0;
+ StringBuffer result = new StringBuffer();
+
+ while ((index = data.indexOf(oldString, fromIndex)) >= 0)
+ {
+ result.append(data.substring(fromIndex, index));
+ result.append(newString);
+ fromIndex = index + oldString.length();
+ }
+ result.append(data.substring(fromIndex));
+ return result.toString();
+ }
+
+}
Property changes on: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/wsrm/emulator/utils/StringUtil.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/common/resources/createSequenceResponse.xml
===================================================================
--- stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/common/resources/createSequenceResponse.xml (rev 0)
+++ stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/common/resources/createSequenceResponse.xml 2007-11-08 16:34:07 UTC (rev 5017)
@@ -0,0 +1,15 @@
+<env:Envelope
+ xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'
+ xmlns:wsrm11='http://docs.oasis-open.org/ws-rx/wsrm/200702'
+ xmlns:wsa='http://www.w3.org/2005/08/addressing'>
+ <env:Header>
+ <wsa:To env:mustUnderstand="1">${res.wsa.to}</wsa:To>
+ <wsa:RelatesTo>${res.wsa.relatesto}</wsa:RelatesTo>
+ <wsa:Action env:mustUnderstand="1">${res.wsa.action}</wsa:Action>
+ </env:Header>
+ <env:Body>
+ <wsrm11:CreateSequenceResponse>
+ <wsrm11:Identifier>${res.wsrm.sequenceid}</wsrm11:Identifier>
+ </wsrm11:CreateSequenceResponse>
+ </env:Body>
+</env:Envelope>
Property changes on: stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/common/resources/createSequenceResponse.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/common/resources/sequenceAckResponse.xml
===================================================================
--- stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/common/resources/sequenceAckResponse.xml (rev 0)
+++ stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/common/resources/sequenceAckResponse.xml 2007-11-08 16:34:07 UTC (rev 5017)
@@ -0,0 +1,15 @@
+<env:Envelope
+ xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'
+ xmlns:wsrm11='http://docs.oasis-open.org/ws-rx/wsrm/200702'
+ xmlns:wsa='http://www.w3.org/2005/08/addressing'>
+ <env:Header>
+ <wsa:To env:mustUnderstand="1">${res.wsa.to}</wsa:To>
+ <wsa:RelatesTo>${res.wsa.relatesto}</wsa:RelatesTo>
+ <wsa:Action env:mustUnderstand="1">${res.wsa.action}</wsa:Action>
+ <wsrm11:SequenceAcknowledgement>
+ <wsrm11:Identifier>${res.wsrm.sequenceid}</wsrm11:Identifier>
+ <wsrm11:AcknowledgementRange Lower="${res.wsrm.ack.lower}" Upper="${res.wsrm.ack.upper}"/>
+ </wsrm11:SequenceAcknowledgement>
+ </env:Header>
+ <env:Body/>
+</env:Envelope>
Property changes on: stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/common/resources/sequenceAckResponse.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/common/resources/terminateSequenceResponse.xml
===================================================================
--- stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/common/resources/terminateSequenceResponse.xml (rev 0)
+++ stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/common/resources/terminateSequenceResponse.xml 2007-11-08 16:34:07 UTC (rev 5017)
@@ -0,0 +1,15 @@
+<env:Envelope
+ xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'
+ xmlns:wsrm11='http://docs.oasis-open.org/ws-rx/wsrm/200702'
+ xmlns:wsa='http://www.w3.org/2005/08/addressing'>
+ <env:Header>
+ <wsa:To env:mustUnderstand="1">${res.wsa.to}</wsa:To>
+ <wsa:RelatesTo>${res.wsa.relatesto}</wsa:RelatesTo>
+ <wsa:Action env:mustUnderstand="1">${res.wsa.action}</wsa:Action>
+ </env:Header>
+ <env:Body>
+ <wsrm11:TerminateSequenceResponse>
+ <wsrm11:Identifier>${res.wsrm.sequenceid}</wsrm11:Identifier>
+ </wsrm11:TerminateSequenceResponse>
+ </env:Body>
+</env:Envelope>
Property changes on: stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/common/resources/terminateSequenceResponse.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/oneway/WEB-INF/web.xml
===================================================================
--- stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/oneway/WEB-INF/web.xml (rev 0)
+++ stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/oneway/WEB-INF/web.xml 2007-11-08 16:34:07 UTC (rev 5017)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app 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"
+ version="2.4">
+
+ <servlet>
+ <servlet-name>OneWayServiceEmulator</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxws.wsrm.emulator.EndpointEmulator</servlet-class>
+ <init-param>
+ <param-name>config.file</param-name>
+ <param-value>config/one-way-service-config.xml</param-value>
+ </init-param>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>OneWayServiceEmulator</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
Property changes on: stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/oneway/WEB-INF/web.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/oneway/config/one-way-service-config.xml
===================================================================
--- stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/oneway/config/one-way-service-config.xml (rev 0)
+++ stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/oneway/config/one-way-service-config.xml 2007-11-08 16:34:07 UTC (rev 5017)
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<views>
+
+ <namespaces>
+ <namespace name="soap" value="http://schemas.xmlsoap.org/soap/envelope/"/>
+ <namespace name="wsa" value="http://www.w3.org/2005/08/addressing"/>
+ <namespace name="wsrm" value="http://docs.oasis-open.org/ws-rx/wsrm/200702"/>
+ </namespaces>
+
+ <view id="wsdl.get">
+ <request httpMethod="GET" pathInfo="/OneWayService"/>
+ <response contentType="text/xml" statusCode="200" resource="resources/OneWayService.wsdl"/>
+ </view>
+
+ <view id="create.sequence">
+ <request httpMethod="POST" pathInfo="/OneWayService">
+ <contains>
+ <node name="|{${soap}}Envelope|{${soap}}Body|{${wsrm}}CreateSequence"/>
+ </contains>
+ <set property="req.wsa.messageid" value="|{${soap}}Envelope|{${soap}}Header|{${wsa}}MessageID"/>
+ <set property="req.wsa.action" value="|{${soap}}Envelope|{${soap}}Header|{${wsa}}Action"/>
+ <set property="req.wsa.replyto" value="|{${soap}}Envelope|{${soap}}Header|{${wsa}}ReplyTo|{${wsa}}Address"/>
+ </request>
+ <response contentType="text/xml" statusCode="200" resource="resources/createSequenceResponse.xml">
+ <set property="res.wsa.to" value="${req.wsa.replyto}"/>
+ <set property="res.wsa.action" value="http://docs.oasis-open.org/ws-rx/wsrm/200702/CreateSequenceResponse"/>
+ <set property="res.wsa.relatesto" value="${req.wsa.messageid}"/>
+ <set property="res.wsrm.sequenceid" value="http://sequence/id/123"/>
+ </response>
+ </view>
+
+ <view id="sequence.acknowledgement">
+ <request httpMethod="POST" pathInfo="/OneWayService">
+ <contains>
+ <node name="|{${soap}}Envelope|{${soap}}Header|{${wsrm}}Sequence"/>
+ <node name="|{${soap}}Envelope|{${soap}}Header|{${wsrm}}AckRequested"/>
+ </contains>
+ <set property="req.wsa.messageid" value="|{${soap}}Envelope|{${soap}}Header|{${wsa}}MessageID"/>
+ <set property="req.wsa.action" value="|{${soap}}Envelope|{${soap}}Header|{${wsa}}Action"/>
+ <set property="req.wsa.replyto" value="|{${soap}}Envelope|{${soap}}Header|{${wsa}}ReplyTo|{${wsa}}Address"/>
+ <set property="req.wsrm.sequenceid" value="|{${soap}}Envelope|{${soap}}Header|{${wsrm}}Sequence|{${wsrm}}Identifier"/>
+ <set property="req.wsrm.messagenumber" value="|{${soap}}Envelope|{${soap}}Header|{${wsrm}}Sequence|{${wsrm}}MessageNumber"/>
+ </request>
+ <response contentType="text/xml" statusCode="200" resource="resources/sequenceAckResponse.xml">
+ <set property="res.wsa.to" value="${req.wsa.replyto}"/>
+ <set property="res.wsa.action" value="http://docs.oasis-open.org/ws-rx/wsrm/200702/SequenceAcknowledgement"/>
+ <set property="res.wsa.relatesto" value="${req.wsa.messageid}"/>
+ <set property="res.wsrm.sequenceid" value="${req.wsrm.sequenceid}"/>
+ <set property="res.wsrm.ack.lower" value="${req.wsrm.messagenumber}"/>
+ <set property="res.wsrm.ack.upper" value="${req.wsrm.messagenumber}"/>
+ </response>
+ </view>
+
+ <view id="terminate.sequence">
+ <request httpMethod="POST" pathInfo="/OneWayService">
+ <contains>
+ <node name="|{${soap}}Envelope|{${soap}}Body|{${wsrm}}TerminateSequence"/>
+ </contains>
+ <set property="req.wsa.messageid" value="|{${soap}}Envelope|{${soap}}Header|{${wsa}}MessageID"/>
+ <set property="req.wsa.action" value="|{${soap}}Envelope|{${soap}}Header|{${wsa}}Action"/>
+ <set property="req.wsa.replyto" value="|{${soap}}Envelope|{${soap}}Header|{${wsa}}ReplyTo|{${wsa}}Address"/>
+ <set property="req.wsrm.sequenceid" value="|{${soap}}Envelope|{${soap}}Body|{${wsrm}}TerminateSequence|{${wsrm}}Identifier"/>
+ </request>
+ <response contentType="text/xml" statusCode="200" resource="resources/terminateSequenceResponse.xml">
+ <set property="res.wsa.to" value="${req.wsa.replyto}"/>
+ <set property="res.wsa.action" value="http://docs.oasis-open.org/ws-rx/wsrm/200702/TerminateSequenceResponse"/>
+ <set property="res.wsa.relatesto" value="${req.wsa.messageid}"/>
+ <set property="res.wsrm.sequenceid" value="${req.wsrm.sequenceid}"/>
+ </response>
+ </view>
+
+</views>
Property changes on: stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/oneway/config/one-way-service-config.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/oneway/resources/OneWayService.wsdl
===================================================================
--- stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/oneway/resources/OneWayService.wsdl (rev 0)
+++ stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/oneway/resources/OneWayService.wsdl 2007-11-08 16:34:07 UTC (rev 5017)
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="OneWayService" targetNamespace="http://wsrm.jaxws.ws.test.jboss.org/" xmlns:tns="http://wsrm.jaxws.ws.test.jboss.org/" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <xs:schema targetNamespace="http://wsrm.jaxws.ws.test.jboss.org/" version="1.0" xmlns:tns="http://wsrm.jaxws.ws.test.jboss.org/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <xs:element name="method1" type="tns:method1"/>
+ <xs:element name="method2" type="tns:method2"/>
+ <xs:element name="method3" type="tns:method3"/>
+ <xs:complexType name="method1">
+ <xs:sequence/>
+ </xs:complexType>
+ <xs:complexType name="method2">
+ <xs:sequence>
+ <xs:element minOccurs="0" name="arg0" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:complexType name="method3">
+ <xs:sequence>
+ <xs:element maxOccurs="unbounded" minOccurs="0" name="arg0" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:schema>
+ </types>
+ <message name="OneWayServiceIface_method3">
+ <part name="method3" element="tns:method3">
+ </part>
+ </message>
+ <message name="OneWayServiceIface_method2">
+ <part name="method2" element="tns:method2">
+ </part>
+ </message>
+ <message name="OneWayServiceIface_method1">
+ <part name="method1" element="tns:method1">
+ </part>
+ </message>
+ <portType name="OneWayServiceIface">
+ <operation name="method1">
+ <input message="tns:OneWayServiceIface_method1">
+ </input>
+ </operation>
+ <operation name="method2">
+ <input message="tns:OneWayServiceIface_method2">
+ </input>
+ </operation>
+ <operation name="method3">
+ <input message="tns:OneWayServiceIface_method3">
+ </input>
+ </operation>
+ </portType>
+ <binding name="OneWayServiceIfaceBinding" type="tns:OneWayServiceIface">
+ <wsp:PolicyReference URI="#exactly_one_in_order_rm_delivery"/>
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="method1">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ </operation>
+ <operation name="method2">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ </operation>
+ <operation name="method3">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ </operation>
+ </binding>
+ <service name="OneWayService">
+ <port name="OneWayPort" binding="tns:OneWayServiceIfaceBinding">
+ <soap:address location="http://127.0.0.1:8080/jaxws-wsrm-one-way-emulator/OneWayService"/>
+ </port>
+ </service>
+ <wsp:Policy wsu:Id="exactly_one_in_order_rm_delivery" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit...">
+ <wsp:All>
+ <wsrmp:DeliveryAssurance xmlns:wsrmp="http://docs.oasis-open.org/ws-rx/wsrmp/200702">
+ <wsp:Policy>
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <wsrmp:ExactlyOnce/>
+ <wsrmp:InOrder/>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+ </wsrmp:DeliveryAssurance>
+ </wsp:All>
+ </wsp:Policy>
+</definitions>
\ No newline at end of file
Property changes on: stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/oneway/resources/OneWayService.wsdl
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/reqres/WEB-INF/web.xml
===================================================================
--- stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/reqres/WEB-INF/web.xml (rev 0)
+++ stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/reqres/WEB-INF/web.xml 2007-11-08 16:34:07 UTC (rev 5017)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app 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"
+ version="2.4">
+
+ <servlet>
+ <servlet-name>ReqResServiceEmulator</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxws.wsrm.emulator.EndpointEmulator</servlet-class>
+ <init-param>
+ <param-name>config.file</param-name>
+ <param-value>config/req-res-service-config.xml</param-value>
+ </init-param>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>ReqResServiceEmulator</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
Property changes on: stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/reqres/WEB-INF/web.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/reqres/config/req-res-service-config.xml
===================================================================
--- stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/reqres/config/req-res-service-config.xml (rev 0)
+++ stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/reqres/config/req-res-service-config.xml 2007-11-08 16:34:07 UTC (rev 5017)
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<views>
+
+ <namespaces>
+ <namespace name="soap" value="http://schemas.xmlsoap.org/soap/envelope/"/>
+ <namespace name="wsa" value="http://www.w3.org/2005/08/addressing"/>
+ <namespace name="wsrm" value="http://docs.oasis-open.org/ws-rx/wsrm/200702"/>
+ </namespaces>
+
+ <view id="wsdl.get">
+ <request httpMethod="GET" pathInfo="/ReqResService"/>
+ <response contentType="text/xml" statusCode="200" resource="resources/ReqResService.wsdl"/>
+ </view>
+
+ <view id="create.sequence">
+ <request httpMethod="POST" pathInfo="/ReqResService">
+ <contains>
+ <node name="|{${soap}}Envelope|{${soap}}Body|{${wsrm}}CreateSequence"/>
+ </contains>
+ <set property="req.wsa.messageid" value="|{${soap}}Envelope|{${soap}}Header|{${wsa}}MessageID"/>
+ <set property="req.wsa.action" value="|{${soap}}Envelope|{${soap}}Header|{${wsa}}Action"/>
+ <set property="req.wsa.replyto" value="|{${soap}}Envelope|{${soap}}Header|{${wsa}}ReplyTo|{${wsa}}Address"/>
+ </request>
+ <response contentType="text/xml" statusCode="200" resource="resources/createSequenceResponse.xml">
+ <set property="res.wsa.to" value="${req.wsa.replyto}"/>
+ <set property="res.wsa.action" value="http://docs.oasis-open.org/ws-rx/wsrm/200702/CreateSequenceResponse"/>
+ <set property="res.wsa.relatesto" value="${req.wsa.messageid}"/>
+ <set property="res.wsrm.sequenceid" value="http://sequence/id/456"/>
+ </response>
+ </view>
+
+ <view id="sequence.acknowledgement">
+ <request httpMethod="POST" pathInfo="/ReqResService">
+ <contains>
+ <node name="|{${soap}}Envelope|{${soap}}Header|{${wsrm}}Sequence"/>
+ <node name="|{${soap}}Envelope|{${soap}}Header|{${wsrm}}AckRequested"/>
+ </contains>
+ <set property="req.wsa.messageid" value="|{${soap}}Envelope|{${soap}}Header|{${wsa}}MessageID"/>
+ <set property="req.wsa.action" value="|{${soap}}Envelope|{${soap}}Header|{${wsa}}Action"/>
+ <set property="req.wsa.replyto" value="|{${soap}}Envelope|{${soap}}Header|{${wsa}}ReplyTo|{${wsa}}Address"/>
+ <set property="req.wsrm.sequenceid" value="|{${soap}}Envelope|{${soap}}Header|{${wsrm}}Sequence|{${wsrm}}Identifier"/>
+ <set property="req.wsrm.messagenumber" value="|{${soap}}Envelope|{${soap}}Header|{${wsrm}}Sequence|{${wsrm}}MessageNumber"/>
+ </request>
+ <response contentType="text/xml" statusCode="200" resource="resources/echoResponse.xml">
+ <set property="res.wsa.to" value="${req.wsa.replyto}"/>
+ <set property="res.wsa.action" value="http://docs.oasis-open.org/ws-rx/wsrm/200702/SequenceAcknowledgement"/>
+ <set property="res.wsa.relatesto" value="${req.wsa.messageid}"/>
+ <set property="res.wsrm.sequenceid" value="${req.wsrm.sequenceid}"/>
+ <set property="res.wsrm.ack.lower" value="${req.wsrm.messagenumber}"/>
+ <set property="res.wsrm.ack.upper" value="${req.wsrm.messagenumber}"/>
+ </response>
+ </view>
+
+ <view id="terminate.sequence">
+ <request httpMethod="POST" pathInfo="/ReqResService">
+ <contains>
+ <node name="|{${soap}}Envelope|{${soap}}Body|{${wsrm}}TerminateSequence"/>
+ </contains>
+ <set property="req.wsa.messageid" value="|{${soap}}Envelope|{${soap}}Header|{${wsa}}MessageID"/>
+ <set property="req.wsa.action" value="|{${soap}}Envelope|{${soap}}Header|{${wsa}}Action"/>
+ <set property="req.wsa.replyto" value="|{${soap}}Envelope|{${soap}}Header|{${wsa}}ReplyTo|{${wsa}}Address"/>
+ <set property="req.wsrm.sequenceid" value="|{${soap}}Envelope|{${soap}}Body|{${wsrm}}TerminateSequence|{${wsrm}}Identifier"/>
+ </request>
+ <response contentType="text/xml" statusCode="200" resource="resources/terminateSequenceResponse.xml">
+ <set property="res.wsa.to" value="${req.wsa.replyto}"/>
+ <set property="res.wsa.action" value="http://docs.oasis-open.org/ws-rx/wsrm/200702/TerminateSequenceResponse"/>
+ <set property="res.wsa.relatesto" value="${req.wsa.messageid}"/>
+ <set property="res.wsrm.sequenceid" value="${req.wsrm.sequenceid}"/>
+ </response>
+ </view>
+
+</views>
Property changes on: stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/reqres/config/req-res-service-config.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/reqres/resources/ReqResService.wsdl
===================================================================
--- stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/reqres/resources/ReqResService.wsdl (rev 0)
+++ stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/reqres/resources/ReqResService.wsdl 2007-11-08 16:34:07 UTC (rev 5017)
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="ReqResService" targetNamespace="http://org.jboss.ws/jaxws/wsrm" xmlns:tns="http://org.jboss.ws/jaxws/wsrm" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ </types>
+ <message name="ReqRes_echo">
+ <part name="String_1" type="xsd:string">
+ </part>
+ </message>
+ <message name="ReqRes_echoResponse">
+ <part name="result" type="xsd:string">
+ </part>
+ </message>
+ <portType name="ReqRes">
+ <operation name="echo" parameterOrder="String_1">
+ <input message="tns:ReqRes_echo">
+ </input>
+ <output message="tns:ReqRes_echoResponse">
+ </output>
+ </operation>
+ </portType>
+ <binding name="ReqResBinding" type="tns:ReqRes">
+ <wsp:PolicyReference URI="#exactly_one_in_order_rm_delivery"/>
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="echo">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal" namespace="http://org.jboss.ws/jaxws/wsrm"/>
+ </input>
+ <output>
+ <soap:body use="literal" namespace="http://org.jboss.ws/jaxws/wsrm"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="ReqResService">
+ <port name="ReqResPort" binding="tns:ReqResBinding">
+ <soap:address location="http://127.0.0.1:8080/jaxws-wsrm-req-res-emulator/ReqResService"/>
+ </port>
+ </service>
+ <wsp:Policy wsu:Id="exactly_one_in_order_rm_delivery" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit...">
+ <wsp:All>
+ <wsrmp:DeliveryAssurance xmlns:wsrmp="http://docs.oasis-open.org/ws-rx/wsrmp/200702">
+ <wsp:Policy>
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <wsrmp:ExactlyOnce/>
+ <wsrmp:InOrder/>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+ </wsrmp:DeliveryAssurance>
+ </wsp:All>
+ </wsp:Policy>
+</definitions>
Property changes on: stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/reqres/resources/ReqResService.wsdl
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/reqres/resources/echoResponse.xml
===================================================================
--- stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/reqres/resources/echoResponse.xml (rev 0)
+++ stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/reqres/resources/echoResponse.xml 2007-11-08 16:34:07 UTC (rev 5017)
@@ -0,0 +1,19 @@
+<env:Envelope
+ xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'
+ xmlns:wsrm='http://docs.oasis-open.org/ws-rx/wsrm/200702'
+ xmlns:wsa='http://www.w3.org/2005/08/addressing'>
+ <env:Header xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
+ <wsa:To env:mustUnderstand="1">${res.wsa.to}</wsa:To>
+ <wsa:RelatesTo>${res.wsa.relatesto}</wsa:RelatesTo>
+ <wsa:Action env:mustUnderstand="1">${res.wsa.action}</wsa:Action>
+ <wsrm:SequenceAcknowledgement>
+ <wsrm:Identifier>${res.wsrm.sequenceid}</wsrm:Identifier>
+ <wsrm:AcknowledgementRange Upper='${res.wsrm.ack.upper}' Lower='${res.wsrm.ack.lower}'/>
+ </wsrm:SequenceAcknowledgement>
+ </env:Header>
+ <env:Body>
+ <ns1:echoResponse xmlns:ns1='http://org.jboss.ws/jaxws/wsrm'>
+ <result>Hello World</result>
+ </ns1:echoResponse>
+ </env:Body>
+</env:Envelope>
Property changes on: stack/native/trunk/src/test/resources/jaxws/wsrm/emulator/reqres/resources/echoResponse.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: stack/native/trunk/src/test/resources/jaxws/wsrm/properties/OneWayTestCase.properties
===================================================================
--- stack/native/trunk/src/test/resources/jaxws/wsrm/properties/OneWayTestCase.properties 2007-11-08 14:50:41 UTC (rev 5016)
+++ stack/native/trunk/src/test/resources/jaxws/wsrm/properties/OneWayTestCase.properties 2007-11-08 16:34:07 UTC (rev 5017)
@@ -1,6 +1,6 @@
port=8080
#path=/jaxws-wsrm/OneWayService
-path=/jaxws-wsrm-emulator/OneWayService
+path=/jaxws-wsrm-one-way-emulator/OneWayService
#archives=jaxws-wsrm.war, jaxws-wsrm-client.jar
-archives=jaxws-wsrm-emulator.war, jaxws-wsrm-client.jar
-emulator=true
\ No newline at end of file
+archives=jaxws-wsrm-one-way-emulator.war, jaxws-wsrm-client.jar
+emulator=true
Modified: stack/native/trunk/src/test/resources/jaxws/wsrm/properties/ReqResTestCase.properties
===================================================================
--- stack/native/trunk/src/test/resources/jaxws/wsrm/properties/ReqResTestCase.properties 2007-11-08 14:50:41 UTC (rev 5016)
+++ stack/native/trunk/src/test/resources/jaxws/wsrm/properties/ReqResTestCase.properties 2007-11-08 16:34:07 UTC (rev 5017)
@@ -1,6 +1,6 @@
port=8080
#path=/jaxws-wsrm/ReqResService
-path=/jaxws-wsrm-emulator/ReqResService
+path=/jaxws-wsrm-req-res-emulator/ReqResService
#archives=jaxws-wsrm.war, jaxws-wsrm-client.jar
-archives=jaxws-wsrm-emulator.war, jaxws-wsrm-client.jar
+archives=jaxws-wsrm-req-res-emulator.war, jaxws-wsrm-client.jar
emulator=true
\ No newline at end of file
17 years, 2 months
JBossWS SVN: r5016 - in legacy/branches/jbossws-1.2.1.GA_CP/jbossws-core/src/java/org/jboss/ws/core: server and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-11-08 09:50:41 -0500 (Thu, 08 Nov 2007)
New Revision: 5016
Modified:
legacy/branches/jbossws-1.2.1.GA_CP/jbossws-core/src/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java
legacy/branches/jbossws-1.2.1.GA_CP/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManager.java
legacy/branches/jbossws-1.2.1.GA_CP/jbossws-core/src/java/org/jboss/ws/core/utils/DOMUtils.java
legacy/branches/jbossws-1.2.1.GA_CP/jbossws-core/src/java/org/jboss/ws/core/utils/ThreadLocalAssociation.java
Log:
Fix JBPAPP-407: DOMUtils doesn't clear thread locals
Modified: legacy/branches/jbossws-1.2.1.GA_CP/jbossws-core/src/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java
===================================================================
--- legacy/branches/jbossws-1.2.1.GA_CP/jbossws-core/src/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java 2007-11-08 13:47:12 UTC (rev 5015)
+++ legacy/branches/jbossws-1.2.1.GA_CP/jbossws-core/src/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java 2007-11-08 14:50:41 UTC (rev 5016)
@@ -38,6 +38,7 @@
import javax.xml.ws.wsaddressing.W3CEndpointReference;
import org.jboss.util.NotImplementedException;
+import org.jboss.ws.core.utils.DOMUtils;
import org.w3c.dom.Element;
/**
@@ -59,6 +60,7 @@
public ServiceDelegate createServiceDelegate(URL wsdlLocation, QName serviceName, Class serviceClass)
{
ServiceDelegateImpl delegate = new ServiceDelegateImpl(wsdlLocation, serviceName, serviceClass);
+ DOMUtils.clearThreadLocals();
return delegate;
}
Modified: legacy/branches/jbossws-1.2.1.GA_CP/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManager.java
===================================================================
--- legacy/branches/jbossws-1.2.1.GA_CP/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManager.java 2007-11-08 13:47:12 UTC (rev 5015)
+++ legacy/branches/jbossws-1.2.1.GA_CP/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManager.java 2007-11-08 14:50:41 UTC (rev 5016)
@@ -67,6 +67,7 @@
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.core.soap.SOAPConnectionImpl;
import org.jboss.ws.core.utils.ThreadLocalAssociation;
+import org.jboss.ws.core.utils.DOMUtils;
import org.jboss.ws.extensions.addressing.AddressingConstantsImpl;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.HandlerMetaData;
@@ -490,6 +491,8 @@
// clear thread local storage
ThreadLocalAssociation.clear();
+
+ DOMUtils.clearThreadLocals();
}
}
Modified: legacy/branches/jbossws-1.2.1.GA_CP/jbossws-core/src/java/org/jboss/ws/core/utils/DOMUtils.java
===================================================================
--- legacy/branches/jbossws-1.2.1.GA_CP/jbossws-core/src/java/org/jboss/ws/core/utils/DOMUtils.java 2007-11-08 13:47:12 UTC (rev 5015)
+++ legacy/branches/jbossws-1.2.1.GA_CP/jbossws-core/src/java/org/jboss/ws/core/utils/DOMUtils.java 2007-11-08 14:50:41 UTC (rev 5016)
@@ -93,6 +93,12 @@
{
}
+ public static void clearThreadLocals()
+ {
+ documentThreadLocal.remove();
+ builderThreadLocal.remove();
+ }
+
/** Initialise the the DocumentBuilder
*/
public static DocumentBuilder getDocumentBuilder()
Modified: legacy/branches/jbossws-1.2.1.GA_CP/jbossws-core/src/java/org/jboss/ws/core/utils/ThreadLocalAssociation.java
===================================================================
--- legacy/branches/jbossws-1.2.1.GA_CP/jbossws-core/src/java/org/jboss/ws/core/utils/ThreadLocalAssociation.java 2007-11-08 13:47:12 UTC (rev 5015)
+++ legacy/branches/jbossws-1.2.1.GA_CP/jbossws-core/src/java/org/jboss/ws/core/utils/ThreadLocalAssociation.java 2007-11-08 14:50:41 UTC (rev 5016)
@@ -71,8 +71,8 @@
public static void clear()
{
- invokerMDBAssoc.set(null);
- msgContextAssoc.set(null);
- strTransformAssoc.set(null);
+ invokerMDBAssoc.remove();
+ msgContextAssoc.remove();
+ strTransformAssoc.remove();
}
}
17 years, 2 months
JBossWS SVN: r5015 - in stack/native/trunk: src/main/java/org/jboss/ws/core/jaxws/spi and 3 other directories.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-11-08 08:47:12 -0500 (Thu, 08 Nov 2007)
New Revision: 5015
Modified:
stack/native/trunk/jbossws-native-2.0.2.iml
stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/core/server/WSDLRequestHandler.java
stack/native/trunk/src/main/java/org/jboss/ws/core/utils/ThreadLocalAssociation.java
stack/native/trunk/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java
stack/native/trunk/version.properties
Log:
svn merge -r5011:5014 https://svn.jboss.org/repos/jbossws/stack/native/branches/jbossws-native-...
Modified: stack/native/trunk/jbossws-native-2.0.2.iml
===================================================================
--- stack/native/trunk/jbossws-native-2.0.2.iml 2007-11-08 13:36:51 UTC (rev 5014)
+++ stack/native/trunk/jbossws-native-2.0.2.iml 2007-11-08 13:47:12 UTC (rev 5015)
@@ -229,15 +229,6 @@
<orderEntry type="module-library">
<library>
<CLASSES>
- <root url="jar://$MODULE_DIR$/thirdparty/jbossws-common.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library">
- <library>
- <CLASSES>
<root url="jar://$MODULE_DIR$/thirdparty/commons-logging.jar!/" />
</CLASSES>
<JAVADOC />
@@ -640,6 +631,7 @@
<SOURCES />
</library>
</orderEntry>
+ <orderEntry type="module" module-name="common" />
<orderEntryProperties />
</component>
</module>
Modified: stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java 2007-11-08 13:36:51 UTC (rev 5014)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java 2007-11-08 13:47:12 UTC (rev 5015)
@@ -39,6 +39,7 @@
import javax.xml.ws.wsaddressing.W3CEndpointReference;
import org.jboss.util.NotImplementedException;
+import org.jboss.wsf.common.DOMUtils;
import org.w3c.dom.Element;
/**
@@ -60,6 +61,7 @@
public ServiceDelegate createServiceDelegate(URL wsdlLocation, QName serviceName, Class serviceClass)
{
ServiceDelegateImpl delegate = new ServiceDelegateImpl(wsdlLocation, serviceName, serviceClass);
+ DOMUtils.clearThreadLocals();
return delegate;
}
Modified: stack/native/trunk/src/main/java/org/jboss/ws/core/server/WSDLRequestHandler.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/server/WSDLRequestHandler.java 2007-11-08 13:36:51 UTC (rev 5014)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/server/WSDLRequestHandler.java 2007-11-08 13:47:12 UTC (rev 5015)
@@ -136,6 +136,8 @@
if (resPath != null && resPath.indexOf("/") > 0)
{
String resParent = resPath.substring(0, resPath.lastIndexOf("/"));
+
+ // replace parent traversal, results in resParent == null when successfully executed
while (orgLocation.startsWith("../") && resParent != null)
{
if (resParent.indexOf("/") > 0)
@@ -151,6 +153,10 @@
resParent = null;
}
}
+
+ // no parent traversal happend
+ if(resParent!=null)
+ newResourcePath = resParent +"/"+ orgLocation;
}
String reqPath = reqURL.getPath();
Modified: stack/native/trunk/src/main/java/org/jboss/ws/core/utils/ThreadLocalAssociation.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/utils/ThreadLocalAssociation.java 2007-11-08 13:36:51 UTC (rev 5014)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/utils/ThreadLocalAssociation.java 2007-11-08 13:47:12 UTC (rev 5015)
@@ -60,7 +60,7 @@
public static void clear()
{
- msgContextAssoc.set(null);
- strTransformAssoc.set(null);
+ msgContextAssoc.remove();
+ strTransformAssoc.remove();
}
}
Modified: stack/native/trunk/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java 2007-11-08 13:36:51 UTC (rev 5014)
+++ stack/native/trunk/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java 2007-11-08 13:47:12 UTC (rev 5015)
@@ -91,6 +91,7 @@
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.common.DOMWriter;
+import org.jboss.wsf.common.DOMUtils;
import org.w3c.dom.Document;
/**
@@ -320,6 +321,7 @@
// clear thread local storage
ThreadLocalAssociation.clear();
+ DOMUtils.clearThreadLocals();
}
}
Modified: stack/native/trunk/version.properties
===================================================================
--- stack/native/trunk/version.properties 2007-11-08 13:36:51 UTC (rev 5014)
+++ stack/native/trunk/version.properties 2007-11-08 13:47:12 UTC (rev 5015)
@@ -25,7 +25,7 @@
# Dependend integration projects
jbossws-spi=1.0.0.GA
-jbossws-common=1.0.1.GA
+jbossws-common=snapshot
jbossws-framework=2.0.2.GA
jbossws-jboss40=2.0.2.GA
jbossws-jboss42=2.0.1.GA
17 years, 2 months
JBossWS SVN: r5014 - in stack/native/branches/jbossws-native-2.0.2: src/main/java/org/jboss/ws/core/server and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-11-08 08:36:51 -0500 (Thu, 08 Nov 2007)
New Revision: 5014
Modified:
stack/native/branches/jbossws-native-2.0.2/jbossws-native-2.0.2.iml
stack/native/branches/jbossws-native-2.0.2/src/main/java/org/jboss/ws/core/server/WSDLRequestHandler.java
Log:
Update to JBWS-1798, ficx relative non-parent paths. Covered by TCK 1.4 7 webservices
Modified: stack/native/branches/jbossws-native-2.0.2/jbossws-native-2.0.2.iml
===================================================================
--- stack/native/branches/jbossws-native-2.0.2/jbossws-native-2.0.2.iml 2007-11-08 13:35:35 UTC (rev 5013)
+++ stack/native/branches/jbossws-native-2.0.2/jbossws-native-2.0.2.iml 2007-11-08 13:36:51 UTC (rev 5014)
@@ -229,15 +229,6 @@
<orderEntry type="module-library">
<library>
<CLASSES>
- <root url="jar://$MODULE_DIR$/thirdparty/jbossws-common.jar!/" />
- </CLASSES>
- <JAVADOC />
- <SOURCES />
- </library>
- </orderEntry>
- <orderEntry type="module-library">
- <library>
- <CLASSES>
<root url="jar://$MODULE_DIR$/thirdparty/commons-logging.jar!/" />
</CLASSES>
<JAVADOC />
@@ -640,6 +631,7 @@
<SOURCES />
</library>
</orderEntry>
+ <orderEntry type="module" module-name="common" />
<orderEntryProperties />
</component>
</module>
Modified: stack/native/branches/jbossws-native-2.0.2/src/main/java/org/jboss/ws/core/server/WSDLRequestHandler.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.2/src/main/java/org/jboss/ws/core/server/WSDLRequestHandler.java 2007-11-08 13:35:35 UTC (rev 5013)
+++ stack/native/branches/jbossws-native-2.0.2/src/main/java/org/jboss/ws/core/server/WSDLRequestHandler.java 2007-11-08 13:36:51 UTC (rev 5014)
@@ -136,6 +136,8 @@
if (resPath != null && resPath.indexOf("/") > 0)
{
String resParent = resPath.substring(0, resPath.lastIndexOf("/"));
+
+ // replace parent traversal, results in resParent == null when successfully executed
while (orgLocation.startsWith("../") && resParent != null)
{
if (resParent.indexOf("/") > 0)
@@ -151,6 +153,10 @@
resParent = null;
}
}
+
+ // no parent traversal happend
+ if(resParent!=null)
+ newResourcePath = resParent +"/"+ orgLocation;
}
String reqPath = reqURL.getPath();
17 years, 2 months
JBossWS SVN: r5013 - in stack/native/branches/jbossws-native-2.0.2: src/main/java/org/jboss/ws/core/jaxws/spi and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-11-08 08:35:35 -0500 (Thu, 08 Nov 2007)
New Revision: 5013
Modified:
stack/native/branches/jbossws-native-2.0.2/src/main/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java
stack/native/branches/jbossws-native-2.0.2/src/main/java/org/jboss/ws/core/utils/ThreadLocalAssociation.java
stack/native/branches/jbossws-native-2.0.2/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java
stack/native/branches/jbossws-native-2.0.2/version.properties
Log:
JBWS-1903: DOMUtils doesn't clear thread locals
Modified: stack/native/branches/jbossws-native-2.0.2/src/main/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.2/src/main/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java 2007-11-08 13:31:55 UTC (rev 5012)
+++ stack/native/branches/jbossws-native-2.0.2/src/main/java/org/jboss/ws/core/jaxws/spi/ProviderImpl.java 2007-11-08 13:35:35 UTC (rev 5013)
@@ -39,6 +39,7 @@
import javax.xml.ws.wsaddressing.W3CEndpointReference;
import org.jboss.util.NotImplementedException;
+import org.jboss.wsf.common.DOMUtils;
import org.w3c.dom.Element;
/**
@@ -60,6 +61,7 @@
public ServiceDelegate createServiceDelegate(URL wsdlLocation, QName serviceName, Class serviceClass)
{
ServiceDelegateImpl delegate = new ServiceDelegateImpl(wsdlLocation, serviceName, serviceClass);
+ DOMUtils.clearThreadLocals();
return delegate;
}
Modified: stack/native/branches/jbossws-native-2.0.2/src/main/java/org/jboss/ws/core/utils/ThreadLocalAssociation.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.2/src/main/java/org/jboss/ws/core/utils/ThreadLocalAssociation.java 2007-11-08 13:31:55 UTC (rev 5012)
+++ stack/native/branches/jbossws-native-2.0.2/src/main/java/org/jboss/ws/core/utils/ThreadLocalAssociation.java 2007-11-08 13:35:35 UTC (rev 5013)
@@ -60,7 +60,7 @@
public static void clear()
{
- msgContextAssoc.set(null);
- strTransformAssoc.set(null);
+ msgContextAssoc.remove();
+ strTransformAssoc.remove();
}
}
Modified: stack/native/branches/jbossws-native-2.0.2/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.2/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java 2007-11-08 13:31:55 UTC (rev 5012)
+++ stack/native/branches/jbossws-native-2.0.2/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java 2007-11-08 13:35:35 UTC (rev 5013)
@@ -91,6 +91,7 @@
import org.jboss.wsf.spi.SPIProviderResolver;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.common.DOMWriter;
+import org.jboss.wsf.common.DOMUtils;
import org.w3c.dom.Document;
/**
@@ -320,6 +321,7 @@
// clear thread local storage
ThreadLocalAssociation.clear();
+ DOMUtils.clearThreadLocals();
}
}
Modified: stack/native/branches/jbossws-native-2.0.2/version.properties
===================================================================
--- stack/native/branches/jbossws-native-2.0.2/version.properties 2007-11-08 13:31:55 UTC (rev 5012)
+++ stack/native/branches/jbossws-native-2.0.2/version.properties 2007-11-08 13:35:35 UTC (rev 5013)
@@ -25,7 +25,7 @@
# Dependend integration projects
jbossws-spi=1.0.0.GA
-jbossws-common=1.0.1.GA
+jbossws-common=snapshot
jbossws-framework=2.0.2.GA
jbossws-jboss40=2.0.2.GA
jbossws-jboss42=2.0.1.GA
17 years, 2 months
JBossWS SVN: r5012 - in common/trunk: src/main/java/org/jboss/wsf/common and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: heiko.braun(a)jboss.com
Date: 2007-11-08 08:31:55 -0500 (Thu, 08 Nov 2007)
New Revision: 5012
Modified:
common/trunk/src/main/java/org/jboss/wsf/common/DOMUtils.java
common/trunk/src/main/java/org/jboss/wsf/common/IOUtils.java
common/trunk/version.properties
Log:
JBWS-1903: DOMUtils doesn't clear thread locals
Modified: common/trunk/src/main/java/org/jboss/wsf/common/DOMUtils.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/common/DOMUtils.java 2007-11-08 10:35:23 UTC (rev 5011)
+++ common/trunk/src/main/java/org/jboss/wsf/common/DOMUtils.java 2007-11-08 13:31:55 UTC (rev 5012)
@@ -114,6 +114,12 @@
}
};
+ public static void clearThreadLocals()
+ {
+ documentThreadLocal.remove();
+ builderThreadLocal.remove();
+ }
+
// Hide the constructor
private DOMUtils()
{
Modified: common/trunk/src/main/java/org/jboss/wsf/common/IOUtils.java
===================================================================
--- common/trunk/src/main/java/org/jboss/wsf/common/IOUtils.java 2007-11-08 10:35:23 UTC (rev 5011)
+++ common/trunk/src/main/java/org/jboss/wsf/common/IOUtils.java 2007-11-08 13:31:55 UTC (rev 5012)
@@ -63,27 +63,47 @@
*/
public static void copyStream(OutputStream outs, InputStream ins) throws IOException
{
- byte[] bytes = new byte[1024];
- int r = ins.read(bytes);
- while (r > 0)
+ try
{
- outs.write(bytes, 0, r);
- r = ins.read(bytes);
+ byte[] bytes = new byte[1024];
+ int r = ins.read(bytes);
+ while (r > 0)
+ {
+ outs.write(bytes, 0, r);
+ r = ins.read(bytes);
+ }
}
+ catch (IOException e)
+ {
+ throw e;
+ }
+ finally{
+ ins.close();
+ }
}
/** Copy the reader to the output stream
*/
public static void copyReader(OutputStream outs, Reader reader) throws IOException
{
- OutputStreamWriter writer = new OutputStreamWriter(outs);
- char[] bytes = new char[1024];
- int r = reader.read(bytes);
- while (r > 0)
+ try
{
- writer.write(bytes, 0, r);
- r = reader.read(bytes);
+ OutputStreamWriter writer = new OutputStreamWriter(outs);
+ char[] bytes = new char[1024];
+ int r = reader.read(bytes);
+ while (r > 0)
+ {
+ writer.write(bytes, 0, r);
+ r = reader.read(bytes);
+ }
}
+ catch (IOException e)
+ {
+ throw e;
+ }
+ finally{
+ reader.close();
+ }
}
public static byte[] convertToBytes(DataHandler dh)
@@ -106,17 +126,27 @@
*/
public static InputStream transformReader(Reader reader) throws IOException
{
- int capacity = 1024;
- char[] charBuffer = new char[capacity];
- StringBuffer strBuffer = new StringBuffer(capacity);
+ try
+ {
+ int capacity = 1024;
+ char[] charBuffer = new char[capacity];
+ StringBuffer strBuffer = new StringBuffer(capacity);
- int len = reader.read(charBuffer, 0, capacity);
- while (len > 0)
+ int len = reader.read(charBuffer, 0, capacity);
+ while (len > 0)
+ {
+ strBuffer.append(charBuffer, 0, len);
+ len = reader.read(charBuffer, 0, capacity);
+ }
+ return new ByteArrayInputStream(strBuffer.toString().getBytes());
+ }
+ catch (IOException e)
{
- strBuffer.append(charBuffer, 0, len);
- len = reader.read(charBuffer, 0, capacity);
+ throw e;
}
- return new ByteArrayInputStream(strBuffer.toString().getBytes());
+ finally{
+ reader.close();
+ }
}
public static File createTempDirectory() throws IOException
Modified: common/trunk/version.properties
===================================================================
--- common/trunk/version.properties 2007-11-08 10:35:23 UTC (rev 5011)
+++ common/trunk/version.properties 2007-11-08 13:31:55 UTC (rev 5012)
@@ -6,9 +6,8 @@
specification.version=jbossws-2.0
version.id=1.0.1.GA
-repository.id=1.0.1.GA
+repository.id=snapshot
-implementation.title=JBoss Web Services - Common
implementation.url=http://www.jboss.org/products/jbossws
implementation.vendor=JBoss Inc.
implementation.vendor.id=http://www.jboss.org
17 years, 2 months
JBossWS SVN: r5011 - in stack/native/branches/jbossws-native-2.0.2: src/test/java/org/jboss/test/ws/jaxws/jbws944 and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-11-08 05:35:23 -0500 (Thu, 08 Nov 2007)
New Revision: 5011
Modified:
stack/native/branches/jbossws-native-2.0.2/src/test/java/org/jboss/test/ws/jaxws/jbws944/JBWS944TestCase.java
stack/native/branches/jbossws-native-2.0.2/src/test/resources/test-excludes-jboss500.txt
stack/native/branches/jbossws-native-2.0.2/version.properties
Log:
Update AS50 excludes
Modified: stack/native/branches/jbossws-native-2.0.2/src/test/java/org/jboss/test/ws/jaxws/jbws944/JBWS944TestCase.java
===================================================================
--- stack/native/branches/jbossws-native-2.0.2/src/test/java/org/jboss/test/ws/jaxws/jbws944/JBWS944TestCase.java 2007-11-08 09:53:16 UTC (rev 5010)
+++ stack/native/branches/jbossws-native-2.0.2/src/test/java/org/jboss/test/ws/jaxws/jbws944/JBWS944TestCase.java 2007-11-08 10:35:23 UTC (rev 5011)
@@ -73,6 +73,7 @@
System.out.println("FIXME: [JBCTS-540] EJB3 proxy does not implement the Home interface");
return;
}
+
InitialContext iniCtx = getInitialContext();
Object obj = iniCtx.lookup("/ejb3/EJB3EndpointInterface");
EJB3RemoteHome ejb3Home = (EJB3RemoteHome)PortableRemoteObject.narrow(obj, EJB3RemoteHome.class);
Modified: stack/native/branches/jbossws-native-2.0.2/src/test/resources/test-excludes-jboss500.txt
===================================================================
--- stack/native/branches/jbossws-native-2.0.2/src/test/resources/test-excludes-jboss500.txt 2007-11-08 09:53:16 UTC (rev 5010)
+++ stack/native/branches/jbossws-native-2.0.2/src/test/resources/test-excludes-jboss500.txt 2007-11-08 10:35:23 UTC (rev 5011)
@@ -4,9 +4,6 @@
# [JBAS-4890] EJBAccessException: Caller unauthorized
org/jboss/test/ws/jaxws/samples/context/**
-# [JBAS-4903] EJB 2.1 view cannot be realized
-org/jboss/test/ws/jaxws/jbws944/**
-
# [JBAS-4944] Ejb3AuthenticationInterceptorv2.invoke not implemented
org/jboss/test/ws/jaxws/jbws1813/**
Modified: stack/native/branches/jbossws-native-2.0.2/version.properties
===================================================================
--- stack/native/branches/jbossws-native-2.0.2/version.properties 2007-11-08 09:53:16 UTC (rev 5010)
+++ stack/native/branches/jbossws-native-2.0.2/version.properties 2007-11-08 10:35:23 UTC (rev 5011)
@@ -32,7 +32,7 @@
# JBossAS-5.0
jboss-jbossxb-jboss50=snapshot
-jboss-remoting-jboss50=2.2.2.SP1
+jboss-remoting-jboss50=2.2.2.SP2
# JBossAS-4.2
jboss-jbossxb-jboss42=1.0.0.GA
17 years, 2 months