JBossWS SVN: r2807 - branches/dlofthouse.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2007-04-11 15:06:52 -0400 (Wed, 11 Apr 2007)
New Revision: 2807
Removed:
branches/dlofthouse/X/
Log:
No longer required.
19 years
JBossWS SVN: r2806 - branches/dlofthouse.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2007-04-11 15:03:56 -0400 (Wed, 11 Apr 2007)
New Revision: 2806
Added:
branches/dlofthouse/JBWS-429/
Log:
Recreate branch
Copied: branches/dlofthouse/JBWS-429 (from rev 2805, branches/dlofthouse/JBWS-1607)
19 years
JBossWS SVN: r2805 - branches/dlofthouse.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2007-04-11 15:02:56 -0400 (Wed, 11 Apr 2007)
New Revision: 2805
Added:
branches/dlofthouse/X/
Removed:
branches/dlofthouse/JBWS-429/
Log:
Move to recreate branch.
Copied: branches/dlofthouse/X (from rev 2804, branches/dlofthouse/JBWS-429)
19 years
JBossWS SVN: r2804 - in trunk: jbossws-tests/src/java/org/jboss/test/ws/common/utils and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-04-11 13:58:59 -0400 (Wed, 11 Apr 2007)
New Revision: 2804
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/utils/DOMWriter.java
trunk/jbossws-tests/src/java/org/jboss/test/ws/common/utils/DOMWriterTestCase.java
Log:
Fix duplicate default namespace declaration
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/utils/DOMWriter.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/utils/DOMWriter.java 2007-04-11 16:47:05 UTC (rev 2803)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/utils/DOMWriter.java 2007-04-11 17:58:59 UTC (rev 2804)
@@ -67,7 +67,6 @@
import java.util.Iterator;
import java.util.Map;
-import org.jboss.logging.Logger;
import org.w3c.dom.Attr;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
@@ -83,7 +82,6 @@
*/
public class DOMWriter
{
- private static Logger log = Logger.getLogger(DOMWriter.class);
// Print writer
private PrintWriter out;
// True, if canonical output
@@ -102,6 +100,8 @@
private Node rootNode;
// True if we want namespace completion
private boolean completeNamespaces = true;
+ // The current default namespace
+ private String currentDefaultNamespace;
public DOMWriter(Writer w)
{
@@ -290,6 +290,9 @@
String atName = attr.getNodeName();
String atValue = normalize(attr.getNodeValue(), canonical);
+ if (atName.equals("xmlns"))
+ currentDefaultNamespace = atValue;
+
if (atPrefix != null && !atPrefix.equals("xmlns") && !atPrefix.equals("xml"))
{
String nsURI = getNamespaceURI(atPrefix, element, rootNode);
@@ -332,9 +335,16 @@
// The SAX ContentHandler will by default not add the namespace declaration
// <Hello xmlns='http://somens'>World</Hello>
- if (elPrefix == null && elNamespaceURI != null && element.getAttribute("xmlns").length() == 0)
- out.print(" xmlns='" + elNamespaceURI + "'");
-
+ if (elPrefix == null && elNamespaceURI != null)
+ {
+ String defaultNamespace = element.getAttribute("xmlns");
+ if (defaultNamespace.length() == 0 && !elNamespaceURI.equals(currentDefaultNamespace))
+ {
+ out.print(" xmlns='" + elNamespaceURI + "'");
+ currentDefaultNamespace = elNamespaceURI;
+ }
+ }
+
if (hasChildNodes)
{
out.print('>');
Modified: trunk/jbossws-tests/src/java/org/jboss/test/ws/common/utils/DOMWriterTestCase.java
===================================================================
--- trunk/jbossws-tests/src/java/org/jboss/test/ws/common/utils/DOMWriterTestCase.java 2007-04-11 16:47:05 UTC (rev 2803)
+++ trunk/jbossws-tests/src/java/org/jboss/test/ws/common/utils/DOMWriterTestCase.java 2007-04-11 17:58:59 UTC (rev 2804)
@@ -222,30 +222,31 @@
public void testElementNamespaceURIElementNS() throws Exception
{
- String xmlIn = "<Hello xmlns='http://somens'>World</Hello>";
+ String xmlIn = "<Hello xmlns='http://somens'><Sub>World</Sub></Hello>";
Element root = DOMUtils.createElement(new QName("http://somens", "Hello"));
assertEquals("http://somens", root.getNamespaceURI());
- root.setTextContent("World");
+ Element child = (Element)root.appendChild(DOMUtils.createElement(new QName("Sub")));
+ child.setTextContent("World");
- String xmlOut = DOMWriter.printNode(root, true);
+ String xmlOut = DOMWriter.printNode(root, false);
assertEquals(xmlIn, xmlOut);
}
public void testElementNamespaceURIDocumentParse() throws Exception
{
- String xmlIn = "<Hello xmlns='http://somens'>World</Hello>";
+ String xmlIn = "<Hello xmlns='http://somens'><Sub>World</Sub></Hello>";
Element root = DOMUtils.parse(xmlIn);
assertEquals("http://somens", root.getNamespaceURI());
- String xmlOut = DOMWriter.printNode(root, true);
+ String xmlOut = DOMWriter.printNode(root, false);
assertEquals(xmlIn, xmlOut);
}
public void testElementNamespaceURITransformer() throws Exception
{
- String xmlIn = "<Hello xmlns='http://somens'>World</Hello>";
+ String xmlIn = "<Hello xmlns='http://somens'><Sub>World</Sub></Hello>";
StreamSource source = new StreamSource(new ByteArrayInputStream(xmlIn.getBytes()));
Transformer transformer = TransformerFactory.newInstance().newTransformer();
@@ -256,7 +257,7 @@
Element root = ((Document)result.getNode()).getDocumentElement();
assertEquals("http://somens", root.getNamespaceURI());
- String xmlOut = DOMWriter.printNode(root, true);
+ String xmlOut = DOMWriter.printNode(root, false);
assertEquals(xmlIn, xmlOut);
}
}
19 years
JBossWS SVN: r2803 - trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-04-11 12:47:05 -0400 (Wed, 11 Apr 2007)
New Revision: 2803
Modified:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ApplicationMetaDataAdaptor.java
Log:
Simplify
Modified: trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ApplicationMetaDataAdaptor.java
===================================================================
--- trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ApplicationMetaDataAdaptor.java 2007-04-11 16:44:27 UTC (rev 2802)
+++ trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ApplicationMetaDataAdaptor.java 2007-04-11 16:47:05 UTC (rev 2803)
@@ -62,22 +62,18 @@
public static UnifiedApplicationMetaData buildUnifiedApplicationMetaData(DeploymentUnit unit, Ejb3Deployment ejb3Deployment)
{
UnifiedApplicationMetaData umd = new UnifiedApplicationMetaData();
- List<UnifiedBeanMetaData> beans = new ArrayList<UnifiedBeanMetaData>();
+ List<UnifiedBeanMetaData> ubmdList = new ArrayList<UnifiedBeanMetaData>();
Iterator<Container> it = ejb3Deployment.getEjbContainers().values().iterator();
while (it.hasNext())
{
EJBContainer container = (EJBContainer)it.next();
- UnifiedBeanMetaData ubmd = buildUnifiedBeanMetaData(container);
- if (ubmd != null)
- {
- beans.add(ubmd);
- }
+ buildUnifiedBeanMetaData(ubmdList, container);
}
- umd.setEnterpriseBeans(beans);
+ umd.setEnterpriseBeans(ubmdList);
return umd;
}
- private static UnifiedBeanMetaData buildUnifiedBeanMetaData(EJBContainer container)
+ private static void buildUnifiedBeanMetaData(List<UnifiedBeanMetaData> ubmdList, EJBContainer container)
{
UnifiedBeanMetaData ubmd = null;
if (container instanceof SessionContainer)
@@ -113,8 +109,9 @@
ubmd.setPortComponent(ejbPortComp);
}
+
+ ubmdList.add(ubmd);
}
- return ubmd;
}
public static UnifiedApplicationMetaData buildUnifiedApplicationMetaData(DeploymentUnit unit, ApplicationMetaData apmd)
19 years
JBossWS SVN: r2802 - trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-04-11 12:44:27 -0400 (Wed, 11 Apr 2007)
New Revision: 2802
Modified:
trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ApplicationMetaDataAdaptor.java
Log:
Add support for <port-component> on generic ejb3
Modified: trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ApplicationMetaDataAdaptor.java
===================================================================
--- trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ApplicationMetaDataAdaptor.java 2007-04-11 16:31:45 UTC (rev 2801)
+++ trunk/integration-jboss50/src/java/org/jboss/ws/integration/jboss50/ApplicationMetaDataAdaptor.java 2007-04-11 16:44:27 UTC (rev 2802)
@@ -32,10 +32,9 @@
import org.jboss.ejb3.EJBContainer;
import org.jboss.ejb3.Ejb3Deployment;
import org.jboss.ejb3.SessionContainer;
-import org.jboss.ejb3.metamodel.EnterpriseBean;
-import org.jboss.ejb3.metamodel.SessionEnterpriseBean;
-import org.jboss.ejb3.metamodel.Ejb3PortComponent;
import org.jboss.ejb3.mdb.MessagingContainer;
+import org.jboss.ejb3.metamodel.Ejb3PortComponent;
+import org.jboss.ejb3.metamodel.EnterpriseBean;
import org.jboss.logging.Logger;
import org.jboss.metadata.ApplicationMetaData;
import org.jboss.metadata.BeanMetaData;
@@ -98,25 +97,21 @@
ubmd.setEjbClass(container.getBeanClassName());
EnterpriseBean dd = container.getXml();
- if(dd!=null && (dd instanceof SessionEnterpriseBean))
+
+ // TODO: How do we deal with this?
+ if (dd.getPortComponents().size() > 1)
+ throw new IllegalArgumentException("TODO: Cannot handle more than one port-component per bean");
+
+ for (Ejb3PortComponent portComp : dd.getPortComponents())
{
- SessionEnterpriseBean sessionDD = (SessionEnterpriseBean)dd;
+ UnifiedEjbPortComponentMetaData ejbPortComp = new UnifiedEjbPortComponentMetaData();
+ ejbPortComp.setPortComponentName(portComp.getPortComponentName());
+ ejbPortComp.setPortComponentURI(portComp.getPortComponentURI());
+ ejbPortComp.setAuthMethod(portComp.getAuthMethod());
+ ejbPortComp.setTransportGuarantee(portComp.getTransportGuarantee());
+ ejbPortComp.setSecureWSDLAccess(portComp.getSecureWSDLAccess());
- // TODO: How do we deal with this?
- if(sessionDD.getPortComponents().size()>1)
- throw new IllegalArgumentException("TODO: Cannot handle more than one port-component per bean");
-
- for(Ejb3PortComponent portComp : sessionDD.getPortComponents())
- {
- UnifiedEjbPortComponentMetaData ejbPortComp = new UnifiedEjbPortComponentMetaData();
- ejbPortComp.setPortComponentName(portComp.getPortComponentName());
- ejbPortComp.setPortComponentURI(portComp.getPortComponentURI());
- ejbPortComp.setAuthMethod(portComp.getAuthMethod());
- ejbPortComp.setTransportGuarantee(portComp.getTransportGuarantee());
- ejbPortComp.setSecureWSDLAccess(portComp.getSecureWSDLAccess());
-
- ubmd.setPortComponent(ejbPortComp);
- }
+ ubmd.setPortComponent(ejbPortComp);
}
}
return ubmd;
@@ -136,7 +131,8 @@
private static PublishLocationAdapter getPublishLocationAdpater(final ApplicationMetaData apmd)
{
- return new PublishLocationAdapter() {
+ return new PublishLocationAdapter()
+ {
public String getWsdlPublishLocationByName(String name)
{
return apmd.getWsdlPublishLocationByName(name);
19 years
JBossWS SVN: r2801 - in branches/dlofthouse/JBWS-1607/jbossws-tests/src: resources/tools/jbws1607 and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2007-04-11 12:31:45 -0400 (Wed, 11 Apr 2007)
New Revision: 2801
Added:
branches/dlofthouse/JBWS-1607/jbossws-tests/src/resources/tools/jbws1607/PhoneBook_PortType.java
branches/dlofthouse/JBWS-1607/jbossws-tests/src/resources/tools/jbws1607/jaxrpc-mapping.xml
Modified:
branches/dlofthouse/JBWS-1607/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws1607/JBWS1607TestCase.java
Log:
Completed test case.
Modified: branches/dlofthouse/JBWS-1607/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 15:45:49 UTC (rev 2800)
+++ 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)
@@ -21,7 +21,12 @@
*/
package org.jboss.test.ws.tools.jbws1607;
-import org.jboss.test.ws.tools.WSToolsTest;
+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;
/**
@@ -34,7 +39,7 @@
* @author darran.lofthouse(a)jboss.com
* @since 11 Apr 2007
*/
-public class JBWS1607TestCase extends WSToolsTest
+public class JBWS1607TestCase extends JBossWSTest
{
/**
@@ -48,5 +53,55 @@
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();
+ }
}
Added: branches/dlofthouse/JBWS-1607/jbossws-tests/src/resources/tools/jbws1607/PhoneBook_PortType.java
===================================================================
--- branches/dlofthouse/JBWS-1607/jbossws-tests/src/resources/tools/jbws1607/PhoneBook_PortType.java (rev 0)
+++ branches/dlofthouse/JBWS-1607/jbossws-tests/src/resources/tools/jbws1607/PhoneBook_PortType.java 2007-04-11 16:31:45 UTC (rev 2801)
@@ -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;
+}
Property changes on: branches/dlofthouse/JBWS-1607/jbossws-tests/src/resources/tools/jbws1607/PhoneBook_PortType.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/dlofthouse/JBWS-1607/jbossws-tests/src/resources/tools/jbws1607/jaxrpc-mapping.xml
===================================================================
--- branches/dlofthouse/JBWS-1607/jbossws-tests/src/resources/tools/jbws1607/jaxrpc-mapping.xml (rev 0)
+++ branches/dlofthouse/JBWS-1607/jbossws-tests/src/resources/tools/jbws1607/jaxrpc-mapping.xml 2007-04-11 16:31:45 UTC (rev 2801)
@@ -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
Property changes on: branches/dlofthouse/JBWS-1607/jbossws-tests/src/resources/tools/jbws1607/jaxrpc-mapping.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
19 years
JBossWS SVN: r2800 - in branches/dlofthouse/JBWS-1607: 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-11 11:45:49 -0400 (Wed, 11 Apr 2007)
New Revision: 2800
Added:
branches/dlofthouse/JBWS-1607/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws1607/
branches/dlofthouse/JBWS-1607/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws1607/JBWS1607TestCase.java
branches/dlofthouse/JBWS-1607/jbossws-tests/src/resources/tools/jbws1607/
branches/dlofthouse/JBWS-1607/jbossws-tests/src/resources/tools/jbws1607/PhoneBook.wsdl
branches/dlofthouse/JBWS-1607/jbossws-tests/src/resources/tools/jbws1607/wstools-config.xml
Modified:
branches/dlofthouse/JBWS-1607/jbossws-core/src/java/org/jboss/ws/tools/WSDLToJava.java
branches/dlofthouse/JBWS-1607/jbossws-core/src/java/org/jboss/ws/tools/helpers/MappingFileGeneratorHelper.java
Log:
Initial test case and implementation for JBWS-1607.
Modified: branches/dlofthouse/JBWS-1607/jbossws-core/src/java/org/jboss/ws/tools/WSDLToJava.java
===================================================================
--- branches/dlofthouse/JBWS-1607/jbossws-core/src/java/org/jboss/ws/tools/WSDLToJava.java 2007-04-11 15:44:26 UTC (rev 2799)
+++ branches/dlofthouse/JBWS-1607/jbossws-core/src/java/org/jboss/ws/tools/WSDLToJava.java 2007-04-11 15:45:49 UTC (rev 2800)
@@ -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: branches/dlofthouse/JBWS-1607/jbossws-core/src/java/org/jboss/ws/tools/helpers/MappingFileGeneratorHelper.java
===================================================================
--- branches/dlofthouse/JBWS-1607/jbossws-core/src/java/org/jboss/ws/tools/helpers/MappingFileGeneratorHelper.java 2007-04-11 15:44:26 UTC (rev 2799)
+++ branches/dlofthouse/JBWS-1607/jbossws-core/src/java/org/jboss/ws/tools/helpers/MappingFileGeneratorHelper.java 2007-04-11 15:45:49 UTC (rev 2800)
@@ -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);
Added: branches/dlofthouse/JBWS-1607/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 (rev 0)
+++ branches/dlofthouse/JBWS-1607/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws1607/JBWS1607TestCase.java 2007-04-11 15:45:49 UTC (rev 2800)
@@ -0,0 +1,52 @@
+/*
+ * 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 org.jboss.test.ws.tools.WSToolsTest;
+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 WSToolsTest
+{
+
+ /**
+ * 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);
+ }
+}
Property changes on: branches/dlofthouse/JBWS-1607/jbossws-tests/src/java/org/jboss/test/ws/tools/jbws1607/JBWS1607TestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/dlofthouse/JBWS-1607/jbossws-tests/src/resources/tools/jbws1607/PhoneBook.wsdl
===================================================================
--- branches/dlofthouse/JBWS-1607/jbossws-tests/src/resources/tools/jbws1607/PhoneBook.wsdl (rev 0)
+++ branches/dlofthouse/JBWS-1607/jbossws-tests/src/resources/tools/jbws1607/PhoneBook.wsdl 2007-04-11 15:45:49 UTC (rev 2800)
@@ -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>
Property changes on: branches/dlofthouse/JBWS-1607/jbossws-tests/src/resources/tools/jbws1607/PhoneBook.wsdl
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: branches/dlofthouse/JBWS-1607/jbossws-tests/src/resources/tools/jbws1607/wstools-config.xml
===================================================================
--- branches/dlofthouse/JBWS-1607/jbossws-tests/src/resources/tools/jbws1607/wstools-config.xml (rev 0)
+++ branches/dlofthouse/JBWS-1607/jbossws-tests/src/resources/tools/jbws1607/wstools-config.xml 2007-04-11 15:45:49 UTC (rev 2800)
@@ -0,0 +1,5 @@
+<configuration>
+ <wsdl-java location="resources/tools/jbws1607/PhoneBook.wsdl" parameter-style="bare">
+ <mapping file="jaxrpc-mapping.xml"/>
+ </wsdl-java>
+</configuration>
Property changes on: branches/dlofthouse/JBWS-1607/jbossws-tests/src/resources/tools/jbws1607/wstools-config.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
19 years
JBossWS SVN: r2799 - branches/dlofthouse.
by jbossws-commits@lists.jboss.org
Author: darran.lofthouse(a)jboss.com
Date: 2007-04-11 11:44:26 -0400 (Wed, 11 Apr 2007)
New Revision: 2799
Added:
branches/dlofthouse/JBWS-1607/
Log:
Branch for JBWS-1607
Copied: branches/dlofthouse/JBWS-1607 (from rev 2798, trunk)
19 years
JBossWS SVN: r2798 - in trunk/jbossws-core/src/java/org/jboss/ws/core: soap and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2007-04-11 10:18:01 -0400 (Wed, 11 Apr 2007)
New Revision: 2798
Modified:
trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java
trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPPartImpl.java
Log:
Fix SOAPPart.setContent() with StreamSource based on Reader
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java 2007-04-11 14:11:16 UTC (rev 2797)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java 2007-04-11 14:18:01 UTC (rev 2798)
@@ -274,6 +274,11 @@
public AsyncRunnable(ResponseImpl response, AsyncHandler handler, Object payload)
{
+ if (response == null)
+ throw new IllegalArgumentException("Async response cannot be null");
+ if (payload == null)
+ throw new IllegalArgumentException("Async payload cannot be null");
+
this.response = response;
this.handler = handler;
this.payload = payload;
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-11 14:11:16 UTC (rev 2797)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java 2007-04-11 14:18:01 UTC (rev 2798)
@@ -25,6 +25,7 @@
import java.io.IOException;
import java.io.InputStream;
+import java.io.Reader;
import java.util.Iterator;
import javax.xml.namespace.QName;
@@ -43,6 +44,7 @@
import org.jboss.ws.core.utils.DOMUtils;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
+import org.xml.sax.InputSource;
/**
* A SOAPEnvelope builder for JAXRPC based on DOM
@@ -83,6 +85,26 @@
return build(soapMessage, domEnv);
}
+ public SOAPEnvelope build(SOAPMessage soapMessage, Reader reader, boolean ignoreParseError) throws IOException, SOAPException
+ {
+ // Parse the XML input stream
+ Element domEnv = null;
+ try
+ {
+ domEnv = DOMUtils.parse(new InputSource(reader));
+ }
+ catch (IOException ex)
+ {
+ if (ignoreParseError)
+ {
+ return null;
+ }
+ throw ex;
+ }
+
+ return build(soapMessage, domEnv);
+ }
+
public SOAPEnvelope build(SOAPMessage soapMessage, Element domEnv) throws SOAPException
{
String envNS = domEnv.getNamespaceURI();
Modified: trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPPartImpl.java
===================================================================
--- trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPPartImpl.java 2007-04-11 14:11:16 UTC (rev 2797)
+++ trunk/jbossws-core/src/java/org/jboss/ws/core/soap/SOAPPartImpl.java 2007-04-11 14:18:01 UTC (rev 2798)
@@ -24,11 +24,18 @@
// $Id$
import java.io.IOException;
+import java.io.InputStream;
+import java.io.Reader;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
-import javax.xml.soap.*;
+import javax.xml.soap.MimeHeaders;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.soap.SOAPPart;
import javax.xml.transform.Source;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamSource;
@@ -174,7 +181,12 @@
{
StreamSource streamSource = (StreamSource)source;
EnvelopeBuilderDOM envBuilder = new EnvelopeBuilderDOM(Style.DOCUMENT);
- envBuilder.build(soapMessage, streamSource.getInputStream(), false);
+ InputStream stream = streamSource.getInputStream();
+ Reader reader = streamSource.getReader();
+ if (stream != null)
+ envBuilder.build(soapMessage, stream, false);
+ else if (reader != null)
+ envBuilder.build(soapMessage, reader, false);
}
catch (IOException e)
{
19 years