JBossWS SVN: r2907 - in trunk: integration-tomcat/src/java/org/jboss/ws/integration/tomcat and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2007-04-23 17:07:04 -0400 (Mon, 23 Apr 2007)
New Revision: 2907
Modified:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/AbstractDeployerJSE.java
trunk/integration-tomcat/src/java/org/jboss/ws/integration/tomcat/wspublish.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1093/JBWS1093TestCase.java
Log:
JBWS-1093 - Deploying a war that also contains normal servlets the web.xml is modified as if they are all endpoints.
Modified: trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/AbstractDeployerJSE.java
===================================================================
--- trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/AbstractDeployerJSE.java 2007-04-23 19:30:09 UTC (rev 2906)
+++ trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/AbstractDeployerJSE.java 2007-04-23 21:07:04 UTC (rev 2907)
@@ -35,6 +35,7 @@
import org.jboss.metadata.web.Servlet;
import org.jboss.ws.core.server.AbstractServiceEndpointPublisher;
import org.jboss.ws.core.server.AbstractServiceEndpointPublisher.RewriteResults;
+import org.jboss.ws.core.utils.JavaUtils;
/**
* An abstract deployer for JSE Endpoints
@@ -60,15 +61,10 @@
// Call the super implementation
super.deployServiceEndpoint(unit);
- // FIXME: JBAS-3812 - TomcatDeployment should use modified WebMetaData
- InputStream stream = unit.getDeploymentContext().getRoot().findChild("WEB-INF/web.xml").openStream();
- RewriteResults results = getServiceEndpointPublisher().rewriteWebXml(stream, null, unit.getClassLoader());
-
- URL webXML = results.webXML;
- modifyWebMetaData(unit, webXML);
+ modifyWebMetaData(unit);
}
- private void modifyWebMetaData(DeploymentUnit unit, URL webXML) throws Exception
+ private void modifyWebMetaData(DeploymentUnit unit) throws Exception
{
Set<? extends WebMetaData> allMetaData = unit.getAllMetaData(WebMetaData.class);
if (allMetaData.size() < 1)
@@ -88,19 +84,44 @@
continue;
// Nothing to do if we have an <init-param>
- if (isAlreadyModified(servlet) == false)
+ if (isAlreadyModified(servlet) == false && isAServlet(servletClassName, unit.getClassLoader()) == false)
{
servlet.setServletClass(serviceEndpointServlet);
NameValuePair initParam = new NameValuePair(AbstractServiceEndpointPublisher.INIT_PARAM_SERVICE_ENDPOINT_IMPL, servletClassName);
servlet.addInitParam(initParam);
}
+
}
- // FIXME: JBAS-3812 - TomcatDeployment should use modified WebMetaData
- String webXmlPath = webXML.getPath();
- webMetaData.setAltDDPath(webXmlPath);
}
+ private boolean isAServlet(String servletClassName, ClassLoader cl)
+ {
+ boolean isAServlet = false;
+
+ if (cl != null)
+ {
+ try
+ {
+ Class servletClass = cl.loadClass(servletClassName);
+
+ isAServlet = JavaUtils.isAssignableFrom(javax.servlet.Servlet.class, servletClass);
+
+ if (isAServlet == true)
+ {
+ log.info("Ignore servlet: " + servletClassName);
+ }
+ }
+ catch (ClassNotFoundException e)
+ {
+ log.warn("Cannot load servlet class: " + servletClassName);
+ }
+
+ }
+
+ return isAServlet;
+ }
+
private boolean isAlreadyModified(Servlet servlet)
{
Iterator itParams = servlet.getInitParams().iterator();
Modified: trunk/integration-tomcat/src/java/org/jboss/ws/integration/tomcat/wspublish.java
===================================================================
--- trunk/integration-tomcat/src/java/org/jboss/ws/integration/tomcat/wspublish.java 2007-04-23 19:30:09 UTC (rev 2906)
+++ trunk/integration-tomcat/src/java/org/jboss/ws/integration/tomcat/wspublish.java 2007-04-23 21:07:04 UTC (rev 2907)
@@ -70,6 +70,7 @@
UnifiedDeploymentInfo udi = new UnifiedDeploymentInfo(null);
udi.webappURL = tmpDir.toURL();
+ udi.classLoader = DeploymentLoader.newInstance(udi.webappURL);
TomcatServiceEndpointPublisher publisher = new TomcatServiceEndpointPublisher();
publisher.setServiceEndpointServlet(servletName);
Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1093/JBWS1093TestCase.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1093/JBWS1093TestCase.java 2007-04-23 19:30:09 UTC (rev 2906)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1093/JBWS1093TestCase.java 2007-04-23 21:07:04 UTC (rev 2907)
@@ -85,12 +85,6 @@
public void testAccessServlet() throws Exception
{
- if (true)
- {
- System.out.println("FIXME: [JBAS-4210] HTTP request dispatched to the wrong servlet");
- return;
- }
-
URL servletURL = new URL("http://" + getServerHost() + ":8080" + "/jaxrpc-jbws1093/ServletTest");
InputStream is = servletURL.openStream();
17 years, 8 months
JBossWS SVN: r2906 - branches/dlofthouse.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2007-04-23 15:30:09 -0400 (Mon, 23 Apr 2007)
New Revision: 2906
Removed:
branches/dlofthouse/JBWS-1607/
Log:
Branch no longer required.
17 years, 8 months
JBossWS SVN: r2905 - in trunk: jbossws-core/src/java/org/jboss/ws/tools/helpers and 4 other directories.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2007-04-23 15:29:38 -0400 (Mon, 23 Apr 2007)
New Revision: 2905
Added:
trunk/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws1607/
trunk/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws1607/JBWS1607TestCase.java
trunk/jbossws-tests/src/resources/tools/jbws1607/
trunk/jbossws-tests/src/resources/tools/jbws1607/PhoneBook.wsdl
trunk/jbossws-tests/src/resources/tools/jbws1607/PhoneBook_PortType.java
trunk/jbossws-tests/src/resources/tools/jbws1607/jaxrpc-mapping.xml
trunk/jbossws-tests/src/resources/tools/jbws1607/wstools-config.xml
Removed:
trunk/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws1607/JBWS1607TestCase.java
trunk/jbossws-tests/src/resources/tools/jbws1607/PhoneBook.wsdl
trunk/jbossws-tests/src/resources/tools/jbws1607/PhoneBook_PortType.java
trunk/jbossws-tests/src/resources/tools/jbws1607/jaxrpc-mapping.xml
trunk/jbossws-tests/src/resources/tools/jbws1607/wstools-config.xml
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/tools/WSDLToJava.java
trunk/jbossws-core/src/java/org/jboss/ws/tools/helpers/MappingFileGeneratorHelper.java
Log:
JBWS-1607 - WSDL To Java - document/literal, IN OUT parameter incorectly used as return type.
Modified: trunk/jbossws-core/src/java/org/jboss/ws/tools/WSDLToJava.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/tools/WSDLToJava.java 2007-04-23 17:38:29 UTC (rev 2904)
+++ trunk/jbossws-core/src/java/org/jboss/ws/tools/WSDLToJava.java 2007-04-23 19:29:38 UTC (rev 2905)
@@ -378,13 +378,12 @@
boolean holder = false;
if (input != null && input.getElement() != null)
{
- QName xmlName = input.getElement();
- QName xmlType = input.getXMLType();
- JBossXSModel xsmodel = WSDLUtils.getSchemaModel(wsdl.getWsdlTypes());
- XSTypeDefinition xt = xsmodel.getTypeDefinition(xmlType.getLocalPart(), xmlType.getNamespaceURI());
-
+ QName xmlName = input.getElement();
+ holder = output != null && xmlName.equals(output.getElement());
+
appendParameters(paramBuffer, input, output, xmlName.getLocalPart());
}
+
if (!holder && output != null && output.getElement() != null)
{
QName xmlName = output.getElement();
Modified: trunk/jbossws-core/src/java/org/jboss/ws/tools/helpers/MappingFileGeneratorHelper.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/tools/helpers/MappingFileGeneratorHelper.java 2007-04-23 17:38:29 UTC (rev 2904)
+++ trunk/jbossws-core/src/java/org/jboss/ws/tools/helpers/MappingFileGeneratorHelper.java 2007-04-23 19:29:38 UTC (rev 2905)
@@ -227,8 +227,13 @@
private void constructDOCParameters(ServiceEndpointMethodMapping semm, WSDLInterfaceOperation wiop)
{
WSDLInterfaceOperationInput win = WSDLUtils.getWsdl11Input(wiop);
+ WSDLInterfaceOperationOutput output = WSDLUtils.getWsdl11Output(wiop);
+
JBossXSModel schemaModel = WSDLUtils.getSchemaModel(wsdlDefinitions.getWsdlTypes());
MethodParamPartsMapping mpin = null;
+
+ boolean holder = false;
+
if (win != null)
{
QName xmlName = win.getElement();
@@ -248,14 +253,19 @@
{
if (xt instanceof XSSimpleTypeDefinition)
xmlType = SchemaUtils.handleSimpleType((XSSimpleTypeDefinition)xt);
+ String paramMode = "IN";
+ holder = output != null && xmlName.equals(output.getElement());
+ if (holder == true)
+ {
+ paramMode = "INOUT";
+ }
- mpin = getMethodParamPartsMapping(semm, xmlName, xmlType, 0, wsdlMessageName, "IN", partName, false, true);
+ mpin = getMethodParamPartsMapping(semm, xmlName, xmlType, 0, wsdlMessageName, paramMode, partName, false, true);
semm.addMethodParamPartsMapping(mpin);
}
}
- WSDLInterfaceOperationOutput output = WSDLUtils.getWsdl11Output(wiop);
- if (output != null)
+ if (holder == false && output != null)
{
QName xmlName = output.getElement();
QName xmlType = output.getXMLType();
@@ -755,8 +765,10 @@
if (javaType == null)
{
- if(log.isDebugEnabled()) log.debug("Typemapping lookup failed for " + xmlName);
- if(log.isDebugEnabled()) log.debug("Falling back to identifier generation");
+ if (log.isDebugEnabled())
+ log.debug("Typemapping lookup failed for " + xmlName);
+ if (log.isDebugEnabled())
+ log.debug("Falling back to identifier generation");
String className = xmlType.getLocalPart();
if (className.charAt(0) == '>')
className = className.substring(1);
Copied: trunk/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws1607 (from rev 2801, branches/dlofthouse/JBWS-1607/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws1607)
Deleted: trunk/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws1607/JBWS1607TestCase.java
===================================================================
--- branches/dlofthouse/JBWS-1607/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws1607/JBWS1607TestCase.java 2007-04-11 16:31:45 UTC (rev 2801)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws1607/JBWS1607TestCase.java 2007-04-23 19:29:38 UTC (rev 2905)
@@ -1,107 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2007, 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.tools.jbws1607;
-
-import java.io.File;
-import java.io.FilenameFilter;
-
-import org.jboss.test.ws.JBossWSTest;
-import org.jboss.test.ws.tools.fixture.JBossSourceComparator;
-import org.jboss.test.ws.tools.validation.JaxrpcMappingValidator;
-import org.jboss.ws.tools.WSTools;
-
-/**
- * Test case for http://jira.jboss.com/jira/browse/JBWS-1607
- *
- * WSDL to Java, If an INOUT parameter has been mapped to a
- * JAX-RPC holder it should not also be mapped to the return
- * type.
- *
- * @author darran.lofthouse(a)jboss.com
- * @since 11 Apr 2007
- */
-public class JBWS1607TestCase extends JBossWSTest
-{
-
- /**
- * Test generation of the SEI.
- *
- * @throws Exception
- */
- public void testGenerate() throws Exception
- {
- String resourceDir = "resources/tools/jbws1607";
- String toolsDir = "tools/jbws1607";
- String[] args = new String[] { "-dest", toolsDir, "-config", resourceDir + "/wstools-config.xml" };
- new WSTools().generate(args);
-
- File resourceDirFile = new File(resourceDir);
- String[] expectedFiles = resourceDirFile.list(new FilenameFilter() {
- public boolean accept(File dir, String name)
- {
- return name.endsWith(".java");
- }
- });
-
- for (int i = 0; i < expectedFiles.length; i++)
- {
- String currentFile = expectedFiles[i];
-
- try
- {
- compareSource(resourceDir + "/" + currentFile, toolsDir + "/org/jboss/test/ws/jbws1607/" + currentFile);
- }
- catch (Exception e)
- {
- throw new Exception("Validation of '" + currentFile + "' failed.", e);
- }
- }
-
- File packageDir = new File(toolsDir + "/org/jboss/test/ws/jbws1607");
- String[] generatedFiles = packageDir.list();
- for (int i = 0; i < generatedFiles.length; i++)
- {
- String currentFile = generatedFiles[i];
-
- boolean matched = "PhoneBookService.java".equals(currentFile);
-
- for (int j = 0; j < expectedFiles.length && (matched == false); j++)
- matched = currentFile.equals(expectedFiles[j]);
-
- assertTrue("File '" + currentFile + "' was not expected to be generated", matched);
- }
-
- JaxrpcMappingValidator mappingValidator = new JaxrpcMappingValidator();
- mappingValidator.validate(resourceDir + "/jaxrpc-mapping.xml", toolsDir + "/jaxrpc-mapping.xml");
-
- }
-
- private static void compareSource(final String expectedName, final String generatedName) throws Exception
- {
- File expected = new File(expectedName);
- File generated = new File(generatedName);
-
- JBossSourceComparator sc = new JBossSourceComparator(expected, generated);
- sc.validate();
- sc.validateImports();
- }
-}
Copied: trunk/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws1607/JBWS1607TestCase.java (from rev 2801, branches/dlofthouse/JBWS-1607/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws1607/JBWS1607TestCase.java)
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws1607/JBWS1607TestCase.java (rev 0)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws1607/JBWS1607TestCase.java 2007-04-23 19:29:38 UTC (rev 2905)
@@ -0,0 +1,107 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, 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.tools.jbws1607;
+
+import java.io.File;
+import java.io.FilenameFilter;
+
+import org.jboss.test.ws.JBossWSTest;
+import org.jboss.test.ws.tools.fixture.JBossSourceComparator;
+import org.jboss.test.ws.tools.validation.JaxrpcMappingValidator;
+import org.jboss.ws.tools.WSTools;
+
+/**
+ * Test case for http://jira.jboss.com/jira/browse/JBWS-1607
+ *
+ * WSDL to Java, If an INOUT parameter has been mapped to a
+ * JAX-RPC holder it should not also be mapped to the return
+ * type.
+ *
+ * @author darran.lofthouse(a)jboss.com
+ * @since 11 Apr 2007
+ */
+public class JBWS1607TestCase extends JBossWSTest
+{
+
+ /**
+ * Test generation of the SEI.
+ *
+ * @throws Exception
+ */
+ public void testGenerate() throws Exception
+ {
+ String resourceDir = "resources/tools/jbws1607";
+ String toolsDir = "tools/jbws1607";
+ String[] args = new String[] { "-dest", toolsDir, "-config", resourceDir + "/wstools-config.xml" };
+ new WSTools().generate(args);
+
+ File resourceDirFile = new File(resourceDir);
+ String[] expectedFiles = resourceDirFile.list(new FilenameFilter() {
+ public boolean accept(File dir, String name)
+ {
+ return name.endsWith(".java");
+ }
+ });
+
+ for (int i = 0; i < expectedFiles.length; i++)
+ {
+ String currentFile = expectedFiles[i];
+
+ try
+ {
+ compareSource(resourceDir + "/" + currentFile, toolsDir + "/org/jboss/test/ws/jbws1607/" + currentFile);
+ }
+ catch (Exception e)
+ {
+ throw new Exception("Validation of '" + currentFile + "' failed.", e);
+ }
+ }
+
+ File packageDir = new File(toolsDir + "/org/jboss/test/ws/jbws1607");
+ String[] generatedFiles = packageDir.list();
+ for (int i = 0; i < generatedFiles.length; i++)
+ {
+ String currentFile = generatedFiles[i];
+
+ boolean matched = "PhoneBookService.java".equals(currentFile);
+
+ for (int j = 0; j < expectedFiles.length && (matched == false); j++)
+ matched = currentFile.equals(expectedFiles[j]);
+
+ assertTrue("File '" + currentFile + "' was not expected to be generated", matched);
+ }
+
+ JaxrpcMappingValidator mappingValidator = new JaxrpcMappingValidator();
+ mappingValidator.validate(resourceDir + "/jaxrpc-mapping.xml", toolsDir + "/jaxrpc-mapping.xml");
+
+ }
+
+ private static void compareSource(final String expectedName, final String generatedName) throws Exception
+ {
+ File expected = new File(expectedName);
+ File generated = new File(generatedName);
+
+ JBossSourceComparator sc = new JBossSourceComparator(expected, generated);
+ sc.validate();
+ sc.validateImports();
+ }
+}
Copied: trunk/jbossws-tests/src/resources/tools/jbws1607 (from rev 2801, branches/dlofthouse/JBWS-1607/jbossws-tests/src/resources/tools/jbws1607)
Deleted: trunk/jbossws-tests/src/resources/tools/jbws1607/PhoneBook.wsdl
===================================================================
--- branches/dlofthouse/JBWS-1607/jbossws-tests/src/resources/tools/jbws1607/PhoneBook.wsdl 2007-04-11 16:31:45 UTC (rev 2801)
+++ trunk/jbossws-tests/src/resources/tools/jbws1607/PhoneBook.wsdl 2007-04-23 19:29:38 UTC (rev 2905)
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<definitions name='PhoneBook' targetNamespace='http://test.jboss.org/ws/jbws1607' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:ns1='http://test.jboss.org/ws/jbws1607/types' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://test.jboss.org/ws/jbws1607' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
-
- <types>
- <schema targetNamespace='http://test.jboss.org/ws/jbws1607/types' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://test.jboss.org/ws/jbws1607/types' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
- <element name='lookup' type='string'/>
- </schema>
- </types>
-
- <message name='PhoneBook_lookup'>
- <part element='ns1:lookup' name='lookup'/>
- </message>
- <message name='PhoneBook_lookupResponse'>
- <part element='ns1:lookup' name='lookup'/>
- </message>
-
- <portType name='PhoneBook'>
- <operation name='lookup'>
- <input message='tns:PhoneBook_lookup'/>
- <output message='tns:PhoneBook_lookupResponse'/>
- </operation>
- </portType>
- <binding name='PhoneBookBinding' type='tns:PhoneBook'>
- <soap:binding style='document' transport='http://schemas.xmlsoap.org/soap/http'/>
- <operation name='lookup'>
- <soap:operation soapAction=''/>
- <input>
- <soap:body use='literal'/>
- </input>
- <output>
- <soap:body use='literal'/>
- </output>
- </operation>
- </binding>
- <service name='PhoneBook'>
- <port binding='tns:PhoneBookBinding' name='PhoneBookPort'>
- <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
- </port>
- </service>
-</definitions>
Copied: trunk/jbossws-tests/src/resources/tools/jbws1607/PhoneBook.wsdl (from rev 2801, branches/dlofthouse/JBWS-1607/jbossws-tests/src/resources/tools/jbws1607/PhoneBook.wsdl)
===================================================================
--- trunk/jbossws-tests/src/resources/tools/jbws1607/PhoneBook.wsdl (rev 0)
+++ trunk/jbossws-tests/src/resources/tools/jbws1607/PhoneBook.wsdl 2007-04-23 19:29:38 UTC (rev 2905)
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name='PhoneBook' targetNamespace='http://test.jboss.org/ws/jbws1607' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:ns1='http://test.jboss.org/ws/jbws1607/types' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://test.jboss.org/ws/jbws1607' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
+
+ <types>
+ <schema targetNamespace='http://test.jboss.org/ws/jbws1607/types' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://test.jboss.org/ws/jbws1607/types' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
+ <element name='lookup' type='string'/>
+ </schema>
+ </types>
+
+ <message name='PhoneBook_lookup'>
+ <part element='ns1:lookup' name='lookup'/>
+ </message>
+ <message name='PhoneBook_lookupResponse'>
+ <part element='ns1:lookup' name='lookup'/>
+ </message>
+
+ <portType name='PhoneBook'>
+ <operation name='lookup'>
+ <input message='tns:PhoneBook_lookup'/>
+ <output message='tns:PhoneBook_lookupResponse'/>
+ </operation>
+ </portType>
+ <binding name='PhoneBookBinding' type='tns:PhoneBook'>
+ <soap:binding style='document' transport='http://schemas.xmlsoap.org/soap/http'/>
+ <operation name='lookup'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body use='literal'/>
+ </input>
+ <output>
+ <soap:body use='literal'/>
+ </output>
+ </operation>
+ </binding>
+ <service name='PhoneBook'>
+ <port binding='tns:PhoneBookBinding' name='PhoneBookPort'>
+ <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
+ </port>
+ </service>
+</definitions>
Deleted: trunk/jbossws-tests/src/resources/tools/jbws1607/PhoneBook_PortType.java
===================================================================
--- branches/dlofthouse/JBWS-1607/jbossws-tests/src/resources/tools/jbws1607/PhoneBook_PortType.java 2007-04-11 16:31:45 UTC (rev 2801)
+++ trunk/jbossws-tests/src/resources/tools/jbws1607/PhoneBook_PortType.java 2007-04-23 19:29:38 UTC (rev 2905)
@@ -1,15 +0,0 @@
-/*
- * JBossWS WS-Tools Generated Source
- *
- * Generation Date: Wed Apr 11 17:06:28 CEST 2007
- *
- * This generated source code represents a derivative work of the input to
- * the generator that produced it. Consult the input for the copyright and
- * terms of use that apply to this source code.
- */
-package org.jboss.test.ws.jbws1607;
-public interface PhoneBook_PortType extends java.rmi.Remote
-{
-
- public void lookup(javax.xml.rpc.holders.StringHolder lookup) throws java.rmi.RemoteException;
-}
Copied: trunk/jbossws-tests/src/resources/tools/jbws1607/PhoneBook_PortType.java (from rev 2801, branches/dlofthouse/JBWS-1607/jbossws-tests/src/resources/tools/jbws1607/PhoneBook_PortType.java)
===================================================================
--- trunk/jbossws-tests/src/resources/tools/jbws1607/PhoneBook_PortType.java (rev 0)
+++ trunk/jbossws-tests/src/resources/tools/jbws1607/PhoneBook_PortType.java 2007-04-23 19:29:38 UTC (rev 2905)
@@ -0,0 +1,15 @@
+/*
+ * JBossWS WS-Tools Generated Source
+ *
+ * Generation Date: Wed Apr 11 17:06:28 CEST 2007
+ *
+ * This generated source code represents a derivative work of the input to
+ * the generator that produced it. Consult the input for the copyright and
+ * terms of use that apply to this source code.
+ */
+package org.jboss.test.ws.jbws1607;
+public interface PhoneBook_PortType extends java.rmi.Remote
+{
+
+ public void lookup(javax.xml.rpc.holders.StringHolder lookup) throws java.rmi.RemoteException;
+}
Deleted: trunk/jbossws-tests/src/resources/tools/jbws1607/jaxrpc-mapping.xml
===================================================================
--- branches/dlofthouse/JBWS-1607/jbossws-tests/src/resources/tools/jbws1607/jaxrpc-mapping.xml 2007-04-11 16:31:45 UTC (rev 2801)
+++ trunk/jbossws-tests/src/resources/tools/jbws1607/jaxrpc-mapping.xml 2007-04-23 19:29:38 UTC (rev 2905)
@@ -1,32 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?><java-wsdl-mapping version='1.1' 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://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd'>
- <package-mapping xmlns='http://java.sun.com/xml/ns/j2ee'>
- <package-type xmlns='http://java.sun.com/xml/ns/j2ee'>org.jboss.test.ws.jbws1607</package-type>
- <namespaceURI xmlns='http://java.sun.com/xml/ns/j2ee'>http://test.jboss.org/ws/jbws1607</namespaceURI>
- </package-mapping>
- <service-interface-mapping xmlns='http://java.sun.com/xml/ns/j2ee'>
- <service-interface xmlns='http://java.sun.com/xml/ns/j2ee'>org.jboss.test.ws.jbws1607.PhoneBook_Service</service-interface>
- <wsdl-service-name xmlns:serviceNS='http://test.jboss.org/ws/jbws1607' xmlns='http://java.sun.com/xml/ns/j2ee'>serviceNS:PhoneBook</wsdl-service-name>
- <port-mapping xmlns='http://java.sun.com/xml/ns/j2ee'>
- <port-name xmlns='http://java.sun.com/xml/ns/j2ee'>PhoneBookPort</port-name>
- <java-port-name xmlns='http://java.sun.com/xml/ns/j2ee'>PhoneBookPort</java-port-name>
- </port-mapping>
- </service-interface-mapping>
- <service-endpoint-interface-mapping xmlns='http://java.sun.com/xml/ns/j2ee'>
- <service-endpoint-interface xmlns='http://java.sun.com/xml/ns/j2ee'>org.jboss.test.ws.jbws1607.PhoneBook_PortType</service-endpoint-interface>
- <wsdl-port-type xmlns:portTypeNS='http://test.jboss.org/ws/jbws1607' xmlns='http://java.sun.com/xml/ns/j2ee'>portTypeNS:PhoneBook</wsdl-port-type>
- <wsdl-binding xmlns:bindingNS='http://test.jboss.org/ws/jbws1607' xmlns='http://java.sun.com/xml/ns/j2ee'>bindingNS:PhoneBookBinding</wsdl-binding>
- <service-endpoint-method-mapping xmlns='http://java.sun.com/xml/ns/j2ee'>
- <java-method-name xmlns='http://java.sun.com/xml/ns/j2ee'>lookup</java-method-name>
- <wsdl-operation xmlns='http://java.sun.com/xml/ns/j2ee'>lookup</wsdl-operation>
- <method-param-parts-mapping xmlns='http://java.sun.com/xml/ns/j2ee'>
- <param-position xmlns='http://java.sun.com/xml/ns/j2ee'>0</param-position>
- <param-type xmlns='http://java.sun.com/xml/ns/j2ee'>java.lang.String</param-type>
- <wsdl-message-mapping xmlns='http://java.sun.com/xml/ns/j2ee'>
- <wsdl-message xmlns:wsdlMsgNS='http://test.jboss.org/ws/jbws1607' xmlns='http://java.sun.com/xml/ns/j2ee'>wsdlMsgNS:PhoneBook_lookup</wsdl-message>
- <wsdl-message-part-name xmlns='http://java.sun.com/xml/ns/j2ee'>lookup</wsdl-message-part-name>
- <parameter-mode xmlns='http://java.sun.com/xml/ns/j2ee'>INOUT</parameter-mode>
- </wsdl-message-mapping>
- </method-param-parts-mapping>
- </service-endpoint-method-mapping>
- </service-endpoint-interface-mapping>
-</java-wsdl-mapping>
\ No newline at end of file
Copied: trunk/jbossws-tests/src/resources/tools/jbws1607/jaxrpc-mapping.xml (from rev 2801, branches/dlofthouse/JBWS-1607/jbossws-tests/src/resources/tools/jbws1607/jaxrpc-mapping.xml)
===================================================================
--- trunk/jbossws-tests/src/resources/tools/jbws1607/jaxrpc-mapping.xml (rev 0)
+++ trunk/jbossws-tests/src/resources/tools/jbws1607/jaxrpc-mapping.xml 2007-04-23 19:29:38 UTC (rev 2905)
@@ -0,0 +1,32 @@
+<?xml version='1.0' encoding='UTF-8'?><java-wsdl-mapping version='1.1' 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://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd'>
+ <package-mapping xmlns='http://java.sun.com/xml/ns/j2ee'>
+ <package-type xmlns='http://java.sun.com/xml/ns/j2ee'>org.jboss.test.ws.jbws1607</package-type>
+ <namespaceURI xmlns='http://java.sun.com/xml/ns/j2ee'>http://test.jboss.org/ws/jbws1607</namespaceURI>
+ </package-mapping>
+ <service-interface-mapping xmlns='http://java.sun.com/xml/ns/j2ee'>
+ <service-interface xmlns='http://java.sun.com/xml/ns/j2ee'>org.jboss.test.ws.jbws1607.PhoneBook_Service</service-interface>
+ <wsdl-service-name xmlns:serviceNS='http://test.jboss.org/ws/jbws1607' xmlns='http://java.sun.com/xml/ns/j2ee'>serviceNS:PhoneBook</wsdl-service-name>
+ <port-mapping xmlns='http://java.sun.com/xml/ns/j2ee'>
+ <port-name xmlns='http://java.sun.com/xml/ns/j2ee'>PhoneBookPort</port-name>
+ <java-port-name xmlns='http://java.sun.com/xml/ns/j2ee'>PhoneBookPort</java-port-name>
+ </port-mapping>
+ </service-interface-mapping>
+ <service-endpoint-interface-mapping xmlns='http://java.sun.com/xml/ns/j2ee'>
+ <service-endpoint-interface xmlns='http://java.sun.com/xml/ns/j2ee'>org.jboss.test.ws.jbws1607.PhoneBook_PortType</service-endpoint-interface>
+ <wsdl-port-type xmlns:portTypeNS='http://test.jboss.org/ws/jbws1607' xmlns='http://java.sun.com/xml/ns/j2ee'>portTypeNS:PhoneBook</wsdl-port-type>
+ <wsdl-binding xmlns:bindingNS='http://test.jboss.org/ws/jbws1607' xmlns='http://java.sun.com/xml/ns/j2ee'>bindingNS:PhoneBookBinding</wsdl-binding>
+ <service-endpoint-method-mapping xmlns='http://java.sun.com/xml/ns/j2ee'>
+ <java-method-name xmlns='http://java.sun.com/xml/ns/j2ee'>lookup</java-method-name>
+ <wsdl-operation xmlns='http://java.sun.com/xml/ns/j2ee'>lookup</wsdl-operation>
+ <method-param-parts-mapping xmlns='http://java.sun.com/xml/ns/j2ee'>
+ <param-position xmlns='http://java.sun.com/xml/ns/j2ee'>0</param-position>
+ <param-type xmlns='http://java.sun.com/xml/ns/j2ee'>java.lang.String</param-type>
+ <wsdl-message-mapping xmlns='http://java.sun.com/xml/ns/j2ee'>
+ <wsdl-message xmlns:wsdlMsgNS='http://test.jboss.org/ws/jbws1607' xmlns='http://java.sun.com/xml/ns/j2ee'>wsdlMsgNS:PhoneBook_lookup</wsdl-message>
+ <wsdl-message-part-name xmlns='http://java.sun.com/xml/ns/j2ee'>lookup</wsdl-message-part-name>
+ <parameter-mode xmlns='http://java.sun.com/xml/ns/j2ee'>INOUT</parameter-mode>
+ </wsdl-message-mapping>
+ </method-param-parts-mapping>
+ </service-endpoint-method-mapping>
+ </service-endpoint-interface-mapping>
+</java-wsdl-mapping>
\ No newline at end of file
Deleted: trunk/jbossws-tests/src/resources/tools/jbws1607/wstools-config.xml
===================================================================
--- branches/dlofthouse/JBWS-1607/jbossws-tests/src/resources/tools/jbws1607/wstools-config.xml 2007-04-11 16:31:45 UTC (rev 2801)
+++ trunk/jbossws-tests/src/resources/tools/jbws1607/wstools-config.xml 2007-04-23 19:29:38 UTC (rev 2905)
@@ -1,5 +0,0 @@
-<configuration>
- <wsdl-java location="resources/tools/jbws1607/PhoneBook.wsdl" parameter-style="bare">
- <mapping file="jaxrpc-mapping.xml"/>
- </wsdl-java>
-</configuration>
Copied: trunk/jbossws-tests/src/resources/tools/jbws1607/wstools-config.xml (from rev 2801, branches/dlofthouse/JBWS-1607/jbossws-tests/src/resources/tools/jbws1607/wstools-config.xml)
===================================================================
--- trunk/jbossws-tests/src/resources/tools/jbws1607/wstools-config.xml (rev 0)
+++ trunk/jbossws-tests/src/resources/tools/jbws1607/wstools-config.xml 2007-04-23 19:29:38 UTC (rev 2905)
@@ -0,0 +1,5 @@
+<configuration>
+ <wsdl-java location="resources/tools/jbws1607/PhoneBook.wsdl" parameter-style="bare">
+ <mapping file="jaxrpc-mapping.xml"/>
+ </wsdl-java>
+</configuration>
17 years, 8 months
JBossWS SVN: r2904 - in trunk: integration-jboss42 and 5 other directories.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2007-04-23 13:38:29 -0400 (Mon, 23 Apr 2007)
New Revision: 2904
Modified:
trunk/integration-jboss40/.classpath
trunk/integration-jboss42/.classpath
trunk/integration-jboss50/.classpath
trunk/integration-tomcat/.classpath
trunk/jbossws-api/.classpath
trunk/jbossws-core/.classpath
trunk/jbossws-tests/.classpath
Log:
Fix Eclipse classpath settings.
Modified: trunk/integration-jboss40/.classpath
===================================================================
--- trunk/integration-jboss40/.classpath 2007-04-23 15:48:48 UTC (rev 2903)
+++ trunk/integration-jboss40/.classpath 2007-04-23 17:38:29 UTC (rev 2904)
@@ -3,6 +3,7 @@
<classpathentry kind="src" path="src/java"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry combineaccessrules="false" kind="src" path="/jbossws-core"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/integration"/>
<classpathentry combineaccessrules="false" kind="src" path="/integration-jboss42"/>
<classpathentry kind="lib" path="/build/thirdparty/ant.jar"/>
<classpathentry kind="lib" path="/build/thirdparty/activation.jar"/>
@@ -29,7 +30,7 @@
<classpathentry kind="lib" path="/build/thirdparty/xalan.jar" sourcepath="/usr/java/xalan-j_2_7_0/src"/>
<classpathentry kind="lib" path="/build/thirdparty/xercesImpl.jar"/>
<classpathentry kind="lib" path="/build/thirdparty/mail.jar"/>
- <classpathentry kind="lib" path="/build/thirdparty/jboss-common.jar" sourcepath="/build/thirdparty/jboss-common-sources.jar"/>
+ <classpathentry kind="lib" path="/build/thirdparty/jboss-common-core.jar" sourcepath="/build/thirdparty/jboss-common-core-sources.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/jboss-4.0.x"/>
<classpathentry kind="output" path="output-eclipse"/>
</classpath>
Modified: trunk/integration-jboss42/.classpath
===================================================================
--- trunk/integration-jboss42/.classpath 2007-04-23 15:48:48 UTC (rev 2903)
+++ trunk/integration-jboss42/.classpath 2007-04-23 17:38:29 UTC (rev 2904)
@@ -3,6 +3,8 @@
<classpathentry kind="src" path="src/java"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/jboss-4.2.x"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/integration"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/jbossws-api"/>
<classpathentry combineaccessrules="false" kind="src" path="/jbossws-core"/>
<classpathentry kind="lib" path="/build/thirdparty/ant.jar"/>
<classpathentry kind="lib" path="/build/thirdparty/activation.jar"/>
@@ -28,6 +30,6 @@
<classpathentry kind="lib" path="/build/thirdparty/xercesImpl.jar"/>
<classpathentry kind="lib" path="/build/thirdparty/mail.jar"/>
<classpathentry kind="lib" path="/build/thirdparty/jbosssx-client.jar" sourcepath="/build/thirdparty/jbosssx-src.zip"/>
- <classpathentry kind="lib" path="/build/thirdparty/jboss-common.jar" sourcepath="/build/thirdparty/jboss-common-sources.jar"/>
+ <classpathentry kind="lib" path="/build/thirdparty/jboss-common-core.jar" sourcepath="/build/thirdparty/jboss-common-core-sources.jar"/>
<classpathentry kind="output" path="output-eclipse"/>
</classpath>
Modified: trunk/integration-jboss50/.classpath
===================================================================
--- trunk/integration-jboss50/.classpath 2007-04-23 15:48:48 UTC (rev 2903)
+++ trunk/integration-jboss50/.classpath 2007-04-23 17:38:29 UTC (rev 2904)
@@ -2,6 +2,8 @@
<classpath>
<classpathentry kind="src" path="src/java"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/integration"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/jbossws-api"/>
<classpathentry combineaccessrules="false" kind="src" path="/jbossws-core"/>
<classpathentry kind="lib" path="/build/thirdparty/jboss-vfs.jar" sourcepath="/build/thirdparty/jboss-vfs-sources.jar"/>
<classpathentry kind="lib" path="/build/thirdparty/ant.jar"/>
@@ -29,6 +31,6 @@
<classpathentry kind="lib" path="/build/thirdparty/mail.jar"/>
<classpathentry kind="lib" path="/build/thirdparty/jbosssx-client.jar" sourcepath="/build/thirdparty/jbosssx-src.zip"/>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/jboss-5.0.x"/>
- <classpathentry kind="lib" path="/build/thirdparty/jboss-common.jar" sourcepath="/build/thirdparty/jboss-common-sources.jar"/>
+ <classpathentry kind="lib" path="/build/thirdparty/jboss-common-core.jar" sourcepath="/build/thirdparty/jboss-common-core-sources.jar"/>
<classpathentry kind="output" path="output-eclipse"/>
</classpath>
Modified: trunk/integration-tomcat/.classpath
===================================================================
--- trunk/integration-tomcat/.classpath 2007-04-23 15:48:48 UTC (rev 2903)
+++ trunk/integration-tomcat/.classpath 2007-04-23 17:38:29 UTC (rev 2904)
@@ -2,6 +2,7 @@
<classpath>
<classpathentry kind="src" path="src/java"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/integration"/>
<classpathentry combineaccessrules="false" kind="src" path="/jbossws-core"/>
<classpathentry kind="lib" path="/build/thirdparty/ant.jar"/>
<classpathentry kind="lib" path="/build/thirdparty/activation.jar"/>
@@ -28,6 +29,6 @@
<classpathentry kind="lib" path="/build/thirdparty/xalan.jar"/>
<classpathentry kind="lib" path="/build/thirdparty/xercesImpl.jar"/>
<classpathentry kind="lib" path="/build/thirdparty/mail.jar"/>
- <classpathentry kind="lib" path="/build/thirdparty/jboss-common.jar" sourcepath="/build/thirdparty/jboss-common-sources.jar"/>
+ <classpathentry kind="lib" path="/build/thirdparty/jboss-common-core.jar" sourcepath="/build/thirdparty/jboss-common-core-sources.jar"/>
<classpathentry kind="output" path="output-eclipse"/>
</classpath>
Modified: trunk/jbossws-api/.classpath
===================================================================
--- trunk/jbossws-api/.classpath 2007-04-23 15:48:48 UTC (rev 2903)
+++ trunk/jbossws-api/.classpath 2007-04-23 17:38:29 UTC (rev 2904)
@@ -1,11 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src/main/java"/>
- <classpathentry kind="src" path="src/test/java"/>
+ <classpathentry kind="src" path="src/java"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3.8.1"/>
+ <classpathentry kind="lib" path="/build/thirdparty/activation.jar"/>
+ <classpathentry kind="lib" path="/build/thirdparty/jaxb-api.jar"/>
<classpathentry kind="lib" path="/build/thirdparty/jboss-common-core.jar"/>
<classpathentry kind="lib" path="/build/thirdparty/jboss-logging-log4j.jar"/>
<classpathentry kind="lib" path="/build/thirdparty/jboss-logging-spi.jar"/>
+ <classpathentry kind="lib" path="/build/thirdparty/servlet-api.jar"/>
+ <classpathentry kind="lib" path="/build/thirdparty/stax-api.jar"/>
<classpathentry kind="output" path="output-eclipse"/>
</classpath>
Modified: trunk/jbossws-core/.classpath
===================================================================
--- trunk/jbossws-core/.classpath 2007-04-23 15:48:48 UTC (rev 2903)
+++ trunk/jbossws-core/.classpath 2007-04-23 17:38:29 UTC (rev 2904)
@@ -2,6 +2,7 @@
<classpath>
<classpathentry kind="src" path="src/java"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/integration"/>
<classpathentry kind="lib" path="/build/thirdparty/ant.jar"/>
<classpathentry kind="lib" path="/build/thirdparty/activation.jar"/>
<classpathentry kind="lib" path="/build/thirdparty/commons-logging.jar"/>
@@ -30,7 +31,7 @@
<classpathentry kind="lib" path="/build/thirdparty/jbosssx-client.jar" sourcepath="/build/thirdparty/jbosssx-src.zip"/>
<classpathentry kind="lib" path="/build/thirdparty/wstx.jar"/>
<classpathentry kind="lib" path="/build/thirdparty/getopt.jar"/>
- <classpathentry kind="lib" path="/build/thirdparty/jboss-common.jar" sourcepath="/build/thirdparty/jboss-common-sources.jar"/>
+ <classpathentry kind="lib" path="/build/thirdparty/jboss-common-core.jar" sourcepath="/build/thirdparty/jboss-common-core-sources.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/jbossws-api"/>
<classpathentry kind="output" path="output-eclipse"/>
</classpath>
Modified: trunk/jbossws-tests/.classpath
===================================================================
--- trunk/jbossws-tests/.classpath 2007-04-23 15:48:48 UTC (rev 2903)
+++ trunk/jbossws-tests/.classpath 2007-04-23 17:38:29 UTC (rev 2904)
@@ -5,8 +5,10 @@
<classpathentry kind="src" path="output/wstools/java"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry combineaccessrules="false" kind="src" path="/build"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/integration"/>
<classpathentry combineaccessrules="false" kind="src" path="/integration-jboss50"/>
<classpathentry combineaccessrules="false" kind="src" path="/integration-tomcat"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/jbossws-api"/>
<classpathentry combineaccessrules="false" kind="src" path="/jbossws-core"/>
<classpathentry combineaccessrules="false" kind="src" path="/integration-jboss42"/>
<classpathentry kind="lib" path="/build/thirdparty/jboss-vfs.jar"/>
@@ -39,6 +41,6 @@
<classpathentry kind="lib" path="/build/thirdparty/mail.jar"/>
<classpathentry kind="lib" path="/build/thirdparty/jbosssx-client.jar" sourcepath="/build/thirdparty/jbosssx-src.zip"/>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/jboss-5.0.x"/>
- <classpathentry kind="lib" path="/build/thirdparty/jboss-common.jar" sourcepath="/build/thirdparty/jboss-common-sources.jar"/>
+ <classpathentry kind="lib" path="/build/thirdparty/jboss-common-core.jar" sourcepath="/build/thirdparty/jboss-common-core-sources.jar"/>
<classpathentry kind="output" path="output-eclipse"/>
</classpath>
17 years, 8 months
JBossWS SVN: r2903 - branches/jbossws-1.2.0.GA_JBWS-1610/jbossws-tests/src/main/java/org/jboss/test/ws/jaxrpc/jbws1610.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2007-04-23 11:48:48 -0400 (Mon, 23 Apr 2007)
New Revision: 2903
Modified:
branches/jbossws-1.2.0.GA_JBWS-1610/jbossws-tests/src/main/java/org/jboss/test/ws/jaxrpc/jbws1610/JBWS1610TestCase.java
branches/jbossws-1.2.0.GA_JBWS-1610/jbossws-tests/src/main/java/org/jboss/test/ws/jaxrpc/jbws1610/TestHandler.java
Log:
JBWS-1610 - Update handler to operate on response as well as request.
Modified: branches/jbossws-1.2.0.GA_JBWS-1610/jbossws-tests/src/main/java/org/jboss/test/ws/jaxrpc/jbws1610/JBWS1610TestCase.java
===================================================================
--- branches/jbossws-1.2.0.GA_JBWS-1610/jbossws-tests/src/main/java/org/jboss/test/ws/jaxrpc/jbws1610/JBWS1610TestCase.java 2007-04-23 15:20:46 UTC (rev 2902)
+++ branches/jbossws-1.2.0.GA_JBWS-1610/jbossws-tests/src/main/java/org/jboss/test/ws/jaxrpc/jbws1610/JBWS1610TestCase.java 2007-04-23 15:48:48 UTC (rev 2903)
@@ -67,8 +67,10 @@
DataObject response = port.echo(request);
assertNotNull(response);
- assertEquals("String Modifed By Handler", "XXFirst StringXX", response.getStringA());
- assertEquals("String Modifed By Handler", "XXSecond StringXX", response.getStringB());
+ assertEquals("String Modifed By Handler", "YYXXFirst StringXXYY", response.getStringA());
+ assertEquals("String Modifed By Handler", "YYXXSecond StringXXYY", response.getStringB());
+
+ System.out.println(response.getStringA() + " - " + response.getStringB());
}
}
Modified: branches/jbossws-1.2.0.GA_JBWS-1610/jbossws-tests/src/main/java/org/jboss/test/ws/jaxrpc/jbws1610/TestHandler.java
===================================================================
--- branches/jbossws-1.2.0.GA_JBWS-1610/jbossws-tests/src/main/java/org/jboss/test/ws/jaxrpc/jbws1610/TestHandler.java 2007-04-23 15:20:46 UTC (rev 2902)
+++ branches/jbossws-1.2.0.GA_JBWS-1610/jbossws-tests/src/main/java/org/jboss/test/ws/jaxrpc/jbws1610/TestHandler.java 2007-04-23 15:48:48 UTC (rev 2903)
@@ -46,10 +46,23 @@
{
/**
+ * Test handler to wrap all valued with 'YY' either side.
+ */
+ public boolean handleResponse(final MessageContext msgContext)
+ {
+ return handle(msgContext, "YY");
+ }
+
+ /**
* Test handler to wrap all valued with 'XX' either side.
*/
public boolean handleRequest(MessageContext msgContext)
{
+ return handle(msgContext, "XX");
+ }
+
+ private boolean handle(final MessageContext msgContext, final String letters)
+ {
try
{
SOAPMessage soapMessage = ((SOAPMessageContext)msgContext).getMessage();
@@ -76,7 +89,7 @@
SOAPElement element = (SOAPElement)it.next();
Name name = element.getElementName();
SOAPElement newElement = lookupEl.addChildElement(name);
- newElement.setValue("XX" + element.getValue() + "XX");
+ newElement.setValue(letters + element.getValue() + letters);
}
part.setContent(newPart.getContent());
@@ -88,7 +101,7 @@
throw new WSException("Error in handler", e);
}
- return super.handleRequest(msgContext);
+ return true;
}
public QName[] getHeaders()
17 years, 8 months
JBossWS SVN: r2902 - in branches/jbossws-2.0: jbossws-core/src/java/org/jboss/ws/core/server and 8 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-04-23 11:20:46 -0400 (Mon, 23 Apr 2007)
New Revision: 2902
Added:
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1619/
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1619/ClientHandler.java
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1619/JBWS1619TestCase.java
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1619/TestEndpoint.java
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1619/TestEndpointImpl.java
branches/jbossws-2.0/jbossws-tests/src/resources/jaxrpc/jbws1619/
Removed:
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1619/JBWS1093TestCase.java
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1619/ServletTest.java
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1619/TestEndpoint.java
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1619/TestEndpointImpl.java
Modified:
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/ServletEndpointContextImpl.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManager.java
branches/jbossws-2.0/jbossws-tests/ant-import/build-jars-jaxrpc.xml
branches/jbossws-2.0/jbossws-tests/src/resources/jaxrpc/jbws1619/META-INF/application-client.xml
branches/jbossws-2.0/jbossws-tests/src/resources/jaxrpc/jbws1619/META-INF/jboss-client.xml
branches/jbossws-2.0/jbossws-tests/src/resources/jaxrpc/jbws1619/WEB-INF/jaxrpc-mapping.xml
branches/jbossws-2.0/jbossws-tests/src/resources/jaxrpc/jbws1619/WEB-INF/web.xml
branches/jbossws-2.0/jbossws-tests/src/resources/jaxrpc/jbws1619/WEB-INF/webservices.xml
branches/jbossws-2.0/jbossws-tests/src/resources/jaxrpc/jbws1619/WEB-INF/wsdl/TestService.wsdl
branches/jbossws-2.0/jbossws-tests/src/resources/jaxrpc/jbws1619/wstools-config.xml
Log:
[JBWS-1619] ServletEndpointContext.getHttpSession always creates HTTPSession
Modified: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/ServletEndpointContextImpl.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/ServletEndpointContextImpl.java 2007-04-23 12:40:34 UTC (rev 2901)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/jaxrpc/ServletEndpointContextImpl.java 2007-04-23 15:20:46 UTC (rev 2902)
@@ -53,9 +53,22 @@
this.response = context.getHttpServletResponse();
}
+ /**
+ * The getHttpSession method returns the current HTTP session (as a javax.servlet.http.HTTPSession).
+ * When invoked by the service endpoint within a remote method implementation, the getHttpSession returns the HTTP
+ * session associated currently with this method invocation. This method returns null if there is no HTTP session
+ * currently active and associated with this service endpoint. An endpoint class should not rely on an active HTTP
+ * session being always there; the underlying JAX-RPC runtime system is responsible for managing whether or not there
+ * is an active HTTP session.
+ *
+ * The getHttpSession method throws JAXRPCException if invoked by an non HTTP bound endpoint.
+ *
+ * @return The HTTP session associated with the current invocation or null if there is no active session.
+ */
public HttpSession getHttpSession()
{
- return request.getSession();
+ // [JBWS-1619] ServletEndpointContext.getHttpSession has an incorrect implementation
+ return request.getSession(false);
}
public MessageContext getMessageContext()
Modified: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManager.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManager.java 2007-04-23 12:40:34 UTC (rev 2901)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/server/ServiceEndpointManager.java 2007-04-23 15:20:46 UTC (rev 2902)
@@ -400,8 +400,6 @@
public void processRequest(ObjectName sepID, InputStream inStream, OutputStream outStream, EndpointContext context) throws Exception
{
- final String SESSION_COOKIES = "org.jboss.ws.cookies";
-
ServiceEndpoint wsEndpoint = getServiceEndpointByID(sepID);
if (wsEndpoint == null)
throw new WSException("Cannot obtain endpoint for: " + sepID);
Modified: branches/jbossws-2.0/jbossws-tests/ant-import/build-jars-jaxrpc.xml
===================================================================
--- branches/jbossws-2.0/jbossws-tests/ant-import/build-jars-jaxrpc.xml 2007-04-23 12:40:34 UTC (rev 2901)
+++ branches/jbossws-2.0/jbossws-tests/ant-import/build-jars-jaxrpc.xml 2007-04-23 15:20:46 UTC (rev 2902)
@@ -2453,6 +2453,33 @@
</metainf>
</jar>
+ <!-- jbossws-jbws1619 -->
+ <war warfile="${tests.output.dir}/libs/jaxrpc-jbws1619.war" webxml="${tests.output.dir}/resources/jaxrpc/jbws1619/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/classes">
+ <include name="org/jboss/test/ws/jaxrpc/jbws1619/TestEndpoint.class"/>
+ <include name="org/jboss/test/ws/jaxrpc/jbws1619/TestEndpointImpl.class"/>
+ </classes>
+ <webinf dir="${tests.output.dir}/resources/jaxrpc/jbws1619/WEB-INF">
+ <include name="webservices.xml"/>
+ <include name="jaxrpc-mapping.xml"/>
+ <include name="wsdl/**"/>
+ </webinf>
+ </war>
+ <jar destfile="${tests.output.dir}/libs/jaxrpc-jbws1619-client.jar">
+ <fileset dir="${tests.output.dir}/classes">
+ <include name="org/jboss/test/ws/jbws1619/TestEndpoint.class"/>
+ <include name="org/jboss/test/ws/jbws1619/ClientHandler.class"/>
+ </fileset>
+ <metainf dir="${tests.output.dir}/resources/jaxrpc/jbws1619/META-INF">
+ <include name="application-client.xml"/>
+ <include name="jboss-client.xml"/>
+ </metainf>
+ <metainf dir="${tests.output.dir}/resources/jaxrpc/jbws1619/WEB-INF">
+ <include name="jaxrpc-mapping.xml"/>
+ <include name="wsdl/**"/>
+ </metainf>
+ </jar>
+
<!-- jaxrpc-marshall-doclit.war -->
<war warfile="${tests.output.dir}/libs/jaxrpc-marshall-doclit.war" webxml="${tests.output.dir}/resources/jaxrpc/marshall-doclit/WEB-INF/web.xml">
<classes dir="${tests.output.dir}/classes">
Copied: branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1619 (from rev 2899, branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1093)
Added: branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1619/ClientHandler.java
===================================================================
--- branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1619/ClientHandler.java (rev 0)
+++ branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1619/ClientHandler.java 2007-04-23 15:20:46 UTC (rev 2902)
@@ -0,0 +1,75 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.jaxrpc.jbws1619;
+
+import javax.xml.namespace.QName;
+import javax.xml.rpc.handler.GenericHandler;
+import javax.xml.rpc.handler.MessageContext;
+import javax.xml.rpc.handler.soap.SOAPMessageContext;
+import javax.xml.soap.MimeHeaders;
+
+import org.jboss.logging.Logger;
+
+/**
+ * A simple client side handler
+ *
+ * @author thomas.diesler(a)jboss.org
+ */
+public class ClientHandler extends GenericHandler
+{
+ // provide logging
+ private static final Logger log = Logger.getLogger(ClientHandler.class);
+
+ public static String message;
+ public static String cookie;
+
+ public QName[] getHeaders()
+ {
+ return new QName[0];
+ }
+
+ public boolean handleResponse(MessageContext msgContext)
+ {
+ log.info("handleResponse");
+
+ try
+ {
+ if ("Use MessageContext".equals(message))
+ {
+ SOAPMessageContext soapContext = (SOAPMessageContext)msgContext;
+ MimeHeaders mimeHeaders = soapContext.getMessage().getMimeHeaders();
+
+ String[] cookies = mimeHeaders.getHeader("Set-Cookie");
+ if (cookies == null || cookies.length != 1)
+ throw new IllegalStateException("Unexpected cookie list: " + mimeHeaders);
+
+ cookie = cookies[0];
+ }
+ }
+ catch (Exception e)
+ {
+ log.error("Handler processing error", e);
+ }
+
+ return true;
+ }
+}
Property changes on: branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1619/ClientHandler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1619/JBWS1093TestCase.java
===================================================================
--- branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1093/JBWS1093TestCase.java 2007-04-23 12:30:58 UTC (rev 2899)
+++ branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1619/JBWS1093TestCase.java 2007-04-23 15:20:46 UTC (rev 2902)
@@ -1,104 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.ws.jaxrpc.jbws1093;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.URL;
-
-import javax.naming.InitialContext;
-import javax.xml.namespace.QName;
-import javax.xml.rpc.Service;
-
-import junit.framework.Test;
-
-import org.jboss.test.ws.JBossWSTest;
-import org.jboss.test.ws.JBossWSTestSetup;
-import org.jboss.ws.core.jaxrpc.client.ServiceFactoryImpl;
-
-/**
- * Deploying a war that also contains normal servlets the web.xml is modified as if they are all endpoints
- *
- * http://jira.jboss.org/jira/browse/JBWS-1093
- *
- * @author darran.lofthouse(a)jboss.com
- * @since 17-October-2006
- */
-public class JBWS1093TestCase extends JBossWSTest
-{
-
- private static TestEndpoint port;
-
- public static Test suite() throws Exception
- {
- return JBossWSTestSetup.newTestSetup(JBWS1093TestCase.class, "jaxrpc-jbws1093.war, jaxrpc-jbws1093-client.jar");
- }
-
- public void setUp() throws Exception
- {
- super.setUp();
- if (port == null)
- {
- if (isTargetJBoss())
- {
- InitialContext iniCtx = getInitialContext();
- Service service = (Service)iniCtx.lookup("java:comp/env/service/TestService");
- port = (TestEndpoint)service.getPort(TestEndpoint.class);
- }
- else
- {
- ServiceFactoryImpl factory = new ServiceFactoryImpl();
- URL wsdlURL = new File("resources/jaxrpc/jbws1093/WEB-INF/wsdl/TestService.wsdl").toURL();
- URL mappingURL = new File("resources/jaxrpc/jbws1093/WEB-INF/jaxrpc-mapping.xml").toURL();
- QName qname = new QName("http://org.jboss.test.ws/jbws1093", "TestService");
- Service service = factory.createService(wsdlURL, qname, mappingURL);
- port = (TestEndpoint)service.getPort(TestEndpoint.class);
- }
- }
- }
-
- public void testAccessEnpoint() throws Exception
- {
- assertEquals(ServletTest.MESSAGE, port.echoString(ServletTest.MESSAGE));
- }
-
- public void testAccessServlet() throws Exception
- {
- if (true)
- {
- System.out.println("FIXME: [JBAS-4210] HTTP request dispatched to the wrong servlet");
- return;
- }
-
- URL servletURL = new URL("http://" + getServerHost() + ":8080" + "/jaxrpc-jbws1093/ServletTest");
-
- InputStream is = servletURL.openStream();
- InputStreamReader isr = new InputStreamReader(is);
- BufferedReader br = new BufferedReader(isr);
-
- String line = br.readLine();
-
- assertEquals(ServletTest.MESSAGE, line);
- }
-}
Added: branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1619/JBWS1619TestCase.java
===================================================================
--- branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1619/JBWS1619TestCase.java (rev 0)
+++ branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1619/JBWS1619TestCase.java 2007-04-23 15:20:46 UTC (rev 2902)
@@ -0,0 +1,92 @@
+/*
+ * 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.jaxrpc.jbws1619;
+
+import java.io.File;
+import java.net.URL;
+
+import javax.naming.InitialContext;
+import javax.xml.namespace.QName;
+import javax.xml.rpc.Service;
+
+import junit.framework.Test;
+
+import org.jboss.test.ws.JBossWSTest;
+import org.jboss.test.ws.JBossWSTestSetup;
+import org.jboss.ws.core.jaxrpc.client.ServiceFactoryImpl;
+
+/**
+ * ServletEndpointContext.getHttpSession has an incorrect implementation
+ *
+ * http://jira.jboss.org/jira/browse/JBWS-1619
+ *
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 23-Apr-2007
+ */
+public class JBWS1619TestCase extends JBossWSTest
+{
+
+ private static TestEndpoint port;
+
+ public static Test suite() throws Exception
+ {
+ return JBossWSTestSetup.newTestSetup(JBWS1619TestCase.class, "jaxrpc-jbws1619.war, jaxrpc-jbws1619-client.jar");
+ }
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ if (port == null)
+ {
+ if (isTargetJBoss())
+ {
+ InitialContext iniCtx = getInitialContext();
+ Service service = (Service)iniCtx.lookup("java:comp/env/service/TestService");
+ port = (TestEndpoint)service.getPort(TestEndpoint.class);
+ }
+ else
+ {
+ ServiceFactoryImpl factory = new ServiceFactoryImpl();
+ URL wsdlURL = new File("resources/jaxrpc/jbws1619/WEB-INF/wsdl/TestService.wsdl").toURL();
+ URL mappingURL = new File("resources/jaxrpc/jbws1619/WEB-INF/jaxrpc-mapping.xml").toURL();
+ QName qname = new QName("http://org.jboss.test.ws/jbws1619", "TestService");
+ Service service = factory.createService(wsdlURL, qname, mappingURL);
+ port = (TestEndpoint)service.getPort(TestEndpoint.class);
+ }
+ }
+ }
+
+ public void testServletEndpointContext() throws Exception
+ {
+ ClientHandler.message = "Use ServletEndpointContext";
+ String retStr = port.echoString(ClientHandler.message);
+ assertEquals("httpSession: null", retStr);
+ }
+
+ public void testMessageContext() throws Exception
+ {
+ ClientHandler.message = "Use MessageContext";
+ String retStr = port.echoString(ClientHandler.message);
+ assertTrue("Expect a session", retStr.startsWith("httpSession") && !retStr.endsWith("null"));
+ assertTrue("Expect a cookie", ClientHandler.cookie.startsWith("JSESSIONID"));
+ }
+}
Property changes on: branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1619/JBWS1619TestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1619/ServletTest.java
===================================================================
--- branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1093/ServletTest.java 2007-04-23 12:30:58 UTC (rev 2899)
+++ branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1619/ServletTest.java 2007-04-23 15:20:46 UTC (rev 2902)
@@ -1,49 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.ws.jaxrpc.jbws1093;
-
-import java.io.IOException;
-import java.io.PrintWriter;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-/**
- * JBWS-1093 - This servlet is called ServletTest to check that we are
- * not identifying servlets by the classname ending in 'Servlet'.
- *
- * @author darran.lofthouse(a)jboss.com
- * @since 17-October-2006
- */
-public class ServletTest extends HttpServlet
-{
- public static final String MESSAGE = "Success!!";
-
- protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
- {
- PrintWriter writer = response.getWriter();
- writer.println(MESSAGE);
- }
-
-}
Deleted: branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1619/TestEndpoint.java
===================================================================
--- branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1093/TestEndpoint.java 2007-04-23 12:30:58 UTC (rev 2899)
+++ branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1619/TestEndpoint.java 2007-04-23 15:20:46 UTC (rev 2902)
@@ -1,36 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.ws.jaxrpc.jbws1093;
-
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-
-/**
- * @author darran.lofthouse(a)jboss.com
- * @since 17-October-2006
- */
-public interface TestEndpoint extends Remote
-{
-
- public String echoString(final String message) throws RemoteException;
-
-}
Copied: branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1619/TestEndpoint.java (from rev 2901, branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1093/TestEndpoint.java)
===================================================================
--- branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1619/TestEndpoint.java (rev 0)
+++ branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1619/TestEndpoint.java 2007-04-23 15:20:46 UTC (rev 2902)
@@ -0,0 +1,32 @@
+/*
+ * 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.jaxrpc.jbws1619;
+
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+public interface TestEndpoint extends Remote
+{
+
+ public String echoString(final String message) throws RemoteException;
+
+}
Deleted: branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1619/TestEndpointImpl.java
===================================================================
--- branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1093/TestEndpointImpl.java 2007-04-23 12:30:58 UTC (rev 2899)
+++ branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1619/TestEndpointImpl.java 2007-04-23 15:20:46 UTC (rev 2902)
@@ -1,38 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.ws.jaxrpc.jbws1093;
-
-import java.rmi.RemoteException;
-
-/**
- * @author darran.lofthouse(a)jboss.com
- * @since 17-October-2006
- */
-public class TestEndpointImpl implements TestEndpoint
-{
-
- public String echoString(String message) throws RemoteException
- {
- return message;
- }
-
-}
Copied: branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1619/TestEndpointImpl.java (from rev 2901, branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1093/TestEndpointImpl.java)
===================================================================
--- branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1619/TestEndpointImpl.java (rev 0)
+++ branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/jbws1619/TestEndpointImpl.java 2007-04-23 15:20:46 UTC (rev 2902)
@@ -0,0 +1,65 @@
+/*
+ * 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.jaxrpc.jbws1619;
+
+import java.rmi.RemoteException;
+
+import javax.servlet.http.HttpSession;
+import javax.xml.rpc.ServiceException;
+import javax.xml.rpc.handler.MessageContext;
+import javax.xml.rpc.server.ServiceLifecycle;
+import javax.xml.rpc.server.ServletEndpointContext;
+
+import org.jboss.logging.Logger;
+
+public class TestEndpointImpl implements TestEndpoint, ServiceLifecycle
+{
+ private Logger log = Logger.getLogger(TestEndpointImpl.class);
+
+ private ServletEndpointContext context;
+
+ public String echoString(String message) throws RemoteException
+ {
+ HttpSession httpSession = null;
+ if ("Use ServletEndpointContext".equals(message))
+ {
+ httpSession = context.getHttpSession();
+ }
+ else if ("Use MessageContext".equals(message))
+ {
+ MessageContext msgContext = context.getMessageContext();
+ httpSession = (HttpSession)msgContext.getProperty("javax.xml.ws.servlet.session");
+ }
+
+ log.info("echoString: " + httpSession);
+ return "httpSession: " + httpSession;
+ }
+
+ public void init(Object context) throws ServiceException
+ {
+ this.context = (ServletEndpointContext)context;
+ }
+
+ public void destroy()
+ {
+ }
+}
Copied: branches/jbossws-2.0/jbossws-tests/src/resources/jaxrpc/jbws1619 (from rev 2899, branches/jbossws-2.0/jbossws-tests/src/resources/jaxrpc/jbws1093)
Modified: branches/jbossws-2.0/jbossws-tests/src/resources/jaxrpc/jbws1619/META-INF/application-client.xml
===================================================================
--- branches/jbossws-2.0/jbossws-tests/src/resources/jaxrpc/jbws1093/META-INF/application-client.xml 2007-04-23 12:30:58 UTC (rev 2899)
+++ branches/jbossws-2.0/jbossws-tests/src/resources/jaxrpc/jbws1619/META-INF/application-client.xml 2007-04-23 15:20:46 UTC (rev 2902)
@@ -13,8 +13,12 @@
<wsdl-file>META-INF/wsdl/TestService.wsdl</wsdl-file>
<jaxrpc-mapping-file>META-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
<port-component-ref>
- <service-endpoint-interface>org.jboss.test.ws.jaxrpc.jbws1093.TestEndpoint</service-endpoint-interface>
+ <service-endpoint-interface>org.jboss.test.ws.jaxrpc.jbws1619.TestEndpoint</service-endpoint-interface>
</port-component-ref>
+ <handler>
+ <handler-name>ClientHandler</handler-name>
+ <handler-class>org.jboss.test.ws.jaxrpc.jbws1619.ClientHandler</handler-class>
+ </handler>
</service-ref>
</application-client>
Modified: branches/jbossws-2.0/jbossws-tests/src/resources/jaxrpc/jbws1619/META-INF/jboss-client.xml
===================================================================
--- branches/jbossws-2.0/jbossws-tests/src/resources/jaxrpc/jbws1093/META-INF/jboss-client.xml 2007-04-23 12:30:58 UTC (rev 2899)
+++ branches/jbossws-2.0/jbossws-tests/src/resources/jaxrpc/jbws1619/META-INF/jboss-client.xml 2007-04-23 15:20:46 UTC (rev 2902)
@@ -9,7 +9,7 @@
<service-ref>
<service-ref-name>service/TestService</service-ref-name>
- <wsdl-override>http://@jbosstest.host.name@:8080/jaxrpc-jbws1093/TestEndpoint?wsdl</wsdl-override>
+ <wsdl-override>http://@jbosstest.host.name@:8080/jaxrpc-jbws1619/TestEndpoint?wsdl</wsdl-override>
</service-ref>
</jboss-client>
Modified: branches/jbossws-2.0/jbossws-tests/src/resources/jaxrpc/jbws1619/WEB-INF/jaxrpc-mapping.xml
===================================================================
--- branches/jbossws-2.0/jbossws-tests/src/resources/jaxrpc/jbws1093/WEB-INF/jaxrpc-mapping.xml 2007-04-23 12:30:58 UTC (rev 2899)
+++ branches/jbossws-2.0/jbossws-tests/src/resources/jaxrpc/jbws1619/WEB-INF/jaxrpc-mapping.xml 2007-04-23 15:20:46 UTC (rev 2902)
@@ -1,20 +1,20 @@
<?xml version='1.0' encoding='UTF-8'?><java-wsdl-mapping version='1.1' 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://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd'>
<package-mapping>
- <package-type>org.jboss.test.ws.jaxrpc.jbws1093</package-type>
- <namespaceURI>http://org.jboss.test.ws/jbws1093/types</namespaceURI>
+ <package-type>org.jboss.test.ws.jaxrpc.jbws1619</package-type>
+ <namespaceURI>http://org.jboss.test.ws/jbws1619/types</namespaceURI>
</package-mapping>
<service-interface-mapping>
- <service-interface>org.jboss.test.ws.jaxrpc.jbws1093.TestService</service-interface>
- <wsdl-service-name xmlns:serviceNS='http://org.jboss.test.ws/jbws1093'>serviceNS:TestService</wsdl-service-name>
+ <service-interface>org.jboss.test.ws.jaxrpc.jbws1619.TestService</service-interface>
+ <wsdl-service-name xmlns:serviceNS='http://org.jboss.test.ws/jbws1619'>serviceNS:TestService</wsdl-service-name>
<port-mapping>
<port-name>TestEndpointPort</port-name>
<java-port-name>TestEndpointPort</java-port-name>
</port-mapping>
</service-interface-mapping>
<service-endpoint-interface-mapping>
- <service-endpoint-interface>org.jboss.test.ws.jaxrpc.jbws1093.TestEndpoint</service-endpoint-interface>
- <wsdl-port-type xmlns:portTypeNS='http://org.jboss.test.ws/jbws1093'>portTypeNS:TestEndpoint</wsdl-port-type>
- <wsdl-binding xmlns:bindingNS='http://org.jboss.test.ws/jbws1093'>bindingNS:TestEndpointBinding</wsdl-binding>
+ <service-endpoint-interface>org.jboss.test.ws.jaxrpc.jbws1619.TestEndpoint</service-endpoint-interface>
+ <wsdl-port-type xmlns:portTypeNS='http://org.jboss.test.ws/jbws1619'>portTypeNS:TestEndpoint</wsdl-port-type>
+ <wsdl-binding xmlns:bindingNS='http://org.jboss.test.ws/jbws1619'>bindingNS:TestEndpointBinding</wsdl-binding>
<service-endpoint-method-mapping>
<java-method-name>echoString</java-method-name>
<wsdl-operation>echoString</wsdl-operation>
@@ -22,14 +22,14 @@
<param-position>0</param-position>
<param-type>java.lang.String</param-type>
<wsdl-message-mapping>
- <wsdl-message xmlns:wsdlMsgNS='http://org.jboss.test.ws/jbws1093'>wsdlMsgNS:TestEndpoint_echoString</wsdl-message>
+ <wsdl-message xmlns:wsdlMsgNS='http://org.jboss.test.ws/jbws1619'>wsdlMsgNS:TestEndpoint_echoString</wsdl-message>
<wsdl-message-part-name>String_1</wsdl-message-part-name>
<parameter-mode>IN</parameter-mode>
</wsdl-message-mapping>
</method-param-parts-mapping>
<wsdl-return-value-mapping>
<method-return-value>java.lang.String</method-return-value>
- <wsdl-message xmlns:wsdlMsgNS='http://org.jboss.test.ws/jbws1093'>wsdlMsgNS:TestEndpoint_echoStringResponse</wsdl-message>
+ <wsdl-message xmlns:wsdlMsgNS='http://org.jboss.test.ws/jbws1619'>wsdlMsgNS:TestEndpoint_echoStringResponse</wsdl-message>
<wsdl-message-part-name>result</wsdl-message-part-name>
</wsdl-return-value-mapping>
</service-endpoint-method-mapping>
Modified: branches/jbossws-2.0/jbossws-tests/src/resources/jaxrpc/jbws1619/WEB-INF/web.xml
===================================================================
--- branches/jbossws-2.0/jbossws-tests/src/resources/jaxrpc/jbws1093/WEB-INF/web.xml 2007-04-23 12:30:58 UTC (rev 2899)
+++ branches/jbossws-2.0/jbossws-tests/src/resources/jaxrpc/jbws1619/WEB-INF/web.xml 2007-04-23 15:20:46 UTC (rev 2902)
@@ -7,23 +7,13 @@
<servlet>
<servlet-name>TestEndpoint</servlet-name>
- <servlet-class>org.jboss.test.ws.jaxrpc.jbws1093.TestEndpointImpl</servlet-class>
+ <servlet-class>org.jboss.test.ws.jaxrpc.jbws1619.TestEndpointImpl</servlet-class>
</servlet>
- <servlet>
- <servlet-name>ServletTest</servlet-name>
- <servlet-class>org.jboss.test.ws.jaxrpc.jbws1093.ServletTest</servlet-class>
- </servlet>
-
<servlet-mapping>
<servlet-name>TestEndpoint</servlet-name>
<url-pattern>/TestEndpoint</url-pattern>
</servlet-mapping>
- <servlet-mapping>
- <servlet-name>ServletTest</servlet-name>
- <url-pattern>/ServletTest</url-pattern>
- </servlet-mapping>
-
</web-app>
Modified: branches/jbossws-2.0/jbossws-tests/src/resources/jaxrpc/jbws1619/WEB-INF/webservices.xml
===================================================================
--- branches/jbossws-2.0/jbossws-tests/src/resources/jaxrpc/jbws1093/WEB-INF/webservices.xml 2007-04-23 12:30:58 UTC (rev 2899)
+++ branches/jbossws-2.0/jbossws-tests/src/resources/jaxrpc/jbws1619/WEB-INF/webservices.xml 2007-04-23 15:20:46 UTC (rev 2902)
@@ -1,4 +1,4 @@
-<webservices version='1.1' xmlns='http://java.sun.com/xml/ns/j2ee' xmlns:impl='http://org.jboss.test.ws/jbws1093' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd'>
+<webservices version='1.1' xmlns='http://java.sun.com/xml/ns/j2ee' xmlns:impl='http://org.jboss.test.ws/jbws1619' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd'>
<webservice-description>
<webservice-description-name>TestService</webservice-description-name>
<wsdl-file>WEB-INF/wsdl/TestService.wsdl</wsdl-file>
@@ -6,7 +6,7 @@
<port-component>
<port-component-name>TestEndpointPort</port-component-name>
<wsdl-port>impl:TestEndpointPort</wsdl-port>
- <service-endpoint-interface>org.jboss.test.ws.jaxrpc.jbws1093.TestEndpoint</service-endpoint-interface>
+ <service-endpoint-interface>org.jboss.test.ws.jaxrpc.jbws1619.TestEndpoint</service-endpoint-interface>
<service-impl-bean>
<servlet-link>TestEndpoint</servlet-link>
</service-impl-bean>
Modified: branches/jbossws-2.0/jbossws-tests/src/resources/jaxrpc/jbws1619/WEB-INF/wsdl/TestService.wsdl
===================================================================
--- branches/jbossws-2.0/jbossws-tests/src/resources/jaxrpc/jbws1093/WEB-INF/wsdl/TestService.wsdl 2007-04-23 12:30:58 UTC (rev 2899)
+++ branches/jbossws-2.0/jbossws-tests/src/resources/jaxrpc/jbws1619/WEB-INF/wsdl/TestService.wsdl 2007-04-23 15:20:46 UTC (rev 2902)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<definitions name='TestService' targetNamespace='http://org.jboss.test.ws/jbws1093' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://org.jboss.test.ws/jbws1093' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
+<definitions name='TestService' targetNamespace='http://org.jboss.test.ws/jbws1619' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://org.jboss.test.ws/jbws1619' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
<types/>
<message name='TestEndpoint_echoString'>
<part name='String_1' type='xsd:string'/>
@@ -18,16 +18,16 @@
<operation name='echoString'>
<soap:operation soapAction=''/>
<input>
- <soap:body namespace='http://org.jboss.test.ws/jbws1093' use='literal'/>
+ <soap:body namespace='http://org.jboss.test.ws/jbws1619' use='literal'/>
</input>
<output>
- <soap:body namespace='http://org.jboss.test.ws/jbws1093' use='literal'/>
+ <soap:body namespace='http://org.jboss.test.ws/jbws1619' use='literal'/>
</output>
</operation>
</binding>
<service name='TestService'>
<port binding='tns:TestEndpointBinding' name='TestEndpointPort'>
- <soap:address location='http://localhost:8080//jaxrpc-jbws1093/TestEndpoint?wsdl'/>
+ <soap:address location='http://localhost:8080//jaxrpc-jbws1619/TestEndpoint?wsdl'/>
</port>
</service>
</definitions>
\ No newline at end of file
Modified: branches/jbossws-2.0/jbossws-tests/src/resources/jaxrpc/jbws1619/wstools-config.xml
===================================================================
--- branches/jbossws-2.0/jbossws-tests/src/resources/jaxrpc/jbws1093/wstools-config.xml 2007-04-23 12:30:58 UTC (rev 2899)
+++ branches/jbossws-2.0/jbossws-tests/src/resources/jaxrpc/jbws1619/wstools-config.xml 2007-04-23 15:20:46 UTC (rev 2902)
@@ -4,14 +4,14 @@
wstools -cp ../../../../../output/classes -dest ./WEB-INF -config wstools-config.xml
-->
-<!-- Set the soap:address location to 'http://localhost:8080//jbossws-jbws1093/TestEndpoint?wsdl' to run with Tomcat -->
+<!-- Set the soap:address location to 'http://localhost:8080//jbossws-jbws1619/TestEndpoint?wsdl' to run with Tomcat -->
<configuration xmlns="http://www.jboss.org/jbossws-tools" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.jboss.org/jbossws-tools http://www.jboss.org/jbossws-tools/schema/jbossws-tool_1_0.xsd">
<java-wsdl>
- <service name="TestService" endpoint="org.jboss.test.ws.jaxrpc.jbws1093.TestEndpoint" style="rpc">
+ <service name="TestService" endpoint="org.jboss.test.ws.jaxrpc.jbws1619.TestEndpoint" style="rpc">
</service>
- <namespaces target-namespace="http://org.jboss.test.ws/jbws1093" type-namespace="http://org.jboss.test.ws/jbws1093/types"/>
+ <namespaces target-namespace="http://org.jboss.test.ws/jbws1619" type-namespace="http://org.jboss.test.ws/jbws1619/types"/>
<mapping file="jaxrpc-mapping.xml"/>
<webservices servlet-link="TestEndpoint"/>
</java-wsdl>
17 years, 8 months
JBossWS SVN: r2901 - branches/jbossws-2.0.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-04-23 08:40:34 -0400 (Mon, 23 Apr 2007)
New Revision: 2901
Added:
branches/jbossws-2.0/mergeinfo.txt
Log:
Add mergeinfo
Added: branches/jbossws-2.0/mergeinfo.txt
===================================================================
--- branches/jbossws-2.0/mergeinfo.txt (rev 0)
+++ branches/jbossws-2.0/mergeinfo.txt 2007-04-23 12:40:34 UTC (rev 2901)
@@ -0,0 +1,4 @@
+23-Apr-2007, 14:30
+------------------
+svn merge -r2891:2899 https://svn.jboss.org/repos/jbossws/branches/jbossws-2.0
+svn merge -r2891:2899 https://svn.jboss.org/repos/jbossws/branches/jbossws-2.0
Property changes on: branches/jbossws-2.0/mergeinfo.txt
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
17 years, 8 months
JBossWS SVN: r2900 - in trunk: jbossws-core/src/java/org/jboss/ws/core and 4 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-04-23 08:39:11 -0400 (Mon, 23 Apr 2007)
New Revision: 2900
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/Constants.java
trunk/jbossws-core/src/java/org/jboss/ws/core/CommonSOAPBinding.java
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/LogicalMessageImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/EnvelopeBuilderStax.java
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/MessageFactoryImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/NodeImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyElementMessage.java
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPEnvelopeImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPHeaderImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/TextImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/XMLContent.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/common/soap/MessageFactoryTestCase.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/marshall/MarshallTest.java
Log:
svn merge -r2891:2899 https://svn.jboss.org/repos/jbossws/branches/jbossws-2.0
[JBWS-1511] MessageFactory does not preserve comments
Modified: trunk/jbossws-core/src/java/org/jboss/ws/Constants.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/Constants.java 2007-04-23 12:30:58 UTC (rev 2899)
+++ trunk/jbossws-core/src/java/org/jboss/ws/Constants.java 2007-04-23 12:39:11 UTC (rev 2900)
@@ -120,7 +120,7 @@
static final String PREFIX_XML = "xml";
/** XOP Include */
- static final Name NAME_XOP_INCLUDE = new NameImpl("Include", PREFIX_XOP, NS_XOP);
+ static final QName NAME_XOP_INCLUDE = new QName(NS_XOP, "Include", PREFIX_XOP);
/** SOAP-1.1 roles */
static final String URI_SOAP11_NEXT_ACTOR = "http://schemas.xmlsoap.org/soap/actor/next";
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/CommonSOAPBinding.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/CommonSOAPBinding.java 2007-04-23 12:30:58 UTC (rev 2899)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/CommonSOAPBinding.java 2007-04-23 12:39:11 UTC (rev 2900)
@@ -34,6 +34,7 @@
import javax.xml.soap.AttachmentPart;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.Name;
+import javax.xml.soap.Node;
import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPBodyElement;
import javax.xml.soap.SOAPElement;
@@ -133,7 +134,8 @@
protected abstract MessageAbstraction createMessage(OperationMetaData opMetaData) throws SOAPException;
/** On the client side, generate the payload from IN parameters. */
- public MessageAbstraction bindRequestMessage(OperationMetaData opMetaData, EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders) throws BindingException
+ public MessageAbstraction bindRequestMessage(OperationMetaData opMetaData, EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders)
+ throws BindingException
{
if (log.isDebugEnabled())
log.debug("bindRequestMessage: " + opMetaData.getQName());
@@ -320,17 +322,26 @@
{
boolean isHeader = paramMetaData.isInHeader();
SOAPElement element = isHeader ? soapHeader : soapBodyElement;
- if(!isHeader) numParameters++;
-
+ if (!isHeader)
+ numParameters++;
+
SOAPContentElement value = getParameterFromMessage(paramMetaData, element, false);
epInv.setRequestParamValue(xmlName, value);
}
}
}
- // TCK: verify the numer of parameters matches the actual message payload
- int numChildren = soapBodyElement.getChildNodes().getLength();
- if(numChildren!=numParameters) throw new WSException("Invalid number of payload elements: " + numChildren);
+ // Verify the numer of parameters matches the actual message payload
+ int numChildElements = 0;
+ Iterator itElements = soapBodyElement.getChildElements();
+ while (itElements.hasNext())
+ {
+ Node node = (Node)itElements.next();
+ if (node instanceof SOAPElement)
+ numChildElements++;
+ }
+ if (numChildElements != numParameters)
+ throw new WSException("Invalid number of payload elements: " + numChildElements);
}
// Generic message endpoint
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/LogicalMessageImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/LogicalMessageImpl.java 2007-04-23 12:30:58 UTC (rev 2899)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/LogicalMessageImpl.java 2007-04-23 12:39:11 UTC (rev 2900)
@@ -105,6 +105,7 @@
{
try
{
+ soapBody.removeContents();
EnvelopeBuilderDOM builder = new EnvelopeBuilderDOM(style);
Element domBodyElement = DOMUtils.sourceToElement(source);
builder.buildBodyElementRpc(soapBody, domBodyElement);
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java 2007-04-23 12:30:58 UTC (rev 2899)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java 2007-04-23 12:39:11 UTC (rev 2900)
@@ -26,10 +26,11 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
-import java.util.Iterator;
import javax.xml.namespace.QName;
import javax.xml.soap.Name;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPBodyElement;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPException;
@@ -42,7 +43,10 @@
import org.jboss.ws.WSException;
import org.jboss.ws.core.jaxrpc.Style;
import org.jboss.ws.core.utils.DOMUtils;
+import org.w3c.dom.Comment;
+import org.w3c.dom.Document;
import org.w3c.dom.Element;
+import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
@@ -58,10 +62,12 @@
// provide logging
private static Logger log = Logger.getLogger(EnvelopeBuilderDOM.class);
- private Style style = Style.DOCUMENT;
+ private SOAPFactoryImpl soapFactory;
+ private Style style;
public EnvelopeBuilderDOM(Style style)
{
+ this.soapFactory = new SOAPFactoryImpl();
this.style = style;
}
@@ -107,29 +113,71 @@
public SOAPEnvelope build(SOAPMessage soapMessage, Element domEnv) throws SOAPException
{
- String envNS = domEnv.getNamespaceURI();
- String envPrefix = domEnv.getPrefix();
-
// Construct the envelope
- SOAPFactoryImpl soapFactory = new SOAPFactoryImpl();
SOAPPartImpl soapPart = (SOAPPartImpl)soapMessage.getSOAPPart();
- SOAPEnvelopeImpl soapEnv = new SOAPEnvelopeImpl(soapPart, soapFactory.createElement(domEnv, false));
+ SOAPEnvelopeImpl soapEnv = new SOAPEnvelopeImpl(soapPart, soapFactory.createElement(domEnv, false), false);
+ Document ownerDoc = soapEnv.getOwnerDocument();
DOMUtils.copyAttributes(soapEnv, domEnv);
- // Add the header elements
- Element domHeader = DOMUtils.getFirstChildElement(domEnv, new QName(envNS, "Header"));
- if (domHeader != null)
+ NodeList envChildNodes = domEnv.getChildNodes();
+ for (int i = 0; i < envChildNodes.getLength(); i++)
{
- SOAPHeader soapHeader = soapEnv.getHeader();
+ Node child = envChildNodes.item(i);
+ short childType = child.getNodeType();
+ if (childType == Node.ELEMENT_NODE)
+ {
+ String elName = child.getLocalName();
+ if ("Header".equals(elName))
+ {
+ buildSOAPHeader(soapEnv, (Element)child);
+ }
+ else if ("Body".equals(elName))
+ {
+ buildSOAPBody(soapEnv, (Element)child);
+ }
+ else
+ {
+ log.warn("Ignore envelope chile element: " + elName);
+ }
+ }
+ else if (childType == Node.COMMENT_NODE)
+ {
+ String nodeValue = child.getNodeValue();
+ Comment comment = ownerDoc.createComment(nodeValue);
+ soapEnv.appendChild(comment);
+ }
+ else if (childType == Node.TEXT_NODE)
+ {
+ String nodeValue = child.getNodeValue();
+ soapEnv.addTextNode(nodeValue);
+ }
+ else
+ {
+ log.warn("Ignore child type: " + childType);
+ }
+ }
- DOMUtils.copyAttributes(soapHeader, domHeader);
+ return soapEnv;
+ }
- Iterator it = DOMUtils.getChildElements(domHeader);
- while (it.hasNext())
+ private SOAPHeader buildSOAPHeader(SOAPEnvelopeImpl soapEnv, Element domHeader) throws SOAPException
+ {
+ SOAPHeader soapHeader = soapEnv.getHeader();
+ if (soapHeader == null)
+ soapHeader = soapEnv.addHeader();
+
+ Document ownerDoc = soapEnv.getOwnerDocument();
+ DOMUtils.copyAttributes(soapHeader, domHeader);
+
+ NodeList headerChildNodes = domHeader.getChildNodes();
+ for (int i = 0; i < headerChildNodes.getLength(); i++)
+ {
+ Node child = headerChildNodes.item(i);
+ short childType = child.getNodeType();
+ if (childType == Node.ELEMENT_NODE)
{
- Element srcElement = (Element)it.next();
- //registerNamespacesLocally(srcElement);
+ Element srcElement = (Element)child;
XMLFragment xmlFragment = new XMLFragment(new DOMSource(srcElement));
Name name = new NameImpl(srcElement.getLocalName(), srcElement.getPrefix(), srcElement.getNamespaceURI());
@@ -139,99 +187,75 @@
DOMUtils.copyAttributes(destElement, srcElement);
destElement.setXMLFragment(xmlFragment);
}
+ else if (childType == Node.COMMENT_NODE)
+ {
+ String nodeValue = child.getNodeValue();
+ Comment comment = ownerDoc.createComment(nodeValue);
+ soapHeader.appendChild(comment);
+ }
+ else if (childType == Node.TEXT_NODE)
+ {
+ String nodeValue = child.getNodeValue();
+ soapHeader.addTextNode(nodeValue);
+ }
+ else
+ {
+ log.warn("Ignore child type: " + childType);
+ }
}
- // Add the body elements
- Element domBody = DOMUtils.getFirstChildElement(domEnv, new QName(envNS, "Body"));
+ return soapHeader;
+ }
+
+ private SOAPBody buildSOAPBody(SOAPEnvelopeImpl soapEnv, Element domBody) throws SOAPException
+ {
+ String envNS = soapEnv.getNamespaceURI();
+
SOAPBodyImpl soapBody = (SOAPBodyImpl)soapEnv.getBody();
+ if (soapBody == null)
+ soapBody = (SOAPBodyImpl)soapEnv.addBody();
+ Document ownerDoc = soapBody.getOwnerDocument();
DOMUtils.copyAttributes(soapBody, domBody);
- Iterator itBody = DOMUtils.getChildElements(domBody);
- if (itBody.hasNext())
+ SOAPBodyElement soapBodyElement = null;
+ boolean attachHRefElements = Constants.URI_SOAP11_ENC.equals(soapEnv.getAttributeNS(envNS, "encodingStyle"));
+
+ NodeList bodyChildNodes = domBody.getChildNodes();
+ for (int i = 0; i < bodyChildNodes.getLength(); i++)
{
- Element domBodyElement = (Element)itBody.next();
-
- String localName = domBodyElement.getLocalName();
- String prefix = domBodyElement.getPrefix();
- String nsURI = domBodyElement.getNamespaceURI();
- Name beName = new NameImpl(localName, prefix, nsURI);
-
- // Process a <env:Fault> message
- if (beName.equals(new NameImpl("Fault", envPrefix, envNS)))
+ Node child = bodyChildNodes.item(i);
+ short childType = child.getNodeType();
+ if (childType == Node.ELEMENT_NODE)
{
- SOAPFaultImpl soapFault = new SOAPFaultImpl(envPrefix, envNS);
- soapBody.addChildElement(soapFault);
-
- DOMUtils.copyAttributes(soapFault, domBodyElement);
-
- // copy everything and let soapFault discover child elements itself
- XMLFragment xmlFragment = new XMLFragment(new DOMSource(domBodyElement));
- soapFault.setXMLFragment(xmlFragment);
- }
-
- // Process and RPC or DOCUMENT style message
- else
- {
-
- if (style == Style.RPC)
+ if (soapBodyElement == null)
{
- buildBodyElementRpc(soapBody, domBodyElement);
+ soapBodyElement = buildSOAPBodyElement(soapEnv, (Element)child);
+ attachHRefElements = attachHRefElements || Constants.URI_SOAP11_ENC.equals(soapBody.getAttributeNS(envNS, "encodingStyle"));
}
- else if (style == Style.DOCUMENT)
+ else if (attachHRefElements)
{
- buildBodyElementDoc(soapBody, domBodyElement);
+ // Process additional soap encoded body elements
+ soapBody.addChildElement(soapFactory.createElement((Element)child, true));
}
- else if (style == null)
- {
- SOAPBodyElementMessage soapBodyElement = new SOAPBodyElementMessage(beName);
- soapBodyElement = (SOAPBodyElementMessage)soapBody.addChildElement(soapBodyElement);
-
- DOMUtils.copyAttributes(soapBodyElement, domBodyElement);
-
- NodeList nlist = domBodyElement.getChildNodes();
- for (int i = 0; i < nlist.getLength(); i++)
- {
- org.w3c.dom.Node child = nlist.item(i);
- short childType = child.getNodeType();
- if (childType == org.w3c.dom.Node.ELEMENT_NODE)
- {
- SOAPElement soapElement = soapFactory.createElement((Element)child);
- soapBodyElement.addChildElement(soapElement);
- }
- else if (childType == org.w3c.dom.Node.TEXT_NODE)
- {
- String nodeValue = child.getNodeValue();
- soapBodyElement.addTextNode(nodeValue);
- }
- else if (childType == org.w3c.dom.Node.CDATA_SECTION_NODE)
- {
- String nodeValue = child.getNodeValue();
- soapBodyElement.addTextNode(nodeValue);
- }
- else
- {
- log.warn("Ignore child type: " + childType);
- }
- }
- }
- else
- {
- throw new WSException("Unsupported message style: " + style);
- }
}
+ else if (childType == Node.COMMENT_NODE)
+ {
+ String nodeValue = child.getNodeValue();
+ Comment comment = ownerDoc.createComment(nodeValue);
+ soapBody.appendChild(comment);
+ }
+ else if (childType == Node.TEXT_NODE)
+ {
+ String nodeValue = child.getNodeValue();
+ soapBody.addTextNode(nodeValue);
+ }
+ else
+ {
+ log.warn("Ignore child type: " + childType);
+ }
}
- // Process additional soap encoded body elements
- boolean attachHRefElements = Constants.URI_SOAP11_ENC.equals(soapEnv.getAttributeNS(envNS, "encodingStyle"));
- attachHRefElements = attachHRefElements || Constants.URI_SOAP11_ENC.equals(soapBody.getAttributeNS(envNS, "encodingStyle"));
- attachHRefElements = attachHRefElements && itBody.hasNext();
- while (attachHRefElements && itBody.hasNext())
- {
- Element srcElement = (Element)itBody.next();
- soapBody.addChildElement(soapFactory.createElement(srcElement, true));
- }
-
// Inline all attached href elements
if (attachHRefElements)
{
@@ -239,48 +263,158 @@
inlineHandler.processHRefs();
}
- return soapEnv;
+ return soapBody;
}
+ private SOAPBodyElement buildSOAPBodyElement(SOAPEnvelopeImpl soapEnv, Element domBodyElement) throws SOAPException
+ {
+ String envNS = soapEnv.getNamespaceURI();
+ String envPrefix = soapEnv.getPrefix();
+
+ SOAPBodyImpl soapBody = (SOAPBodyImpl)soapEnv.getBody();
+ QName beName = DOMUtils.getElementQName(domBodyElement);
+
+ SOAPBodyElement soapBodyElement = null;
+
+ // Process a <env:Fault> message
+ if (beName.equals(new QName(envNS, "Fault")))
+ {
+ SOAPFaultImpl soapFault = new SOAPFaultImpl(envPrefix, envNS);
+ soapBody.addChildElement(soapFault);
+ soapBodyElement = soapFault;
+
+ DOMUtils.copyAttributes(soapFault, domBodyElement);
+
+ // copy everything and let soapFault discover child elements itself
+ XMLFragment xmlFragment = new XMLFragment(new DOMSource(domBodyElement));
+ soapFault.setXMLFragment(xmlFragment);
+ }
+
+ // Process and RPC or DOCUMENT style message
+ else
+ {
+ if (style == Style.DOCUMENT)
+ {
+ buildBodyElementDoc(soapBody, domBodyElement);
+ }
+ else if (style == Style.RPC)
+ {
+ soapBodyElement = buildBodyElementRpc(soapBody, domBodyElement);
+ }
+ else if (style == null)
+ {
+ buildBodyElementDefault(soapBody, domBodyElement);
+ }
+ else
+ {
+ throw new WSException("Unsupported message style: " + style);
+ }
+ }
+
+ return soapBodyElement;
+ }
+
public void buildBodyElementDoc(SOAPBodyImpl soapBody, Element domBodyElement) throws SOAPException
{
- soapBody.removeContents();
-
Element srcElement = (Element)domBodyElement;
QName beName = DOMUtils.getElementQName(domBodyElement);
- SOAPContentElement destElement = new SOAPBodyElementDoc(beName);
- destElement = (SOAPContentElement)soapBody.addChildElement(destElement);
+ SOAPContentElement contentElement = new SOAPBodyElementDoc(beName);
+ contentElement = (SOAPContentElement)soapBody.addChildElement(contentElement);
- DOMUtils.copyAttributes(destElement, srcElement);
+ DOMUtils.copyAttributes(contentElement, srcElement);
XMLFragment xmlFragment = new XMLFragment(new DOMSource(srcElement));
- destElement.setXMLFragment(xmlFragment);
+ contentElement.setXMLFragment(xmlFragment);
}
- public void buildBodyElementRpc(SOAPBodyImpl soapBody, Element domBodyElement) throws SOAPException
+ public SOAPBodyElement buildBodyElementRpc(SOAPBodyImpl soapBody, Element domBodyElement) throws SOAPException
{
- soapBody.removeContents();
-
QName beName = DOMUtils.getElementQName(domBodyElement);
SOAPBodyElementRpc soapBodyElement = new SOAPBodyElementRpc(beName);
soapBodyElement = (SOAPBodyElementRpc)soapBody.addChildElement(soapBodyElement);
+ Document ownerDoc = soapBody.getOwnerDocument();
DOMUtils.copyAttributes(soapBodyElement, domBodyElement);
- Iterator itBodyElement = DOMUtils.getChildElements(domBodyElement);
- while (itBodyElement.hasNext())
+ NodeList nlist = domBodyElement.getChildNodes();
+ for (int i = 0; i < nlist.getLength(); i++)
{
- Element srcElement = (Element)itBodyElement.next();
+ Node child = nlist.item(i);
+ short childType = child.getNodeType();
+ if (childType == Node.ELEMENT_NODE)
+ {
+ Element srcElement = (Element)child;
+ Name name = new NameImpl(srcElement.getLocalName(), srcElement.getPrefix(), srcElement.getNamespaceURI());
+ SOAPContentElement destElement = new SOAPContentElement(name);
+ destElement = (SOAPContentElement)soapBodyElement.addChildElement(destElement);
- Name name = new NameImpl(srcElement.getLocalName(), srcElement.getPrefix(), srcElement.getNamespaceURI());
- SOAPContentElement destElement = new SOAPContentElement(name);
- destElement = (SOAPContentElement)soapBodyElement.addChildElement(destElement);
+ DOMUtils.copyAttributes(destElement, srcElement);
- DOMUtils.copyAttributes(destElement, srcElement);
+ XMLFragment xmlFragment = new XMLFragment(new DOMSource(srcElement));
+ destElement.setXMLFragment(xmlFragment);
+ }
+ else if (childType == Node.COMMENT_NODE)
+ {
+ String nodeValue = child.getNodeValue();
+ Comment comment = ownerDoc.createComment(nodeValue);
+ soapBodyElement.appendChild(comment);
+ }
+ else if (childType == Node.TEXT_NODE)
+ {
+ String nodeValue = child.getNodeValue();
+ soapBodyElement.addTextNode(nodeValue);
+ }
+ else
+ {
+ log.warn("Ignore child type: " + childType);
+ }
+ }
- XMLFragment xmlFragment = new XMLFragment(new DOMSource(srcElement));
- destElement.setXMLFragment(xmlFragment);
+ return soapBodyElement;
+ }
+
+ public SOAPBodyElement buildBodyElementDefault(SOAPBodyImpl soapBody, Element domBodyElement) throws SOAPException
+ {
+ QName beName = DOMUtils.getElementQName(domBodyElement);
+ SOAPBodyElement soapBodyElement = new SOAPBodyElementMessage(beName);
+ soapBodyElement = (SOAPBodyElementMessage)soapBody.addChildElement(soapBodyElement);
+
+ Document ownerDoc = soapBody.getOwnerDocument();
+ DOMUtils.copyAttributes(soapBodyElement, domBodyElement);
+
+ NodeList nlist = domBodyElement.getChildNodes();
+ for (int i = 0; i < nlist.getLength(); i++)
+ {
+ Node child = nlist.item(i);
+ short childType = child.getNodeType();
+ if (childType == Node.ELEMENT_NODE)
+ {
+ SOAPElement soapElement = soapFactory.createElement((Element)child);
+ soapBodyElement.addChildElement(soapElement);
+ }
+ else if (childType == Node.COMMENT_NODE)
+ {
+ String nodeValue = child.getNodeValue();
+ Comment comment = ownerDoc.createComment(nodeValue);
+ soapBodyElement.appendChild(comment);
+ }
+ else if (childType == Node.TEXT_NODE)
+ {
+ String nodeValue = child.getNodeValue();
+ soapBodyElement.addTextNode(nodeValue);
+ }
+ else if (childType == Node.CDATA_SECTION_NODE)
+ {
+ String nodeValue = child.getNodeValue();
+ soapBodyElement.addTextNode(nodeValue);
+ }
+ else
+ {
+ log.warn("Ignore child type: " + childType);
+ }
}
+
+ return soapBodyElement;
}
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/EnvelopeBuilderStax.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/EnvelopeBuilderStax.java 2007-04-23 12:30:58 UTC (rev 2899)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/EnvelopeBuilderStax.java 2007-04-23 12:39:11 UTC (rev 2900)
@@ -256,7 +256,7 @@
if (Part.ENVELOPE == currentPart)
{
// setup envelope impl
- soapEnv = new SOAPEnvelopeImpl(soapPart, qName.getNamespaceURI());
+ soapEnv = new SOAPEnvelopeImpl(soapPart, qName.getNamespaceURI(), false);
destElement = soapEnv; // soapEnv becomes current
}
else if (Part.HEADER == currentPart)
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/MessageFactoryImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/MessageFactoryImpl.java 2007-04-23 12:30:58 UTC (rev 2899)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/MessageFactoryImpl.java 2007-04-23 12:39:11 UTC (rev 2900)
@@ -154,7 +154,7 @@
SOAPMessageImpl soapMessage = new SOAPMessageImpl();
SOAPPartImpl soapPart = (SOAPPartImpl)soapMessage.getSOAPPart();
- new SOAPEnvelopeImpl(soapPart, envNamespace);
+ new SOAPEnvelopeImpl(soapPart, envNamespace, true);
return soapMessage;
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/NodeImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/NodeImpl.java 2007-04-23 12:30:58 UTC (rev 2899)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/NodeImpl.java 2007-04-23 12:39:11 UTC (rev 2900)
@@ -552,6 +552,10 @@
{
retNode = new TextImpl(node);
}
+ else if (node instanceof org.w3c.dom.Comment)
+ {
+ retNode = new TextImpl(node);
+ }
else
{
throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Operation not supported on this type of node: " + node);
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyElementMessage.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyElementMessage.java 2007-04-23 12:30:58 UTC (rev 2899)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyElementMessage.java 2007-04-23 12:39:11 UTC (rev 2900)
@@ -23,8 +23,8 @@
import java.io.Writer;
+import javax.xml.namespace.QName;
import javax.xml.rpc.JAXRPCException;
-import javax.xml.soap.Name;
import javax.xml.soap.SOAPBodyElement;
import org.jboss.ws.core.utils.DOMWriter;
@@ -39,7 +39,7 @@
*/
public class SOAPBodyElementMessage extends SOAPElementImpl implements SOAPBodyElement
{
- public SOAPBodyElementMessage(Name name)
+ public SOAPBodyElementMessage(QName name)
{
super(name);
}
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java 2007-04-23 12:30:58 UTC (rev 2899)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java 2007-04-23 12:39:11 UTC (rev 2900)
@@ -38,6 +38,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.core.utils.DOMUtils;
+import org.w3c.dom.Comment;
import org.w3c.dom.DOMException;
import org.w3c.dom.Document;
import org.w3c.dom.DocumentFragment;
@@ -254,10 +255,14 @@
return newDocument;
}
- private static boolean needsConversionToBodyElement(Node node)
+ private static boolean needsConversionToBodyElement(Node newChild)
{
// JBCTS-440 #addTextNodeTest1 appends a Text node to a SOAPBody
- return !(node instanceof SOAPBodyElement || node instanceof DocumentFragment || node instanceof Text);
+ boolean validChild = newChild instanceof SOAPBodyElement;
+ validChild = validChild || newChild instanceof DocumentFragment;
+ validChild = validChild || newChild instanceof Text;
+ validChild = validChild || newChild instanceof Comment;
+ return validChild == false;
}
private static SOAPBodyElementDoc convertToBodyElement(Node node)
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPEnvelopeImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPEnvelopeImpl.java 2007-04-23 12:30:58 UTC (rev 2899)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPEnvelopeImpl.java 2007-04-23 12:39:11 UTC (rev 2900)
@@ -54,7 +54,7 @@
/** Construct a SOAP envelope for the given SOAP version URI prefix, etc.
*/
- public SOAPEnvelopeImpl(SOAPPartImpl soapPart, SOAPElement element) throws SOAPException
+ public SOAPEnvelopeImpl(SOAPPartImpl soapPart, SOAPElement element, boolean addHeaderAndBody) throws SOAPException
{
super((SOAPElementImpl)element);
@@ -71,16 +71,16 @@
assertEnvelopeNamespace(namespaceURI);
addNamespaceDeclaration(prefix, namespaceURI);
- // the Element source might already contain a Header and Body declaration
- if (null == soapPart.getEnvelope().getHeader())
+ if (addHeaderAndBody)
+ {
addHeader();
- if (null == soapPart.getEnvelope().getBody())
addBody();
+ }
}
/** Construct a SOAP envelope for the given SOAP version URI.
*/
- SOAPEnvelopeImpl(SOAPPartImpl soapPart, String namespace) throws SOAPException
+ SOAPEnvelopeImpl(SOAPPartImpl soapPart, String namespace, boolean addHeaderAndBody) throws SOAPException
{
super("Envelope", Constants.PREFIX_ENV, namespace);
@@ -90,8 +90,11 @@
assertEnvelopeNamespace(namespace);
addNamespaceDeclaration(getPrefix(), namespace);
- addHeader();
- addBody();
+ if (addHeaderAndBody)
+ {
+ addHeader();
+ addBody();
+ }
}
public SOAPMessage getSOAPMessage()
@@ -156,7 +159,7 @@
while (it.hasNext())
{
Node node = (Node)it.next();
- if (node.getLocalName().equals("Body"))
+ if ("Body".equals(node.getLocalName()))
return (SOAPBody)node;
}
return null;
@@ -168,7 +171,7 @@
while (it.hasNext())
{
Node node = (Node)it.next();
- if (node.getLocalName().equals("Header"))
+ if ("Header".equals(node.getLocalName()))
return (SOAPHeader)node;
}
return null;
@@ -179,7 +182,10 @@
*/
public SOAPElement addTextNode(String value) throws SOAPException
{
- throw new SOAPException("Cannot add Text node to SOAPEnvelope");
+ if (value.trim().length() > 0)
+ throw new SOAPException("Cannot add Text node to SOAPEnvelope");
+
+ return super.addTextNode(value);
}
public Document getOwnerDocument()
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPHeaderImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPHeaderImpl.java 2007-04-23 12:30:58 UTC (rev 2899)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPHeaderImpl.java 2007-04-23 12:39:11 UTC (rev 2900)
@@ -36,6 +36,7 @@
import org.jboss.ws.Constants;
import org.jboss.ws.core.utils.SAAJUtils;
+import org.w3c.dom.Comment;
import org.w3c.dom.DOMException;
import org.w3c.dom.DocumentFragment;
import org.w3c.dom.Node;
@@ -272,7 +273,11 @@
private static boolean needsConversionToHeaderElement(Node newChild)
{
// JBCTS-440 #addTextNodeTest2 appends a Text node to a SOAPHeader
- return !(newChild instanceof SOAPHeaderElementImpl || newChild instanceof DocumentFragment || newChild instanceof Text);
+ boolean validChild = newChild instanceof SOAPHeaderElementImpl;
+ validChild = validChild || newChild instanceof DocumentFragment;
+ validChild = validChild || newChild instanceof Text;
+ validChild = validChild || newChild instanceof Comment;
+ return validChild == false;
}
private static SOAPHeaderElementImpl convertToHeaderElement(Node node)
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/TextImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/TextImpl.java 2007-04-23 12:30:58 UTC (rev 2899)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/TextImpl.java 2007-04-23 12:39:11 UTC (rev 2900)
@@ -42,8 +42,7 @@
*/
public boolean isComment()
{
- String value = getNodeValue().trim();
- return value.startsWith("<!--") && value.endsWith("-->");
+ return domNode.getNodeType() == org.w3c.dom.Node.COMMENT_NODE;
}
public String getValue()
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/XMLContent.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/XMLContent.java 2007-04-23 12:30:58 UTC (rev 2899)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/XMLContent.java 2007-04-23 12:39:11 UTC (rev 2900)
@@ -33,7 +33,6 @@
import javax.activation.DataHandler;
import javax.activation.DataSource;
import javax.xml.namespace.QName;
-import javax.xml.soap.Name;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPException;
import javax.xml.transform.Source;
@@ -54,6 +53,8 @@
import org.jboss.ws.extensions.xop.XOPContext;
import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.metadata.umdm.ParameterMetaData;
+import org.w3c.dom.Comment;
+import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
@@ -297,18 +298,13 @@
if (domElement == container)
return;
- String rootLocalName = domElement.getLocalName();
- String rootPrefix = domElement.getPrefix();
- String rootNS = domElement.getNamespaceURI();
- NameImpl contentRootName = new NameImpl(rootLocalName, rootPrefix, rootNS);
-
// Make sure the content root element name matches this element name
- Name name = container.getElementName();
QName qname = container.getElementQName();
+ QName contentRootName = DOMUtils.getElementQName(domElement);
boolean artificalElement = (SOAPContentElement.GENERIC_PARAM_NAME.equals(qname) || SOAPContentElement.GENERIC_RETURN_NAME.equals(qname));
- if (!artificalElement && !contentRootName.equals(name))
- throw new WSException("Content root name does not match element name: " + contentRootName + " != " + name);
+ if (!artificalElement && !contentRootName.equals(qname))
+ throw new WSException("Content root name does not match element name: " + contentRootName + " != " + qname);
// Remove all child nodes
container.removeContents();
@@ -317,11 +313,10 @@
// These need to be replaced (costly!)
if (artificalElement)
{
- QName xmlName = contentRootName.toQName();
- container.setElementQNameInternal(xmlName);
+ container.setElementQNameInternal(contentRootName);
}
- // Copy attributes
+ Document ownerDoc = container.getOwnerDocument();
DOMUtils.copyAttributes(container, domElement);
SOAPFactoryImpl soapFactory = new SOAPFactoryImpl();
@@ -335,7 +330,7 @@
{
SOAPElement soapElement = soapFactory.createElement((Element)child);
container.addChildElement(soapElement);
- if (Constants.NAME_XOP_INCLUDE.equals(name) || container.isXOPParameter())
+ if (Constants.NAME_XOP_INCLUDE.equals(qname) || container.isXOPParameter())
XOPContext.inlineXOPData(soapElement);
}
else if (childType == Node.TEXT_NODE)
@@ -343,6 +338,12 @@
String nodeValue = child.getNodeValue();
container.addTextNode(nodeValue);
}
+ else if (childType == Node.COMMENT_NODE)
+ {
+ String nodeValue = child.getNodeValue();
+ Comment comment = ownerDoc.createComment(nodeValue);
+ container.appendChild(comment);
+ }
else if (childType == Node.CDATA_SECTION_NODE)
{
String nodeValue = child.getNodeValue();
Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/common/soap/MessageFactoryTestCase.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/common/soap/MessageFactoryTestCase.java 2007-04-23 12:30:58 UTC (rev 2899)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/common/soap/MessageFactoryTestCase.java 2007-04-23 12:39:11 UTC (rev 2900)
@@ -25,18 +25,22 @@
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
+import java.io.IOException;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPBodyElement;
import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
import javax.xml.transform.stream.StreamSource;
import org.jboss.test.ws.JBossWSTest;
import org.jboss.ws.Constants;
+import org.jboss.ws.core.jaxrpc.Style;
import org.jboss.ws.core.soap.MessageFactoryImpl;
import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMWriter;
import org.w3c.dom.Element;
/**
@@ -153,7 +157,7 @@
public void testPreserveComments() throws Exception
{
String expMsg =
- "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:ns1='http://somens.org'>" +
+ "<soapenv:Envelope xmlns:ns1='http://somens.org' xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'>" +
" <!-- header -->" +
" <soapenv:Header>" +
" <!-- header element -->" +
@@ -169,12 +173,27 @@
" </soapenv:Body>" +
"</soapenv:Envelope>";
- MessageFactory factory = new MessageFactoryImpl();
- ByteArrayInputStream inputStream = new ByteArrayInputStream(expMsg.getBytes());
+ // Verify that DOM parse/write do not modify the message
+ Element expEnv = DOMUtils.parse(expMsg);
+ assertEquals(expMsg, DOMWriter.printNode(expEnv, false));
+
+ doPreserveCommentsPerStyle(expMsg, Style.DOCUMENT);
+ doPreserveCommentsPerStyle(expMsg, Style.RPC);
+ doPreserveCommentsPerStyle(expMsg, null);
+ }
+
+ private void doPreserveCommentsPerStyle(String expXML, Style style) throws IOException, SOAPException
+ {
+ MessageFactoryImpl factory = new MessageFactoryImpl();
+ factory.setStyle(style);
+
+ ByteArrayInputStream inputStream = new ByteArrayInputStream(expXML.getBytes());
SOAPMessage soapMsg = factory.createMessage(null, inputStream);
- SOAPEnvelope env = soapMsg.getSOAPPart().getEnvelope();
+ SOAPEnvelope wasEnv = soapMsg.getSOAPPart().getEnvelope();
- System.out.println("FIXME: [JBWS-1511] MessageFactory does not preserve comments");
- //assertEquals(DOMUtils.parse(expMsg), (Element)env);
+ String wasXML = DOMWriter.printNode(wasEnv, false);
+ //System.out.println(expXML);
+ //System.out.println(wasXML);
+ assertEquals(expXML, wasXML);
}
}
\ No newline at end of file
Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/marshall/MarshallTest.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/marshall/MarshallTest.java 2007-04-23 12:30:58 UTC (rev 2899)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/marshall/MarshallTest.java 2007-04-23 12:39:11 UTC (rev 2900)
@@ -1,24 +1,24 @@
/*
- * 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.
- */
+ * 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.jaxrpc.marshall;
import java.math.BigDecimal;
@@ -36,7 +36,7 @@
/**
* Test standard JAX-RPC types.
- *
+ *
* @author Thomas.Diesler(a)jboss.org
* @since 15-Feb-2005
*/
@@ -227,8 +227,8 @@
{
Calendar in = new GregorianCalendar(1968, 5, 16, 14, 23, 55);
/**
- * Will be a problem where the JVM is running in a TZ which
- * has Daylight Saving Time influence. So offset the TZ to GMT.
+ * Will be a problem where the JVM is running in a TZ which has Daylight
+ * Saving Time influence. So offset the TZ to GMT.
*/
in.setTimeZone(TimeZone.getTimeZone("GMT-0"));
Calendar out = calendarTest(in);
@@ -607,6 +607,11 @@
String in = "one";
String out = stringTest(in);
assertEquals(in, out);
+
+ System.out.println("FIXME: [JBWS-1617] JAXRPC doc/literal trims empty string");
+ //in = " ";
+ //out = stringTest(in);
+ //assertEquals(in, out);
}
public void testStringSpecialChars() throws Exception
17 years, 8 months
JBossWS SVN: r2899 - in branches/jbossws-2.0: jbossws-core/src/java/org/jboss/ws/core and 4 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-04-23 08:30:58 -0400 (Mon, 23 Apr 2007)
New Revision: 2899
Modified:
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/Constants.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/CommonSOAPBinding.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/LogicalMessageImpl.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/soap/EnvelopeBuilderStax.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/soap/MessageFactoryImpl.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/soap/NodeImpl.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyElementMessage.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPEnvelopeImpl.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPHeaderImpl.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/soap/TextImpl.java
branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/soap/XMLContent.java
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/common/soap/MessageFactoryTestCase.java
branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/marshall/MarshallTest.java
Log:
[JBWS-1511] MessageFactory does not preserve comments
Modified: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/Constants.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/Constants.java 2007-04-23 08:00:28 UTC (rev 2898)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/Constants.java 2007-04-23 12:30:58 UTC (rev 2899)
@@ -120,7 +120,7 @@
static final String PREFIX_XML = "xml";
/** XOP Include */
- static final Name NAME_XOP_INCLUDE = new NameImpl("Include", PREFIX_XOP, NS_XOP);
+ static final QName NAME_XOP_INCLUDE = new QName(NS_XOP, "Include", PREFIX_XOP);
/** SOAP-1.1 roles */
static final String URI_SOAP11_NEXT_ACTOR = "http://schemas.xmlsoap.org/soap/actor/next";
Modified: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/CommonSOAPBinding.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/CommonSOAPBinding.java 2007-04-23 08:00:28 UTC (rev 2898)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/CommonSOAPBinding.java 2007-04-23 12:30:58 UTC (rev 2899)
@@ -34,6 +34,7 @@
import javax.xml.soap.AttachmentPart;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.Name;
+import javax.xml.soap.Node;
import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPBodyElement;
import javax.xml.soap.SOAPElement;
@@ -133,7 +134,8 @@
protected abstract MessageAbstraction createMessage(OperationMetaData opMetaData) throws SOAPException;
/** On the client side, generate the payload from IN parameters. */
- public MessageAbstraction bindRequestMessage(OperationMetaData opMetaData, EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders) throws BindingException
+ public MessageAbstraction bindRequestMessage(OperationMetaData opMetaData, EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders)
+ throws BindingException
{
if (log.isDebugEnabled())
log.debug("bindRequestMessage: " + opMetaData.getQName());
@@ -320,17 +322,26 @@
{
boolean isHeader = paramMetaData.isInHeader();
SOAPElement element = isHeader ? soapHeader : soapBodyElement;
- if(!isHeader) numParameters++;
-
+ if (!isHeader)
+ numParameters++;
+
SOAPContentElement value = getParameterFromMessage(paramMetaData, element, false);
epInv.setRequestParamValue(xmlName, value);
}
}
}
- // TCK: verify the numer of parameters matches the actual message payload
- int numChildren = soapBodyElement.getChildNodes().getLength();
- if(numChildren!=numParameters) throw new WSException("Invalid number of payload elements: " + numChildren);
+ // Verify the numer of parameters matches the actual message payload
+ int numChildElements = 0;
+ Iterator itElements = soapBodyElement.getChildElements();
+ while (itElements.hasNext())
+ {
+ Node node = (Node)itElements.next();
+ if (node instanceof SOAPElement)
+ numChildElements++;
+ }
+ if (numChildElements != numParameters)
+ throw new WSException("Invalid number of payload elements: " + numChildElements);
}
// Generic message endpoint
Modified: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/LogicalMessageImpl.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/LogicalMessageImpl.java 2007-04-23 08:00:28 UTC (rev 2898)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/jaxws/handler/LogicalMessageImpl.java 2007-04-23 12:30:58 UTC (rev 2899)
@@ -105,6 +105,7 @@
{
try
{
+ soapBody.removeContents();
EnvelopeBuilderDOM builder = new EnvelopeBuilderDOM(style);
Element domBodyElement = DOMUtils.sourceToElement(source);
builder.buildBodyElementRpc(soapBody, domBodyElement);
Modified: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java 2007-04-23 08:00:28 UTC (rev 2898)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java 2007-04-23 12:30:58 UTC (rev 2899)
@@ -26,10 +26,11 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
-import java.util.Iterator;
import javax.xml.namespace.QName;
import javax.xml.soap.Name;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPBodyElement;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPException;
@@ -42,7 +43,10 @@
import org.jboss.ws.WSException;
import org.jboss.ws.core.jaxrpc.Style;
import org.jboss.ws.core.utils.DOMUtils;
+import org.w3c.dom.Comment;
+import org.w3c.dom.Document;
import org.w3c.dom.Element;
+import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
@@ -58,10 +62,12 @@
// provide logging
private static Logger log = Logger.getLogger(EnvelopeBuilderDOM.class);
- private Style style = Style.DOCUMENT;
+ private SOAPFactoryImpl soapFactory;
+ private Style style;
public EnvelopeBuilderDOM(Style style)
{
+ this.soapFactory = new SOAPFactoryImpl();
this.style = style;
}
@@ -107,29 +113,71 @@
public SOAPEnvelope build(SOAPMessage soapMessage, Element domEnv) throws SOAPException
{
- String envNS = domEnv.getNamespaceURI();
- String envPrefix = domEnv.getPrefix();
-
// Construct the envelope
- SOAPFactoryImpl soapFactory = new SOAPFactoryImpl();
SOAPPartImpl soapPart = (SOAPPartImpl)soapMessage.getSOAPPart();
- SOAPEnvelopeImpl soapEnv = new SOAPEnvelopeImpl(soapPart, soapFactory.createElement(domEnv, false));
+ SOAPEnvelopeImpl soapEnv = new SOAPEnvelopeImpl(soapPart, soapFactory.createElement(domEnv, false), false);
+ Document ownerDoc = soapEnv.getOwnerDocument();
DOMUtils.copyAttributes(soapEnv, domEnv);
- // Add the header elements
- Element domHeader = DOMUtils.getFirstChildElement(domEnv, new QName(envNS, "Header"));
- if (domHeader != null)
+ NodeList envChildNodes = domEnv.getChildNodes();
+ for (int i = 0; i < envChildNodes.getLength(); i++)
{
- SOAPHeader soapHeader = soapEnv.getHeader();
+ Node child = envChildNodes.item(i);
+ short childType = child.getNodeType();
+ if (childType == Node.ELEMENT_NODE)
+ {
+ String elName = child.getLocalName();
+ if ("Header".equals(elName))
+ {
+ buildSOAPHeader(soapEnv, (Element)child);
+ }
+ else if ("Body".equals(elName))
+ {
+ buildSOAPBody(soapEnv, (Element)child);
+ }
+ else
+ {
+ log.warn("Ignore envelope chile element: " + elName);
+ }
+ }
+ else if (childType == Node.COMMENT_NODE)
+ {
+ String nodeValue = child.getNodeValue();
+ Comment comment = ownerDoc.createComment(nodeValue);
+ soapEnv.appendChild(comment);
+ }
+ else if (childType == Node.TEXT_NODE)
+ {
+ String nodeValue = child.getNodeValue();
+ soapEnv.addTextNode(nodeValue);
+ }
+ else
+ {
+ log.warn("Ignore child type: " + childType);
+ }
+ }
- DOMUtils.copyAttributes(soapHeader, domHeader);
+ return soapEnv;
+ }
- Iterator it = DOMUtils.getChildElements(domHeader);
- while (it.hasNext())
+ private SOAPHeader buildSOAPHeader(SOAPEnvelopeImpl soapEnv, Element domHeader) throws SOAPException
+ {
+ SOAPHeader soapHeader = soapEnv.getHeader();
+ if (soapHeader == null)
+ soapHeader = soapEnv.addHeader();
+
+ Document ownerDoc = soapEnv.getOwnerDocument();
+ DOMUtils.copyAttributes(soapHeader, domHeader);
+
+ NodeList headerChildNodes = domHeader.getChildNodes();
+ for (int i = 0; i < headerChildNodes.getLength(); i++)
+ {
+ Node child = headerChildNodes.item(i);
+ short childType = child.getNodeType();
+ if (childType == Node.ELEMENT_NODE)
{
- Element srcElement = (Element)it.next();
- //registerNamespacesLocally(srcElement);
+ Element srcElement = (Element)child;
XMLFragment xmlFragment = new XMLFragment(new DOMSource(srcElement));
Name name = new NameImpl(srcElement.getLocalName(), srcElement.getPrefix(), srcElement.getNamespaceURI());
@@ -139,99 +187,75 @@
DOMUtils.copyAttributes(destElement, srcElement);
destElement.setXMLFragment(xmlFragment);
}
+ else if (childType == Node.COMMENT_NODE)
+ {
+ String nodeValue = child.getNodeValue();
+ Comment comment = ownerDoc.createComment(nodeValue);
+ soapHeader.appendChild(comment);
+ }
+ else if (childType == Node.TEXT_NODE)
+ {
+ String nodeValue = child.getNodeValue();
+ soapHeader.addTextNode(nodeValue);
+ }
+ else
+ {
+ log.warn("Ignore child type: " + childType);
+ }
}
- // Add the body elements
- Element domBody = DOMUtils.getFirstChildElement(domEnv, new QName(envNS, "Body"));
+ return soapHeader;
+ }
+
+ private SOAPBody buildSOAPBody(SOAPEnvelopeImpl soapEnv, Element domBody) throws SOAPException
+ {
+ String envNS = soapEnv.getNamespaceURI();
+
SOAPBodyImpl soapBody = (SOAPBodyImpl)soapEnv.getBody();
+ if (soapBody == null)
+ soapBody = (SOAPBodyImpl)soapEnv.addBody();
+ Document ownerDoc = soapBody.getOwnerDocument();
DOMUtils.copyAttributes(soapBody, domBody);
- Iterator itBody = DOMUtils.getChildElements(domBody);
- if (itBody.hasNext())
+ SOAPBodyElement soapBodyElement = null;
+ boolean attachHRefElements = Constants.URI_SOAP11_ENC.equals(soapEnv.getAttributeNS(envNS, "encodingStyle"));
+
+ NodeList bodyChildNodes = domBody.getChildNodes();
+ for (int i = 0; i < bodyChildNodes.getLength(); i++)
{
- Element domBodyElement = (Element)itBody.next();
-
- String localName = domBodyElement.getLocalName();
- String prefix = domBodyElement.getPrefix();
- String nsURI = domBodyElement.getNamespaceURI();
- Name beName = new NameImpl(localName, prefix, nsURI);
-
- // Process a <env:Fault> message
- if (beName.equals(new NameImpl("Fault", envPrefix, envNS)))
+ Node child = bodyChildNodes.item(i);
+ short childType = child.getNodeType();
+ if (childType == Node.ELEMENT_NODE)
{
- SOAPFaultImpl soapFault = new SOAPFaultImpl(envPrefix, envNS);
- soapBody.addChildElement(soapFault);
-
- DOMUtils.copyAttributes(soapFault, domBodyElement);
-
- // copy everything and let soapFault discover child elements itself
- XMLFragment xmlFragment = new XMLFragment(new DOMSource(domBodyElement));
- soapFault.setXMLFragment(xmlFragment);
- }
-
- // Process and RPC or DOCUMENT style message
- else
- {
-
- if (style == Style.RPC)
+ if (soapBodyElement == null)
{
- buildBodyElementRpc(soapBody, domBodyElement);
+ soapBodyElement = buildSOAPBodyElement(soapEnv, (Element)child);
+ attachHRefElements = attachHRefElements || Constants.URI_SOAP11_ENC.equals(soapBody.getAttributeNS(envNS, "encodingStyle"));
}
- else if (style == Style.DOCUMENT)
+ else if (attachHRefElements)
{
- buildBodyElementDoc(soapBody, domBodyElement);
+ // Process additional soap encoded body elements
+ soapBody.addChildElement(soapFactory.createElement((Element)child, true));
}
- else if (style == null)
- {
- SOAPBodyElementMessage soapBodyElement = new SOAPBodyElementMessage(beName);
- soapBodyElement = (SOAPBodyElementMessage)soapBody.addChildElement(soapBodyElement);
-
- DOMUtils.copyAttributes(soapBodyElement, domBodyElement);
-
- NodeList nlist = domBodyElement.getChildNodes();
- for (int i = 0; i < nlist.getLength(); i++)
- {
- org.w3c.dom.Node child = nlist.item(i);
- short childType = child.getNodeType();
- if (childType == org.w3c.dom.Node.ELEMENT_NODE)
- {
- SOAPElement soapElement = soapFactory.createElement((Element)child);
- soapBodyElement.addChildElement(soapElement);
- }
- else if (childType == org.w3c.dom.Node.TEXT_NODE)
- {
- String nodeValue = child.getNodeValue();
- soapBodyElement.addTextNode(nodeValue);
- }
- else if (childType == org.w3c.dom.Node.CDATA_SECTION_NODE)
- {
- String nodeValue = child.getNodeValue();
- soapBodyElement.addTextNode(nodeValue);
- }
- else
- {
- log.warn("Ignore child type: " + childType);
- }
- }
- }
- else
- {
- throw new WSException("Unsupported message style: " + style);
- }
}
+ else if (childType == Node.COMMENT_NODE)
+ {
+ String nodeValue = child.getNodeValue();
+ Comment comment = ownerDoc.createComment(nodeValue);
+ soapBody.appendChild(comment);
+ }
+ else if (childType == Node.TEXT_NODE)
+ {
+ String nodeValue = child.getNodeValue();
+ soapBody.addTextNode(nodeValue);
+ }
+ else
+ {
+ log.warn("Ignore child type: " + childType);
+ }
}
- // Process additional soap encoded body elements
- boolean attachHRefElements = Constants.URI_SOAP11_ENC.equals(soapEnv.getAttributeNS(envNS, "encodingStyle"));
- attachHRefElements = attachHRefElements || Constants.URI_SOAP11_ENC.equals(soapBody.getAttributeNS(envNS, "encodingStyle"));
- attachHRefElements = attachHRefElements && itBody.hasNext();
- while (attachHRefElements && itBody.hasNext())
- {
- Element srcElement = (Element)itBody.next();
- soapBody.addChildElement(soapFactory.createElement(srcElement, true));
- }
-
// Inline all attached href elements
if (attachHRefElements)
{
@@ -239,48 +263,158 @@
inlineHandler.processHRefs();
}
- return soapEnv;
+ return soapBody;
}
+ private SOAPBodyElement buildSOAPBodyElement(SOAPEnvelopeImpl soapEnv, Element domBodyElement) throws SOAPException
+ {
+ String envNS = soapEnv.getNamespaceURI();
+ String envPrefix = soapEnv.getPrefix();
+
+ SOAPBodyImpl soapBody = (SOAPBodyImpl)soapEnv.getBody();
+ QName beName = DOMUtils.getElementQName(domBodyElement);
+
+ SOAPBodyElement soapBodyElement = null;
+
+ // Process a <env:Fault> message
+ if (beName.equals(new QName(envNS, "Fault")))
+ {
+ SOAPFaultImpl soapFault = new SOAPFaultImpl(envPrefix, envNS);
+ soapBody.addChildElement(soapFault);
+ soapBodyElement = soapFault;
+
+ DOMUtils.copyAttributes(soapFault, domBodyElement);
+
+ // copy everything and let soapFault discover child elements itself
+ XMLFragment xmlFragment = new XMLFragment(new DOMSource(domBodyElement));
+ soapFault.setXMLFragment(xmlFragment);
+ }
+
+ // Process and RPC or DOCUMENT style message
+ else
+ {
+ if (style == Style.DOCUMENT)
+ {
+ buildBodyElementDoc(soapBody, domBodyElement);
+ }
+ else if (style == Style.RPC)
+ {
+ soapBodyElement = buildBodyElementRpc(soapBody, domBodyElement);
+ }
+ else if (style == null)
+ {
+ buildBodyElementDefault(soapBody, domBodyElement);
+ }
+ else
+ {
+ throw new WSException("Unsupported message style: " + style);
+ }
+ }
+
+ return soapBodyElement;
+ }
+
public void buildBodyElementDoc(SOAPBodyImpl soapBody, Element domBodyElement) throws SOAPException
{
- soapBody.removeContents();
-
Element srcElement = (Element)domBodyElement;
QName beName = DOMUtils.getElementQName(domBodyElement);
- SOAPContentElement destElement = new SOAPBodyElementDoc(beName);
- destElement = (SOAPContentElement)soapBody.addChildElement(destElement);
+ SOAPContentElement contentElement = new SOAPBodyElementDoc(beName);
+ contentElement = (SOAPContentElement)soapBody.addChildElement(contentElement);
- DOMUtils.copyAttributes(destElement, srcElement);
+ DOMUtils.copyAttributes(contentElement, srcElement);
XMLFragment xmlFragment = new XMLFragment(new DOMSource(srcElement));
- destElement.setXMLFragment(xmlFragment);
+ contentElement.setXMLFragment(xmlFragment);
}
- public void buildBodyElementRpc(SOAPBodyImpl soapBody, Element domBodyElement) throws SOAPException
+ public SOAPBodyElement buildBodyElementRpc(SOAPBodyImpl soapBody, Element domBodyElement) throws SOAPException
{
- soapBody.removeContents();
-
QName beName = DOMUtils.getElementQName(domBodyElement);
SOAPBodyElementRpc soapBodyElement = new SOAPBodyElementRpc(beName);
soapBodyElement = (SOAPBodyElementRpc)soapBody.addChildElement(soapBodyElement);
+ Document ownerDoc = soapBody.getOwnerDocument();
DOMUtils.copyAttributes(soapBodyElement, domBodyElement);
- Iterator itBodyElement = DOMUtils.getChildElements(domBodyElement);
- while (itBodyElement.hasNext())
+ NodeList nlist = domBodyElement.getChildNodes();
+ for (int i = 0; i < nlist.getLength(); i++)
{
- Element srcElement = (Element)itBodyElement.next();
+ Node child = nlist.item(i);
+ short childType = child.getNodeType();
+ if (childType == Node.ELEMENT_NODE)
+ {
+ Element srcElement = (Element)child;
+ Name name = new NameImpl(srcElement.getLocalName(), srcElement.getPrefix(), srcElement.getNamespaceURI());
+ SOAPContentElement destElement = new SOAPContentElement(name);
+ destElement = (SOAPContentElement)soapBodyElement.addChildElement(destElement);
- Name name = new NameImpl(srcElement.getLocalName(), srcElement.getPrefix(), srcElement.getNamespaceURI());
- SOAPContentElement destElement = new SOAPContentElement(name);
- destElement = (SOAPContentElement)soapBodyElement.addChildElement(destElement);
+ DOMUtils.copyAttributes(destElement, srcElement);
- DOMUtils.copyAttributes(destElement, srcElement);
+ XMLFragment xmlFragment = new XMLFragment(new DOMSource(srcElement));
+ destElement.setXMLFragment(xmlFragment);
+ }
+ else if (childType == Node.COMMENT_NODE)
+ {
+ String nodeValue = child.getNodeValue();
+ Comment comment = ownerDoc.createComment(nodeValue);
+ soapBodyElement.appendChild(comment);
+ }
+ else if (childType == Node.TEXT_NODE)
+ {
+ String nodeValue = child.getNodeValue();
+ soapBodyElement.addTextNode(nodeValue);
+ }
+ else
+ {
+ log.warn("Ignore child type: " + childType);
+ }
+ }
- XMLFragment xmlFragment = new XMLFragment(new DOMSource(srcElement));
- destElement.setXMLFragment(xmlFragment);
+ return soapBodyElement;
+ }
+
+ public SOAPBodyElement buildBodyElementDefault(SOAPBodyImpl soapBody, Element domBodyElement) throws SOAPException
+ {
+ QName beName = DOMUtils.getElementQName(domBodyElement);
+ SOAPBodyElement soapBodyElement = new SOAPBodyElementMessage(beName);
+ soapBodyElement = (SOAPBodyElementMessage)soapBody.addChildElement(soapBodyElement);
+
+ Document ownerDoc = soapBody.getOwnerDocument();
+ DOMUtils.copyAttributes(soapBodyElement, domBodyElement);
+
+ NodeList nlist = domBodyElement.getChildNodes();
+ for (int i = 0; i < nlist.getLength(); i++)
+ {
+ Node child = nlist.item(i);
+ short childType = child.getNodeType();
+ if (childType == Node.ELEMENT_NODE)
+ {
+ SOAPElement soapElement = soapFactory.createElement((Element)child);
+ soapBodyElement.addChildElement(soapElement);
+ }
+ else if (childType == Node.COMMENT_NODE)
+ {
+ String nodeValue = child.getNodeValue();
+ Comment comment = ownerDoc.createComment(nodeValue);
+ soapBodyElement.appendChild(comment);
+ }
+ else if (childType == Node.TEXT_NODE)
+ {
+ String nodeValue = child.getNodeValue();
+ soapBodyElement.addTextNode(nodeValue);
+ }
+ else if (childType == Node.CDATA_SECTION_NODE)
+ {
+ String nodeValue = child.getNodeValue();
+ soapBodyElement.addTextNode(nodeValue);
+ }
+ else
+ {
+ log.warn("Ignore child type: " + childType);
+ }
}
+
+ return soapBodyElement;
}
}
Modified: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/soap/EnvelopeBuilderStax.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/soap/EnvelopeBuilderStax.java 2007-04-23 08:00:28 UTC (rev 2898)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/soap/EnvelopeBuilderStax.java 2007-04-23 12:30:58 UTC (rev 2899)
@@ -256,7 +256,7 @@
if (Part.ENVELOPE == currentPart)
{
// setup envelope impl
- soapEnv = new SOAPEnvelopeImpl(soapPart, qName.getNamespaceURI());
+ soapEnv = new SOAPEnvelopeImpl(soapPart, qName.getNamespaceURI(), false);
destElement = soapEnv; // soapEnv becomes current
}
else if (Part.HEADER == currentPart)
Modified: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/soap/MessageFactoryImpl.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/soap/MessageFactoryImpl.java 2007-04-23 08:00:28 UTC (rev 2898)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/soap/MessageFactoryImpl.java 2007-04-23 12:30:58 UTC (rev 2899)
@@ -154,7 +154,7 @@
SOAPMessageImpl soapMessage = new SOAPMessageImpl();
SOAPPartImpl soapPart = (SOAPPartImpl)soapMessage.getSOAPPart();
- new SOAPEnvelopeImpl(soapPart, envNamespace);
+ new SOAPEnvelopeImpl(soapPart, envNamespace, true);
return soapMessage;
}
Modified: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/soap/NodeImpl.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/soap/NodeImpl.java 2007-04-23 08:00:28 UTC (rev 2898)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/soap/NodeImpl.java 2007-04-23 12:30:58 UTC (rev 2899)
@@ -552,6 +552,10 @@
{
retNode = new TextImpl(node);
}
+ else if (node instanceof org.w3c.dom.Comment)
+ {
+ retNode = new TextImpl(node);
+ }
else
{
throw new DOMException(DOMException.NOT_SUPPORTED_ERR, "Operation not supported on this type of node: " + node);
Modified: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyElementMessage.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyElementMessage.java 2007-04-23 08:00:28 UTC (rev 2898)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyElementMessage.java 2007-04-23 12:30:58 UTC (rev 2899)
@@ -23,8 +23,8 @@
import java.io.Writer;
+import javax.xml.namespace.QName;
import javax.xml.rpc.JAXRPCException;
-import javax.xml.soap.Name;
import javax.xml.soap.SOAPBodyElement;
import org.jboss.ws.core.utils.DOMWriter;
@@ -39,7 +39,7 @@
*/
public class SOAPBodyElementMessage extends SOAPElementImpl implements SOAPBodyElement
{
- public SOAPBodyElementMessage(Name name)
+ public SOAPBodyElementMessage(QName name)
{
super(name);
}
Modified: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java 2007-04-23 08:00:28 UTC (rev 2898)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPBodyImpl.java 2007-04-23 12:30:58 UTC (rev 2899)
@@ -38,6 +38,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.Constants;
import org.jboss.ws.core.utils.DOMUtils;
+import org.w3c.dom.Comment;
import org.w3c.dom.DOMException;
import org.w3c.dom.Document;
import org.w3c.dom.DocumentFragment;
@@ -254,10 +255,14 @@
return newDocument;
}
- private static boolean needsConversionToBodyElement(Node node)
+ private static boolean needsConversionToBodyElement(Node newChild)
{
// JBCTS-440 #addTextNodeTest1 appends a Text node to a SOAPBody
- return !(node instanceof SOAPBodyElement || node instanceof DocumentFragment || node instanceof Text);
+ boolean validChild = newChild instanceof SOAPBodyElement;
+ validChild = validChild || newChild instanceof DocumentFragment;
+ validChild = validChild || newChild instanceof Text;
+ validChild = validChild || newChild instanceof Comment;
+ return validChild == false;
}
private static SOAPBodyElementDoc convertToBodyElement(Node node)
Modified: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPEnvelopeImpl.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPEnvelopeImpl.java 2007-04-23 08:00:28 UTC (rev 2898)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPEnvelopeImpl.java 2007-04-23 12:30:58 UTC (rev 2899)
@@ -54,7 +54,7 @@
/** Construct a SOAP envelope for the given SOAP version URI prefix, etc.
*/
- public SOAPEnvelopeImpl(SOAPPartImpl soapPart, SOAPElement element) throws SOAPException
+ public SOAPEnvelopeImpl(SOAPPartImpl soapPart, SOAPElement element, boolean addHeaderAndBody) throws SOAPException
{
super((SOAPElementImpl)element);
@@ -71,16 +71,16 @@
assertEnvelopeNamespace(namespaceURI);
addNamespaceDeclaration(prefix, namespaceURI);
- // the Element source might already contain a Header and Body declaration
- if (null == soapPart.getEnvelope().getHeader())
+ if (addHeaderAndBody)
+ {
addHeader();
- if (null == soapPart.getEnvelope().getBody())
addBody();
+ }
}
/** Construct a SOAP envelope for the given SOAP version URI.
*/
- SOAPEnvelopeImpl(SOAPPartImpl soapPart, String namespace) throws SOAPException
+ SOAPEnvelopeImpl(SOAPPartImpl soapPart, String namespace, boolean addHeaderAndBody) throws SOAPException
{
super("Envelope", Constants.PREFIX_ENV, namespace);
@@ -90,8 +90,11 @@
assertEnvelopeNamespace(namespace);
addNamespaceDeclaration(getPrefix(), namespace);
- addHeader();
- addBody();
+ if (addHeaderAndBody)
+ {
+ addHeader();
+ addBody();
+ }
}
public SOAPMessage getSOAPMessage()
@@ -156,7 +159,7 @@
while (it.hasNext())
{
Node node = (Node)it.next();
- if (node.getLocalName().equals("Body"))
+ if ("Body".equals(node.getLocalName()))
return (SOAPBody)node;
}
return null;
@@ -168,7 +171,7 @@
while (it.hasNext())
{
Node node = (Node)it.next();
- if (node.getLocalName().equals("Header"))
+ if ("Header".equals(node.getLocalName()))
return (SOAPHeader)node;
}
return null;
@@ -179,7 +182,10 @@
*/
public SOAPElement addTextNode(String value) throws SOAPException
{
- throw new SOAPException("Cannot add Text node to SOAPEnvelope");
+ if (value.trim().length() > 0)
+ throw new SOAPException("Cannot add Text node to SOAPEnvelope");
+
+ return super.addTextNode(value);
}
public Document getOwnerDocument()
Modified: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPHeaderImpl.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPHeaderImpl.java 2007-04-23 08:00:28 UTC (rev 2898)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPHeaderImpl.java 2007-04-23 12:30:58 UTC (rev 2899)
@@ -36,6 +36,7 @@
import org.jboss.ws.Constants;
import org.jboss.ws.core.utils.SAAJUtils;
+import org.w3c.dom.Comment;
import org.w3c.dom.DOMException;
import org.w3c.dom.DocumentFragment;
import org.w3c.dom.Node;
@@ -272,7 +273,11 @@
private static boolean needsConversionToHeaderElement(Node newChild)
{
// JBCTS-440 #addTextNodeTest2 appends a Text node to a SOAPHeader
- return !(newChild instanceof SOAPHeaderElementImpl || newChild instanceof DocumentFragment || newChild instanceof Text);
+ boolean validChild = newChild instanceof SOAPHeaderElementImpl;
+ validChild = validChild || newChild instanceof DocumentFragment;
+ validChild = validChild || newChild instanceof Text;
+ validChild = validChild || newChild instanceof Comment;
+ return validChild == false;
}
private static SOAPHeaderElementImpl convertToHeaderElement(Node node)
Modified: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/soap/TextImpl.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/soap/TextImpl.java 2007-04-23 08:00:28 UTC (rev 2898)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/soap/TextImpl.java 2007-04-23 12:30:58 UTC (rev 2899)
@@ -42,8 +42,7 @@
*/
public boolean isComment()
{
- String value = getNodeValue().trim();
- return value.startsWith("<!--") && value.endsWith("-->");
+ return domNode.getNodeType() == org.w3c.dom.Node.COMMENT_NODE;
}
public String getValue()
Modified: branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/soap/XMLContent.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/soap/XMLContent.java 2007-04-23 08:00:28 UTC (rev 2898)
+++ branches/jbossws-2.0/jbossws-core/src/java/org/jboss/ws/core/soap/XMLContent.java 2007-04-23 12:30:58 UTC (rev 2899)
@@ -33,7 +33,6 @@
import javax.activation.DataHandler;
import javax.activation.DataSource;
import javax.xml.namespace.QName;
-import javax.xml.soap.Name;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPException;
import javax.xml.transform.Source;
@@ -54,6 +53,8 @@
import org.jboss.ws.extensions.xop.XOPContext;
import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.metadata.umdm.ParameterMetaData;
+import org.w3c.dom.Comment;
+import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
@@ -297,18 +298,13 @@
if (domElement == container)
return;
- String rootLocalName = domElement.getLocalName();
- String rootPrefix = domElement.getPrefix();
- String rootNS = domElement.getNamespaceURI();
- NameImpl contentRootName = new NameImpl(rootLocalName, rootPrefix, rootNS);
-
// Make sure the content root element name matches this element name
- Name name = container.getElementName();
QName qname = container.getElementQName();
+ QName contentRootName = DOMUtils.getElementQName(domElement);
boolean artificalElement = (SOAPContentElement.GENERIC_PARAM_NAME.equals(qname) || SOAPContentElement.GENERIC_RETURN_NAME.equals(qname));
- if (!artificalElement && !contentRootName.equals(name))
- throw new WSException("Content root name does not match element name: " + contentRootName + " != " + name);
+ if (!artificalElement && !contentRootName.equals(qname))
+ throw new WSException("Content root name does not match element name: " + contentRootName + " != " + qname);
// Remove all child nodes
container.removeContents();
@@ -317,11 +313,10 @@
// These need to be replaced (costly!)
if (artificalElement)
{
- QName xmlName = contentRootName.toQName();
- container.setElementQNameInternal(xmlName);
+ container.setElementQNameInternal(contentRootName);
}
- // Copy attributes
+ Document ownerDoc = container.getOwnerDocument();
DOMUtils.copyAttributes(container, domElement);
SOAPFactoryImpl soapFactory = new SOAPFactoryImpl();
@@ -335,7 +330,7 @@
{
SOAPElement soapElement = soapFactory.createElement((Element)child);
container.addChildElement(soapElement);
- if (Constants.NAME_XOP_INCLUDE.equals(name) || container.isXOPParameter())
+ if (Constants.NAME_XOP_INCLUDE.equals(qname) || container.isXOPParameter())
XOPContext.inlineXOPData(soapElement);
}
else if (childType == Node.TEXT_NODE)
@@ -343,6 +338,12 @@
String nodeValue = child.getNodeValue();
container.addTextNode(nodeValue);
}
+ else if (childType == Node.COMMENT_NODE)
+ {
+ String nodeValue = child.getNodeValue();
+ Comment comment = ownerDoc.createComment(nodeValue);
+ container.appendChild(comment);
+ }
else if (childType == Node.CDATA_SECTION_NODE)
{
String nodeValue = child.getNodeValue();
Modified: branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/common/soap/MessageFactoryTestCase.java
===================================================================
--- branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/common/soap/MessageFactoryTestCase.java 2007-04-23 08:00:28 UTC (rev 2898)
+++ branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/common/soap/MessageFactoryTestCase.java 2007-04-23 12:30:58 UTC (rev 2899)
@@ -25,18 +25,22 @@
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
+import java.io.IOException;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPBodyElement;
import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
import javax.xml.transform.stream.StreamSource;
import org.jboss.test.ws.JBossWSTest;
import org.jboss.ws.Constants;
+import org.jboss.ws.core.jaxrpc.Style;
import org.jboss.ws.core.soap.MessageFactoryImpl;
import org.jboss.ws.core.utils.DOMUtils;
+import org.jboss.ws.core.utils.DOMWriter;
import org.w3c.dom.Element;
/**
@@ -153,7 +157,7 @@
public void testPreserveComments() throws Exception
{
String expMsg =
- "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:ns1='http://somens.org'>" +
+ "<soapenv:Envelope xmlns:ns1='http://somens.org' xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'>" +
" <!-- header -->" +
" <soapenv:Header>" +
" <!-- header element -->" +
@@ -169,12 +173,27 @@
" </soapenv:Body>" +
"</soapenv:Envelope>";
- MessageFactory factory = new MessageFactoryImpl();
- ByteArrayInputStream inputStream = new ByteArrayInputStream(expMsg.getBytes());
+ // Verify that DOM parse/write do not modify the message
+ Element expEnv = DOMUtils.parse(expMsg);
+ assertEquals(expMsg, DOMWriter.printNode(expEnv, false));
+
+ doPreserveCommentsPerStyle(expMsg, Style.DOCUMENT);
+ doPreserveCommentsPerStyle(expMsg, Style.RPC);
+ doPreserveCommentsPerStyle(expMsg, null);
+ }
+
+ private void doPreserveCommentsPerStyle(String expXML, Style style) throws IOException, SOAPException
+ {
+ MessageFactoryImpl factory = new MessageFactoryImpl();
+ factory.setStyle(style);
+
+ ByteArrayInputStream inputStream = new ByteArrayInputStream(expXML.getBytes());
SOAPMessage soapMsg = factory.createMessage(null, inputStream);
- SOAPEnvelope env = soapMsg.getSOAPPart().getEnvelope();
+ SOAPEnvelope wasEnv = soapMsg.getSOAPPart().getEnvelope();
- System.out.println("FIXME: [JBWS-1511] MessageFactory does not preserve comments");
- //assertEquals(DOMUtils.parse(expMsg), (Element)env);
+ String wasXML = DOMWriter.printNode(wasEnv, false);
+ //System.out.println(expXML);
+ //System.out.println(wasXML);
+ assertEquals(expXML, wasXML);
}
}
\ No newline at end of file
Modified: branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/marshall/MarshallTest.java
===================================================================
--- branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/marshall/MarshallTest.java 2007-04-23 08:00:28 UTC (rev 2898)
+++ branches/jbossws-2.0/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/marshall/MarshallTest.java 2007-04-23 12:30:58 UTC (rev 2899)
@@ -1,24 +1,24 @@
/*
- * 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.
- */
+ * 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.jaxrpc.marshall;
import java.math.BigDecimal;
@@ -36,7 +36,7 @@
/**
* Test standard JAX-RPC types.
- *
+ *
* @author Thomas.Diesler(a)jboss.org
* @since 15-Feb-2005
*/
@@ -227,8 +227,8 @@
{
Calendar in = new GregorianCalendar(1968, 5, 16, 14, 23, 55);
/**
- * Will be a problem where the JVM is running in a TZ which
- * has Daylight Saving Time influence. So offset the TZ to GMT.
+ * Will be a problem where the JVM is running in a TZ which has Daylight
+ * Saving Time influence. So offset the TZ to GMT.
*/
in.setTimeZone(TimeZone.getTimeZone("GMT-0"));
Calendar out = calendarTest(in);
@@ -607,6 +607,11 @@
String in = "one";
String out = stringTest(in);
assertEquals(in, out);
+
+ System.out.println("FIXME: [JBWS-1617] JAXRPC doc/literal trims empty string");
+ //in = " ";
+ //out = stringTest(in);
+ //assertEquals(in, out);
}
public void testStringSpecialChars() throws Exception
17 years, 8 months
JBossWS SVN: r2898 - in trunk: integration-tomcat and 3 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-04-23 04:00:28 -0400 (Mon, 23 Apr 2007)
New Revision: 2898
Modified:
trunk/integration-tomcat/build.xml
trunk/integration/build.xml
trunk/jbossws-api/
trunk/jbossws-core/build.xml
trunk/jbossws-tests/build.xml
Log:
Fix build issues
Modified: trunk/integration/build.xml
===================================================================
--- trunk/integration/build.xml 2007-04-23 06:12:12 UTC (rev 2897)
+++ trunk/integration/build.xml 2007-04-23 08:00:28 UTC (rev 2898)
@@ -67,7 +67,7 @@
<!--
| Build all jar files.
-->
- <target name="integration-jars" depends="integration-compile,integration-module-jars" description="Builds all jar files.">
+ <target name="integration-jars" depends="integration-compile,integration-module-jars,api-jars" description="Builds all jar files.">
</target>
<!--
Modified: trunk/integration-tomcat/build.xml
===================================================================
--- trunk/integration-tomcat/build.xml 2007-04-23 06:12:12 UTC (rev 2897)
+++ trunk/integration-tomcat/build.xml 2007-04-23 08:00:28 UTC (rev 2898)
@@ -120,7 +120,7 @@
<unjar dest="${tomcat.output.lib.dir}/build" src="${thirdparty.dir}/concurrent.jar"/>
<unjar dest="${tomcat.output.lib.dir}/build" src="${thirdparty.dir}/jaxb-api.jar"/>
<unjar dest="${tomcat.output.lib.dir}/build" src="${thirdparty.dir}/jaxb-impl.jar"/>
- <unjar dest="${tomcat.output.lib.dir}/build" src="${thirdparty.dir}/jboss-common.jar"/>
+ <unjar dest="${tomcat.output.lib.dir}/build" src="${thirdparty.dir}/jboss-common-core.jar"/>
<unjar dest="${tomcat.output.lib.dir}/build" src="${thirdparty.dir}/jboss-j2ee.jar"/>
<unjar dest="${tomcat.output.lib.dir}/build" src="${thirdparty.dir}/jboss-container.jar"/>
<unjar dest="${tomcat.output.lib.dir}/build" src="${thirdparty.dir}/jboss-dependency.jar"/>
Property changes on: trunk/jbossws-api
___________________________________________________________________
Name: svn:ignore
+ output*
Modified: trunk/jbossws-core/build.xml
===================================================================
--- trunk/jbossws-core/build.xml 2007-04-23 06:12:12 UTC (rev 2897)
+++ trunk/jbossws-core/build.xml 2007-04-23 08:00:28 UTC (rev 2898)
@@ -71,7 +71,7 @@
<!--
| Build all jar files.
-->
- <target name="core-jars" depends="core-compile,core-module-jars" description="Builds all jar files.">
+ <target name="core-jars" depends="core-compile,core-module-jars,integration-jars" description="Builds all jar files.">
</target>
<!--
Modified: trunk/jbossws-tests/build.xml
===================================================================
--- trunk/jbossws-tests/build.xml 2007-04-23 06:12:12 UTC (rev 2897)
+++ trunk/jbossws-tests/build.xml 2007-04-23 08:00:28 UTC (rev 2898)
@@ -149,11 +149,12 @@
<property name="jbossws.classpath" value="jbossws.classpath.jdk14"/>
<path id="jbossws.classpath.jdk15">
+ <pathelement location="${api.output.lib.dir}/jboss-jaxrpc.jar"/>
+ <pathelement location="${api.output.lib.dir}/jboss-jaxws.jar"/>
+ <pathelement location="${api.output.lib.dir}/jboss-saaj.jar"/>
<pathelement location="${core.output.lib.dir}/jbossws-core.jar"/>
<pathelement location="${core.output.lib.dir}/jbossws-client.jar"/>
- <pathelement location="${core.output.lib.dir}/jboss-jaxrpc.jar"/>
- <pathelement location="${core.output.lib.dir}/jboss-jaxws.jar"/>
- <pathelement location="${core.output.lib.dir}/jboss-saaj.jar"/>
+ <pathelement location="${integration.output.lib.dir}/jbossws-integration.jar"/>
<pathelement location="${jboss50.output.lib.dir}/jbossws-jboss50-integration.jar"/>
<pathelement location="${jboss42.output.lib.dir}/jbossws-jboss42-integration.jar"/>
<pathelement location="${jboss40.output.lib.dir}/jbossws-jboss40-integration.jar"/>
17 years, 8 months