[jboss-svn-commits] JBossWS SVN: r1128 - in trunk/src: main/java/org/jboss/ws/tools/client main/java/org/jboss/ws/tools/helpers test/java/org/jboss/test/ws/tools test/java/org/jboss/test/ws/tools/jbws1253 test/resources/tools test/resources/tools/jbws1253

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Oct 4 08:13:54 EDT 2006


Author: darran.lofthouse at jboss.com
Date: 2006-10-04 08:13:45 -0400 (Wed, 04 Oct 2006)
New Revision: 1128

Added:
   trunk/src/test/java/org/jboss/test/ws/tools/jbws1253/
   trunk/src/test/java/org/jboss/test/ws/tools/jbws1253/JBWS1253TestCase.java
   trunk/src/test/resources/tools/jbws1253/
   trunk/src/test/resources/tools/jbws1253/My.java
   trunk/src/test/resources/tools/jbws1253/MyPortTypeService.wsdl
   trunk/src/test/resources/tools/jbws1253/TestSEIService.java
   trunk/src/test/resources/tools/jbws1253/myporttype-mapping.xml
   trunk/src/test/resources/tools/jbws1253/wstools-config.xml
Removed:
   trunk/src/test/java/org/jboss/test/ws/tools/jbws1253/JBWS1253TestCase.java
   trunk/src/test/resources/tools/jbws1253/My.java
   trunk/src/test/resources/tools/jbws1253/MyPortTypeService.wsdl
   trunk/src/test/resources/tools/jbws1253/TestSEIService.java
   trunk/src/test/resources/tools/jbws1253/myporttype-mapping.xml
   trunk/src/test/resources/tools/jbws1253/wstools-config.xml
Modified:
   trunk/src/main/java/org/jboss/ws/tools/client/ServiceCreator.java
   trunk/src/main/java/org/jboss/ws/tools/helpers/MappingFileGeneratorHelper.java
Log:
JBWS-1253 - Correct wsdl-java naming of port when name ends 'PortType'.


Modified: trunk/src/main/java/org/jboss/ws/tools/client/ServiceCreator.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/tools/client/ServiceCreator.java	2006-10-04 12:03:45 UTC (rev 1127)
+++ trunk/src/main/java/org/jboss/ws/tools/client/ServiceCreator.java	2006-10-04 12:13:45 UTC (rev 1128)
@@ -67,6 +67,9 @@
     */
    protected WSDLDefinitions wsdl = null;
 
+   /** Singleton class that handles many utility functions */
+   private WSDLUtils utils = WSDLUtils.getInstance();
+   
    /**
     * Constructor
     */
