[jbossws-commits] JBossWS SVN: r2800 - in branches/dlofthouse/JBWS-1607: jbossws-core/src/java/org/jboss/ws/tools/helpers and 4 other directories.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Wed Apr 11 11:45:49 EDT 2007


Author: darran.lofthouse at 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 at 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




More information about the jbossws-commits mailing list