@@ -194,6 +197,8 @@
    private String getReturnType(WSDLBinding wbind)
    {
       String portType = wbind.getInterface().getName().toString();
+      portType = utils.chopPortType(portType);
+      
       //Check if it conflicts with a service name
       if(wsdl.getService(new NCName(portType) ) != null)
          portType += "_PortType";
@@ -203,8 +208,7 @@
 
 
    private void generateServiceFile(WSDLService wsdlService) throws IOException
-   {
-      WSDLUtils utils = WSDLUtils.getInstance();
+   {      
       String serviceName = wsdlService.getName().toString();
       //Check if the serviceName conflicts with a portType or interface name
       if(wsdl.getInterface(new NCName(serviceName)) != null )

Modified: trunk/src/main/java/org/jboss/ws/tools/helpers/MappingFileGeneratorHelper.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/tools/helpers/MappingFileGeneratorHelper.java	2006-10-04 12:03:45 UTC (rev 1127)
+++ trunk/src/main/java/org/jboss/ws/tools/helpers/MappingFileGeneratorHelper.java	2006-10-04 12:13:45 UTC (rev 1128)
@@ -192,7 +192,7 @@
          String portTypeName = wsdlbind.getInterfaceName().getLocalPart();
          WSDLInterface wsdlintf = wsdlDefinitions.getInterface(new NCName(portTypeName));
          String portName = wsdlintf.getName().toString();
-         String javaPortName = portName;
+         String javaPortName = utils.chopPortType(portName);
          if(wsdlDefinitions.getService(new NCName(portName)) != null)
             javaPortName += "_PortType";
 

Copied: trunk/src/test/java/org/jboss/test/ws/tools/jbws1253 (from rev 1126, branches/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws1253)

Deleted: trunk/src/test/java/org/jboss/test/ws/tools/jbws1253/JBWS1253TestCase.java
===================================================================
--- branches/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws1253/JBWS1253TestCase.java	2006-10-04 10:50:27 UTC (rev 1126)
+++ trunk/src/test/java/org/jboss/test/ws/tools/jbws1253/JBWS1253TestCase.java	2006-10-04 12:13:45 UTC (rev 1128)
@@ -1,66 +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.tools.jbws1253;
-
-import java.io.File;
-import java.io.FileInputStream;
-
-import org.jboss.test.ws.JBossWSTest;
-import org.jboss.test.ws.tools.fixture.JBossSourceComparator;
-import org.jboss.ws.tools.WSTools;
-import org.jboss.ws.utils.DOMUtils;
-import org.w3c.dom.Element;
-
-/**
- * Test for a port name which ends 'PortType'
- *
- * @author <a href="mailto:darran.lofthouse at jboss.com">Darran Lofthouse</a>
- * @since 27th September 2006
- */
-public class JBWS1253TestCase extends JBossWSTest
-{
-   public final void testPortTypePort() throws Exception
-   {
-      String resourceDir = "resources/tools/jbws1253";
-      String toolsDir = "tools/jbws1253";
-      String[] args = new String[] { "-dest", toolsDir, "-config", resourceDir + "/wstools-config.xml" };
-      new WSTools().generate(args);
-
-      Element exp = DOMUtils.parse(new FileInputStream(resourceDir + "/myporttype-mapping.xml"));
-      Element was = DOMUtils.parse(new FileInputStream(toolsDir + "/myporttype-mapping.xml"));
-      assertEquals(exp, was);      
-      
-      File expSEI = new File(resourceDir + "/My.java");
-      File wasSEI = new File(toolsDir + "/org/jboss/test/ws/jbws1253/My.java");
-
-      JBossSourceComparator sc = new JBossSourceComparator(expSEI, wasSEI);
-      sc.validate();
-      sc.validateImports();
-
-      File expService = new File(resourceDir + "/TestSEIService.java");
-      File wasService = new File(toolsDir + "/org/jboss/test/ws/jbws1253/TestSEIService.java");
-
-      sc = new JBossSourceComparator(expService, wasService);
-      sc.validate();
-      sc.validateImports();
-   }
-}

Copied: trunk/src/test/java/org/jboss/test/ws/tools/jbws1253/JBWS1253TestCase.java (from rev 1126, branches/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws1253/JBWS1253TestCase.java)

Copied: trunk/src/test/resources/tools/jbws1253 (from rev 1126, branches/jbossws-1.0/src/test/resources/tools/jbws1253)

Deleted: trunk/src/test/resources/tools/jbws1253/My.java
===================================================================
--- branches/jbossws-1.0/src/test/resources/tools/jbws1253/My.java	2006-10-04 10:50:27 UTC (rev 1126)
+++ trunk/src/test/resources/tools/jbws1253/My.java	2006-10-04 12:13:45 UTC (rev 1128)
@@ -1,15 +0,0 @@
-/*
- * JBossWS WS-Tools Generated Source
- *
- * Generation Date: Wed Sep 27 14:34:41 CEST 2006
- *
- * 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.jbws1253;
-public interface  My extends java.rmi.Remote
-{
-
-  public org.jboss.test.ws.jbws1253.ReturnVoidParamIntResponse  returnVoidParamInt(org.jboss.test.ws.jbws1253.ReturnVoidParamInt returnVoidParamInt) throws  java.rmi.RemoteException;
-}

Copied: trunk/src/test/resources/tools/jbws1253/My.java (from rev 1126, branches/jbossws-1.0/src/test/resources/tools/jbws1253/My.java)

Deleted: trunk/src/test/resources/tools/jbws1253/MyPortTypeService.wsdl
===================================================================
--- branches/jbossws-1.0/src/test/resources/tools/jbws1253/MyPortTypeService.wsdl	2006-10-04 10:50:27 UTC (rev 1126)
+++ trunk/src/test/resources/tools/jbws1253/MyPortTypeService.wsdl	2006-10-04 12:13:45 UTC (rev 1128)
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<definitions name='TestSEIService' targetNamespace='http://test.jboss.org/ws/jbws1253' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:ns1='http://test.jboss.org/ws/jbws1253/types' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://test.jboss.org/ws/jbws1253' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
- <types>
-  <schema targetNamespace='http://test.jboss.org/ws/jbws1253/types' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://test.jboss.org/ws/jbws1253/types' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
-   <complexType name='returnVoidParamInt'>
-    <sequence>
-     <element name='int_1' type='int'/>
-    </sequence>
-   </complexType>
-   <complexType name='returnVoidParamIntResponse'>
-    <sequence>
-     <element name='result' type='int'/>
-    </sequence>
-   </complexType>
-   <element name='returnVoidParamInt' type='tns:returnVoidParamInt'/>
-   <element name='returnVoidParamIntResponse' type='tns:returnVoidParamIntResponse'/>
-  </schema>
- </types>
- <message name='MyPortType_returnVoidParamInt'>
-  <part element='ns1:returnVoidParamInt' name='parameters'/>
- </message>
- <message name='MyPortType_returnVoidParamIntResponse'>
-  <part element='ns1:returnVoidParamIntResponse' name='result'/>
- </message>
- <portType name='MyPortType'>
-  <operation name='returnVoidParamInt'>
-   <input message='tns:MyPortType_returnVoidParamInt'/>
-   <output message='tns:MyPortType_returnVoidParamIntResponse'/>
-  </operation>
- </portType>
- <binding name='MyPortTypeBinding' type='tns:MyPortType'>
-  <soap:binding style='document' transport='http://schemas.xmlsoap.org/soap/http'/>
-  <operation name='returnVoidParamInt'>
-   <soap:operation soapAction=''/>
-   <input>
-    <soap:body use='literal'/>
-   </input>
-   <output>
-    <soap:body use='literal'/>
-   </output>
-  </operation>
- </binding>
- <service name='TestSEIService'>
-  <port binding='tns:MyPortTypeBinding' name='MyPortTypePort'>
-   <soap:address location='REPLACE_WITH_ACTUAL_URL'/>
-  </port>
- </service>
-</definitions>
\ No newline at end of file

Copied: trunk/src/test/resources/tools/jbws1253/MyPortTypeService.wsdl (from rev 1126, branches/jbossws-1.0/src/test/resources/tools/jbws1253/MyPortTypeService.wsdl)

Deleted: trunk/src/test/resources/tools/jbws1253/TestSEIService.java
===================================================================
--- branches/jbossws-1.0/src/test/resources/tools/jbws1253/TestSEIService.java	2006-10-04 10:50:27 UTC (rev 1126)
+++ trunk/src/test/resources/tools/jbws1253/TestSEIService.java	2006-10-04 12:13:45 UTC (rev 1128)
@@ -1,19 +0,0 @@
-/*  
-* JBoss, the OpenSource EJB server
-* Distributable under LGPL license. See terms of license at gnu.org.
-*/
-
-//Auto Generated by jbossws - Please do not edit!!!
-
-package org.jboss.test.ws.jbws1253;
-
-
-import javax.xml.rpc.*; 
-
-
-public interface  TestSEIService extends  javax.xml.rpc.Service
-{
-
-     public org.jboss.test.ws.jbws1253.My getMyPortTypePort() throws ServiceException;
-
-}

Copied: trunk/src/test/resources/tools/jbws1253/TestSEIService.java (from rev 1126, branches/jbossws-1.0/src/test/resources/tools/jbws1253/TestSEIService.java)

Deleted: trunk/src/test/resources/tools/jbws1253/myporttype-mapping.xml
===================================================================
--- branches/jbossws-1.0/src/test/resources/tools/jbws1253/myporttype-mapping.xml	2006-10-04 10:50:27 UTC (rev 1126)
+++ trunk/src/test/resources/tools/jbws1253/myporttype-mapping.xml	2006-10-04 12:13:45 UTC (rev 1128)
@@ -1,55 +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>
-  <package-type>org.jboss.test.ws.jbws1253</package-type>
-  <namespaceURI>http://test.jboss.org/ws/jbws1253</namespaceURI>
- </package-mapping>
- <java-xml-type-mapping>
-  <java-type>org.jboss.test.ws.jbws1253.ReturnVoidParamInt</java-type>
-  <root-type-qname xmlns:typeNS='http://test.jboss.org/ws/jbws1253/types'>typeNS:returnVoidParamInt</root-type-qname>
-  <qname-scope>complexType</qname-scope>
-  <variable-mapping>
-   <java-variable-name>int_1</java-variable-name>
-   <xml-element-name>int_1</xml-element-name>
-  </variable-mapping>
- </java-xml-type-mapping>
- <java-xml-type-mapping>
-  <java-type>org.jboss.test.ws.jbws1253.ReturnVoidParamIntResponse</java-type>
-  <root-type-qname xmlns:typeNS='http://test.jboss.org/ws/jbws1253/types'>typeNS:returnVoidParamIntResponse</root-type-qname>
-  <qname-scope>complexType</qname-scope>
-  <variable-mapping>
-   <java-variable-name>result</java-variable-name>
-   <xml-element-name>result</xml-element-name>
-  </variable-mapping>
- </java-xml-type-mapping>
- <service-interface-mapping>
-  <service-interface>org.jboss.test.ws.jbws1253.TestSEIService</service-interface>
-  <wsdl-service-name xmlns:serviceNS='http://test.jboss.org/ws/jbws1253'>serviceNS:TestSEIService</wsdl-service-name>
-  <port-mapping>
-   <port-name>MyPortTypePort</port-name>
-   <java-port-name>MyPortTypePort</java-port-name>
-  </port-mapping>
- </service-interface-mapping>
- <service-endpoint-interface-mapping>
-  <service-endpoint-interface>org.jboss.test.ws.jbws1253.My</service-endpoint-interface>
-  <wsdl-port-type xmlns:portTypeNS='http://test.jboss.org/ws/jbws1253'>portTypeNS:MyPortType</wsdl-port-type>
-  <wsdl-binding xmlns:bindingNS='http://test.jboss.org/ws/jbws1253'>bindingNS:MyPortTypeBinding</wsdl-binding>
-  <service-endpoint-method-mapping>
-   <java-method-name>returnVoidParamInt</java-method-name>
-   <wsdl-operation>returnVoidParamInt</wsdl-operation>
-   <method-param-parts-mapping>
-    <param-position>0</param-position>
-    <param-type>org.jboss.test.ws.jbws1253.ReturnVoidParamInt</param-type>
-    <wsdl-message-mapping>
-     <wsdl-message xmlns:wsdlMsgNS='http://test.jboss.org/ws/jbws1253'>wsdlMsgNS:MyPortType_returnVoidParamInt</wsdl-message>
-     <wsdl-message-part-name>parameters</wsdl-message-part-name>
-     <parameter-mode>IN</parameter-mode>
-    </wsdl-message-mapping>
-   </method-param-parts-mapping>
-   <wsdl-return-value-mapping>
-    <method-return-value>org.jboss.test.ws.jbws1253.ReturnVoidParamIntResponse</method-return-value>
-    <wsdl-message xmlns:wsdlMsgNS='http://test.jboss.org/ws/jbws1253'>wsdlMsgNS:MyPortType_returnVoidParamIntResponse</wsdl-message>
-    <wsdl-message-part-name>result</wsdl-message-part-name>
-   </wsdl-return-value-mapping>
-  </service-endpoint-method-mapping>
- </service-endpoint-interface-mapping>
-</java-wsdl-mapping>
\ No newline at end of file

Copied: trunk/src/test/resources/tools/jbws1253/myporttype-mapping.xml (from rev 1126, branches/jbossws-1.0/src/test/resources/tools/jbws1253/myporttype-mapping.xml)

Deleted: trunk/src/test/resources/tools/jbws1253/wstools-config.xml
===================================================================
--- branches/jbossws-1.0/src/test/resources/tools/jbws1253/wstools-config.xml	2006-10-04 10:50:27 UTC (rev 1126)
+++ trunk/src/test/resources/tools/jbws1253/wstools-config.xml	2006-10-04 12:13:45 UTC (rev 1128)
@@ -1,5 +0,0 @@
-<configuration>
-  <wsdl-java file="resources/tools/jbws1253/MyPortTypeService.wsdl">
-    <mapping file="myporttype-mapping.xml"/>
-  </wsdl-java>
-</configuration>

Copied: trunk/src/test/resources/tools/jbws1253/wstools-config.xml (from rev 1126, branches/jbossws-1.0/src/test/resources/tools/jbws1253/wstools-config.xml)




More information about the jboss-svn-commits mailing list