JBossWS SVN: r1196 - in branches/jbossws-1.0/src/test: java/org/jboss/test/ws/tools/jbws_211/tests java/org/jboss/test/ws/tools/jbws_211/tests/Attachment java/org/jboss/test/ws/tools/jbws_211/tests/CustomArrays java/org/jboss/test/ws/tools/jbws_211/tests/CustomHolders java/org/jboss/test/ws/tools/jbws_211/tests/Inheritance java/org/jboss/test/ws/tools/jbws_211/tests/OneWay java/org/jboss/test/ws/tools/jbws_211/tests/PublicPrivate java/org/jboss/test/ws/tools/jbws_211/tests/StandardArrays j
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2006-10-11 02:26:48 -0400 (Wed, 11 Oct 2006)
New Revision: 1196
Added:
branches/jbossws-1.0/src/test/resources/tools/jbws-211/jbosswsConfig/CustomHolders/
Removed:
branches/jbossws-1.0/src/test/resources/tools/jbws-211/jbosswsConfig/CustomHolder/
Modified:
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_211/tests/Attachment/AttachmentJava2WSDLTestCase.java
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_211/tests/CustomArrays/CustomArrayJava2WSDLTestCase.java
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_211/tests/CustomHolders/CustomHolderJava2WSDLTestCase.java
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_211/tests/Inheritance/InheritanceJava2WSDLTestCase.java
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_211/tests/JBWS211Test.java
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_211/tests/OneWay/OneWayJava2WSDLTestCase.java
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_211/tests/PublicPrivate/PublicPrivateJava2WSDLTestCase.java
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_211/tests/StandardArrays/StandardArraysJava2WSDLTestCase.java
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_211/tests/StandardHolders/StandardHoldersJava2WSDLTestCase.java
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_211/tests/UserException/UserExceptionJava2WSDLTestCase.java
branches/jbossws-1.0/src/test/resources/tools/jbws-211/jbosswsConfig/CustomHolders/CustomHoldersConfig.xml
Log:
Fix tools custom holders test case
Modified: branches/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_211/tests/Attachment/AttachmentJava2WSDLTestCase.java
===================================================================
--- branches/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_211/tests/Attachment/AttachmentJava2WSDLTestCase.java 2006-10-10 19:55:31 UTC (rev 1195)
+++ branches/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_211/tests/Attachment/AttachmentJava2WSDLTestCase.java 2006-10-11 06:26:48 UTC (rev 1196)
@@ -40,7 +40,7 @@
public String getFixMe()
{
- return "FIXME:JBWS-269";
+ return "FIXME: JBWS-269";
}
public String getWSDLName()
Modified: branches/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_211/tests/CustomArrays/CustomArrayJava2WSDLTestCase.java
===================================================================
--- branches/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_211/tests/CustomArrays/CustomArrayJava2WSDLTestCase.java 2006-10-10 19:55:31 UTC (rev 1195)
+++ branches/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_211/tests/CustomArrays/CustomArrayJava2WSDLTestCase.java 2006-10-11 06:26:48 UTC (rev 1196)
@@ -37,11 +37,6 @@
return base;
}
- public String getFixMe()
- {
- return null;
- }
-
public String getWSDLName()
{
return base + "Service.wsdl";
Modified: branches/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_211/tests/CustomHolders/CustomHolderJava2WSDLTestCase.java
===================================================================
--- branches/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_211/tests/CustomHolders/CustomHolderJava2WSDLTestCase.java 2006-10-10 19:55:31 UTC (rev 1195)
+++ branches/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_211/tests/CustomHolders/CustomHolderJava2WSDLTestCase.java 2006-10-11 06:26:48 UTC (rev 1196)
@@ -39,11 +39,6 @@
return base;
}
- public String getFixMe()
- {
- return "FIXME:JBWS-103";
- }
-
public String getWSDLName()
{
return base + "Service.wsdl";
Modified: branches/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_211/tests/Inheritance/InheritanceJava2WSDLTestCase.java
===================================================================
--- branches/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_211/tests/Inheritance/InheritanceJava2WSDLTestCase.java 2006-10-10 19:55:31 UTC (rev 1195)
+++ branches/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_211/tests/Inheritance/InheritanceJava2WSDLTestCase.java 2006-10-11 06:26:48 UTC (rev 1196)
@@ -38,11 +38,6 @@
return base;
}
- public String getFixMe()
- {
- return null;
- }
-
public String getWSDLName()
{
return base + "Service.wsdl";
Modified: branches/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_211/tests/JBWS211Test.java
===================================================================
--- branches/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_211/tests/JBWS211Test.java 2006-10-10 19:55:31 UTC (rev 1195)
+++ branches/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_211/tests/JBWS211Test.java 2006-10-11 06:26:48 UTC (rev 1196)
@@ -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.tools.jbws_211.tests;
import org.jboss.test.ws.tools.WSToolsTest;
@@ -31,36 +31,39 @@
* @since Sep 24, 2005
*/
public abstract class JBWS211Test extends WSToolsTest
-{
+{
public abstract String getBase();
+
public abstract String getWSDLName();
- public abstract String getFixMe();
-
+
//Set up the test
protected void setUp()
- {
+ {
String out_dir = "tools/jbws-211/jbossws/" + getBase();
- // createDir(out_dir + "/server");
- createDir(out_dir );
+ createDir(out_dir);
createDir(out_dir + "/wsdl");
- }
-
+ }
+
public final void testJava2WSDL() throws Exception
- {
- if(getFixMe() != null)
+ {
+ if (getFixMe() != null)
{
System.out.println(getFixMe());
return;
}
String out_dir = "tools/jbws-211/jbossws/" + getBase();
String wsdlFix = "resources/tools/jbws-211/wsdlFixture/" + getBase() + "/" + getWSDLName();
- String configStr = getBase().replaceAll("/","");
- String configloc = "resources/tools/jbws-211/jbosswsConfig/"+ getBase() + "/" + configStr + "Config.xml";
+ String configStr = getBase().replaceAll("/", "");
+ String configloc = "resources/tools/jbws-211/jbosswsConfig/" + getBase() + "/" + configStr + "Config.xml";
- String[] args= new String[]{"-dest",out_dir,"-config",configloc};
+ String[] args = new String[] { "-dest", out_dir, "-config", configloc };
WSTools tools = new WSTools();
- tools.generate(args);
- //semanticallyValidateWSDL(wsdlFix, out_dir+"/server/" + getWSDLName());
- semanticallyValidateWSDL(wsdlFix, out_dir + "/wsdl/" + getWSDLName());
+ tools.generate(args);
+ semanticallyValidateWSDL(wsdlFix, out_dir + "/wsdl/" + getWSDLName());
}
+
+ protected String getFixMe()
+ {
+ return null;
+ }
}
Modified: branches/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_211/tests/OneWay/OneWayJava2WSDLTestCase.java
===================================================================
--- branches/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_211/tests/OneWay/OneWayJava2WSDLTestCase.java 2006-10-10 19:55:31 UTC (rev 1195)
+++ branches/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_211/tests/OneWay/OneWayJava2WSDLTestCase.java 2006-10-11 06:26:48 UTC (rev 1196)
@@ -40,7 +40,7 @@
public String getFixMe()
{
- return "FIXME:JBWS-271";
+ return "FIXME: JBWS-271";
}
public String getWSDLName()
Modified: branches/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_211/tests/PublicPrivate/PublicPrivateJava2WSDLTestCase.java
===================================================================
--- branches/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_211/tests/PublicPrivate/PublicPrivateJava2WSDLTestCase.java 2006-10-10 19:55:31 UTC (rev 1195)
+++ branches/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_211/tests/PublicPrivate/PublicPrivateJava2WSDLTestCase.java 2006-10-11 06:26:48 UTC (rev 1196)
@@ -39,11 +39,6 @@
return base;
}
- public String getFixMe()
- {
- return null;
- }
-
public String getWSDLName()
{
return base + "Service.wsdl";
Modified: branches/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_211/tests/StandardArrays/StandardArraysJava2WSDLTestCase.java
===================================================================
--- branches/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_211/tests/StandardArrays/StandardArraysJava2WSDLTestCase.java 2006-10-10 19:55:31 UTC (rev 1195)
+++ branches/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_211/tests/StandardArrays/StandardArraysJava2WSDLTestCase.java 2006-10-11 06:26:48 UTC (rev 1196)
@@ -38,11 +38,6 @@
return base;
}
- public String getFixMe()
- {
- return null;
- }
-
public String getWSDLName()
{
return base + "Service.wsdl";
Modified: branches/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_211/tests/StandardHolders/StandardHoldersJava2WSDLTestCase.java
===================================================================
--- branches/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_211/tests/StandardHolders/StandardHoldersJava2WSDLTestCase.java 2006-10-10 19:55:31 UTC (rev 1195)
+++ branches/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_211/tests/StandardHolders/StandardHoldersJava2WSDLTestCase.java 2006-10-11 06:26:48 UTC (rev 1196)
@@ -38,11 +38,6 @@
return base;
}
- public String getFixMe()
- {
- return null;
- }
-
public String getWSDLName()
{
return base + "Service.wsdl";
Modified: branches/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_211/tests/UserException/UserExceptionJava2WSDLTestCase.java
===================================================================
--- branches/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_211/tests/UserException/UserExceptionJava2WSDLTestCase.java 2006-10-10 19:55:31 UTC (rev 1195)
+++ branches/jbossws-1.0/src/test/java/org/jboss/test/ws/tools/jbws_211/tests/UserException/UserExceptionJava2WSDLTestCase.java 2006-10-11 06:26:48 UTC (rev 1196)
@@ -38,11 +38,6 @@
return base;
}
- public String getFixMe()
- {
- return null;
- }
-
public String getWSDLName()
{
return base + "Service.wsdl";
Copied: branches/jbossws-1.0/src/test/resources/tools/jbws-211/jbosswsConfig/CustomHolders (from rev 1193, branches/jbossws-1.0/src/test/resources/tools/jbws-211/jbosswsConfig/CustomHolder)
Modified: branches/jbossws-1.0/src/test/resources/tools/jbws-211/jbosswsConfig/CustomHolders/CustomHoldersConfig.xml
===================================================================
--- branches/jbossws-1.0/src/test/resources/tools/jbws-211/jbosswsConfig/CustomHolder/CustomHoldersConfig.xml 2006-10-10 16:20:55 UTC (rev 1193)
+++ branches/jbossws-1.0/src/test/resources/tools/jbws-211/jbosswsConfig/CustomHolders/CustomHoldersConfig.xml 2006-10-11 06:26:48 UTC (rev 1196)
@@ -1,12 +1,7 @@
-<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="CustomHoldersService"
- endpoint="org.jboss.test.ws.tools.jbws_211.sei.CustomHolders.CustomHoldersSEI"
- style="rpc"
- />
- <namespaces target-namespace="http://org.jboss.ws"
- type-namespace="http://org.jboss.ws/types"/>
- </java-wsdl>
+<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="CustomHoldersService" endpoint="org.jboss.test.ws.tools.jbws_211.sei.CustomHolders.CustomHoldersSEI" style="rpc"/>
+ <namespaces target-namespace="http://org.jboss.ws" type-namespace="http://org.jboss.ws/types"/>
+ </java-wsdl>
</configuration>
18 years, 5 months
JBossWS SVN: r1195 - in branches/jbossws-1.0: . src/main/java/org/jboss/ws/metadata/jsr109 src/main/java/org/jboss/ws/tools src/main/java/org/jboss/ws/tools/config src/main/java/org/jboss/ws/tools/helpers src/main/resources src/main/resources/schema src/test src/test/java/org/jboss/test/ws/jaxrpc/jbws718 src/test/resources/jaxrpc/jbws718 src/test/resources/jaxrpc/jbws718/WEB-INF src/test/resources/jaxrpc/jbws807
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2006-10-10 15:55:31 -0400 (Tue, 10 Oct 2006)
New Revision: 1195
Removed:
branches/jbossws-1.0/src/main/resources/org/
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws718/PingMsg.java
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws718/PingMsgResponse.java
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws718/TestService_PortType.java
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws718/TestService_Service.java
branches/jbossws-1.0/src/test/resources/jaxrpc/jbws718/WEB-INF/jaxrpc-mapping.xml
branches/jbossws-1.0/src/test/resources/jaxrpc/jbws718/WEB-INF/webservices.xml
branches/jbossws-1.0/src/test/resources/jaxrpc/jbws718/org/
branches/jbossws-1.0/src/test/resources/jaxrpc/jbws807/org/
Modified:
branches/jbossws-1.0/.classpath
branches/jbossws-1.0/build.xml
branches/jbossws-1.0/src/main/java/org/jboss/ws/metadata/jsr109/WebservicesMetaData.java
branches/jbossws-1.0/src/main/java/org/jboss/ws/tools/Configuration.java
branches/jbossws-1.0/src/main/java/org/jboss/ws/tools/WSDLToJava.java
branches/jbossws-1.0/src/main/java/org/jboss/ws/tools/WSDotXMLCreator.java
branches/jbossws-1.0/src/main/java/org/jboss/ws/tools/config/ToolsSchemaConfigReader.java
branches/jbossws-1.0/src/main/java/org/jboss/ws/tools/helpers/ToolsHelper.java
branches/jbossws-1.0/src/main/resources/schema/jbossws-tool_1_0.xsd
branches/jbossws-1.0/src/test/build.xml
branches/jbossws-1.0/src/test/resources/jaxrpc/jbws718/wstools-config.xml
branches/jbossws-1.0/src/test/resources/jaxrpc/jbws807/wstools-config.xml
branches/jbossws-1.0/version.properties
Log:
[JBWS-779] Add webservices.xml support to wsdlTojava
Modified: branches/jbossws-1.0/.classpath
===================================================================
--- branches/jbossws-1.0/.classpath 2006-10-10 17:12:11 UTC (rev 1194)
+++ branches/jbossws-1.0/.classpath 2006-10-10 19:55:31 UTC (rev 1195)
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="src" path="output/tests/wstools/java"/>
<classpathentry excluding="org/jboss/test/ws/interop/" kind="src" path="src/test/java"/>
<classpathentry kind="lib" path="thirdparty/activation.jar"/>
<classpathentry kind="lib" path="thirdparty/mailapi.jar"/>
Modified: branches/jbossws-1.0/build.xml
===================================================================
--- branches/jbossws-1.0/build.xml 2006-10-10 17:12:11 UTC (rev 1194)
+++ branches/jbossws-1.0/build.xml 2006-10-10 19:55:31 UTC (rev 1195)
@@ -511,11 +511,8 @@
<!-- Deploy to jboss -->
<target name="deploy-to-server">
-
- <echo>Replacing jbossxb under ${jboss.deploy.home}/client and /lib</echo>
<copy todir="${jboss.deploy.home}/client" file="${thirdparty.dir}/jboss-xml-binding.jar" overwrite="true"/>
<copy todir="${jboss.deploy.home}/lib" file="${thirdparty.dir}/jboss-xml-binding.jar" overwrite="true"/>
-
<copy todir="${jboss.deploy.home}/client" file="${build.lib.dir}/${jbossws}-client.jar" overwrite="true"/>
<delete dir="${jboss.deploy.home}/server/${jboss.server.instance}/deploy/${jbossws}.sar"/>
<mkdir dir="${jboss.deploy.home}/server/${jboss.server.instance}/deploy/${jbossws}.sar"/>
@@ -524,6 +521,7 @@
<!-- Deploy to jboss/thirdparty -->
<target name="deploy-to-thirdparty" if="jboss.source.dist.available">
+ <copy todir="${jboss.deploy.home}/../../../thirdparty/jboss/jbossxb/lib" file="${thirdparty.dir}/jboss-xml-binding.jar" overwrite="true"/>
<copy todir="${jboss.deploy.home}/../../../thirdparty/jboss/${jbossws}/lib" file="${build.lib.dir}/${jbossws}-client.jar" overwrite="true"/>
<copy todir="${jboss.deploy.home}/../../../thirdparty/jboss/${jbossws}/lib" file="${build.lib.dir}/${jbossws}.sar" overwrite="true"/>
</target>
Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/metadata/jsr109/WebservicesMetaData.java
===================================================================
--- branches/jbossws-1.0/src/main/java/org/jboss/ws/metadata/jsr109/WebservicesMetaData.java 2006-10-10 17:12:11 UTC (rev 1194)
+++ branches/jbossws-1.0/src/main/java/org/jboss/ws/metadata/jsr109/WebservicesMetaData.java 2006-10-10 19:55:31 UTC (rev 1195)
@@ -47,9 +47,10 @@
// The URL to the webservices.xml descriptor
private URL descriptorURL;
- /**
- * Construct webservices meta data, with a given resource class loader.
- */
+ public WebservicesMetaData()
+ {
+ }
+
public WebservicesMetaData(URL descriptorURL)
{
this.descriptorURL = descriptorURL;
Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/tools/Configuration.java
===================================================================
--- branches/jbossws-1.0/src/main/java/org/jboss/ws/tools/Configuration.java 2006-10-10 17:12:11 UTC (rev 1194)
+++ branches/jbossws-1.0/src/main/java/org/jboss/ws/tools/Configuration.java 2006-10-10 19:55:31 UTC (rev 1195)
@@ -35,9 +35,9 @@
*/
public class Configuration
{
- private JavaToWSDLConfig j2wc = null;
- private WSDLToJavaConfig w2jc = null;
- private GlobalConfig globalConfig = null;
+ private JavaToWSDLConfig j2wc;
+ private WSDLToJavaConfig w2jc;
+ private GlobalConfig globalConfig;
public Configuration()
{
@@ -87,56 +87,33 @@
*/
public class JavaToWSDLConfig
{
- /**
- * Is a jax-rpc mapping file needed?
- */
- public boolean mappingFileNeeded = false;
- /**
- * Name of the jax-rpc mapping file
- */
- public String mappingFileName = null;
- /**
- * Need webservices.xml file?
- */
- public boolean wsxmlFileNeeded = false;
- /**
- * Target Namespace
- */
- public String targetNamespace = null;
- /**
- * Type Namespace
- */
- public String typeNamespace = null;
- /**
- * Service Name
- */
- public String serviceName = null;
- /**
- * Endpoint Name
- */
- public String endpointName = null;
-
- /**
- * Style of WSDL. {"rpc","doc"}
- */
+ // Is a jaxrpc-mapping file needed?
+ public boolean mappingFileNeeded;
+ // Name of the jaxrpc-mapping file
+ public String mappingFileName;
+ // Need webservices.xml file?
+ public boolean wsxmlFileNeeded;
+ // Target Namespace
+ public String targetNamespace;
+ // Type Namespace
+ public String typeNamespace;
+ // Service Name
+ public String serviceName;
+ // Endpoint Name
+ public String endpointName;
+ // Style of WSDL. {"rpc","doc"}
public String wsdlStyle = "document";
-
+ // Parameter style {"wrapped", "bare"}
public String parameterStyle = "wrapped";
- /**
- * WSDL Version {"1.1","2.0"}
- */
+ // WSDL Version {"1.1","2.0"}
public String wsdlVersion = "1.1";
- /**
- * Should Schema be included in the wsdl
- */
+ // Should Schema be included in the wsdl
public boolean includeSchemaInWSDL = true;
- public boolean restrictSchemaToTargetNS = false;
+ public boolean restrictSchemaToTargetNS;
+ public String servletLink;
+ public String ejbLink;
+ public boolean wsxmlFileAppend;
- public String servletLink = null;
- public String ejbLink = null;
-
- public boolean wsxmlFileAppend = false;
-
public Map<String, List<OperationConfig>> operations = new HashMap<String, List<OperationConfig>>();
public OperationConfig createOperationConfig()
@@ -145,7 +122,7 @@
}
/**Configuration at the operation level*/
- /*public OperationConfig opConfig = null;
+ /*public OperationConfig opConfig;
public OperationConfig getOperationConfig(boolean createNew)
{
@@ -160,10 +137,16 @@
*/
public class WSDLToJavaConfig
{
- public String wsdlLocation = null;
- public boolean unwrap = false;
- public boolean mappingFileNeeded = false;
- public String mappingFileName = null;
+ public String wsdlLocation;
+ public boolean unwrap;
+ // Is a jaxrpc-mapping file needed?
+ public boolean mappingFileNeeded;
+ // Name of the jaxrpc-mapping file
+ public String mappingFileName;
+ // Need webservices.xml file?
+ public boolean wsxmlFileNeeded;
+ public String servletLink;
+ public String ejbLink;
}
/**
@@ -183,7 +166,7 @@
public String name;
public boolean isOneWay = false;
public List<ParameterConfig> params = new ArrayList<ParameterConfig>();
- public QName returnXmlName = null;
+ public QName returnXmlName;
public ParameterConfig createParameterConfig()
{
Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/tools/WSDLToJava.java
===================================================================
--- branches/jbossws-1.0/src/main/java/org/jboss/ws/tools/WSDLToJava.java 2006-10-10 17:12:11 UTC (rev 1194)
+++ branches/jbossws-1.0/src/main/java/org/jboss/ws/tools/WSDLToJava.java 2006-10-10 19:55:31 UTC (rev 1195)
@@ -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.ws.tools;
import java.io.File;
@@ -78,41 +78,25 @@
public class WSDLToJava implements WSDLToJavaIntf
{
private String newline = "\n";
-
- //protected LiteralTypeMapping typeMapping = new LiteralTypeMapping();
- protected LiteralTypeMapping typeMapping = null;
-
- protected WSDLDefinitions wsdl = null;
-
- /**
- * Singleton class that handle many utility functions
- */
+ protected LiteralTypeMapping typeMapping;
+ protected WSDLDefinitions wsdl;
protected WSDLUtils utils = WSDLUtils.getInstance();
-
- //protected XSDToJavaIntf xsdJava = new XSDToJava();
-
- //Feature Set
- protected boolean annotate = false;
-
- protected Map<String,String> namespacePackageMap = null;
-
- //private String wsdlStyle = Constants.RPC_LITERAL;
-
+ protected boolean annotate;
+ private Map<String, String> namespacePackageMap = new HashMap<String, String>();
private String seiPkgName = "";
-
private String directoryToGenerate = "";
-
private String style;
+ private boolean unwrap;
- private boolean unwrap = false;
-
public WSDLToJava()
{
}
- /* (non-Javadoc)
- * @see org.jboss.ws.tools.WSDLToJavaIntf#convertWSDL2Java(java.net.URL)
- */
+ public Map<String, String> getNamespacePackageMap()
+ {
+ return namespacePackageMap;
+ }
+
public WSDLDefinitions convertWSDL2Java(URL wsdlfileurl) throws WSDLException
{
checkTypeMapping();
@@ -122,47 +106,35 @@
return wsdl;
}
- /* (non-Javadoc)
- * @see org.jboss.ws.tools.WSDLToJavaIntf#getFeature(java.lang.String)
- */
- public boolean getFeature( String name)
+ public boolean getFeature(String name)
{
- if(name == null)
+ if (name == null)
throw new IllegalArgumentException("Illegal null argument:name");
- if(name.equalsIgnoreCase(WSToolsConstants.WSTOOLS_FEATURE_USE_ANNOTATIONS))
- return annotate ;
+ if (name.equalsIgnoreCase(WSToolsConstants.WSTOOLS_FEATURE_USE_ANNOTATIONS))
+ return annotate;
- throw new WSException("Feature:"+ name + " not recognized");
+ throw new WSException("Feature:" + name + " not recognized");
}
- /* (non-Javadoc)
- * @see org.jboss.ws.tools.WSDLToJavaIntf#setFeature(java.lang.String, boolean)
- */
- public void setFeature( String name, boolean value)
+ public void setFeature(String name, boolean value)
{
- if(name == null)
+ if (name == null)
throw new IllegalArgumentException("Illegal null argument:name");
- if(name.equalsIgnoreCase(WSToolsConstants.WSTOOLS_FEATURE_USE_ANNOTATIONS))
- annotate = value;
+ if (name.equalsIgnoreCase(WSToolsConstants.WSTOOLS_FEATURE_USE_ANNOTATIONS))
+ annotate = value;
}
- /* (non-Javadoc)
- * @see org.jboss.ws.tools.WSDLToJavaIntf#generateSEI(java.net.URL, java.io.File, boolean)
- */
- public void generateSEI( URL wsdlFile, File dir, boolean annotate) throws IOException
+ public void generateSEI(URL wsdlFile, File dir, boolean annotate) throws IOException
{
checkTypeMapping();
- WSDLDefinitions wsdl = convertWSDL2Java( wsdlFile);
+ WSDLDefinitions wsdl = convertWSDL2Java(wsdlFile);
this.annotate = annotate;
this.directoryToGenerate = dir.getAbsolutePath();
- generateSEI( wsdl, dir);
+ generateSEI(wsdl, dir);
}
- /* (non-Javadoc)
- * @see org.jboss.ws.tools.WSDLToJavaIntf#generateSEI(org.jboss.ws.metadata.wsdl.WSDLDefinitions, java.io.File)
- */
public void generateSEI(WSDLDefinitions wsdl, File dir) throws IOException
{
checkTypeMapping();
@@ -170,39 +142,35 @@
this.wsdl = wsdl;
style = utils.getWSDLStyle(wsdl);
-
//TODO: Handle annotations flag, as per JAX-WS 2.0 Spec.
//Given the WSDL Object Tree, generate the SEI
//Also take in the location where the SEI should be written
- // String typeNS = wsdl.getNamespaceURI(WSDLConstants.PREFIX_TNS);
+ // String typeNS = wsdl.getNamespaceURI(WSDLConstants.PREFIX_TNS);
String targetNS = wsdl.getTargetNamespace();
//Check if there is an user override
- String packageName = namespacePackageMap != null?namespacePackageMap.get(targetNS):null;
- if(packageName == null || packageName.length() == 0)
+ String packageName = namespacePackageMap.get(targetNS);
+ if (packageName == null || packageName.length() == 0)
+ {
packageName = NamespacePackageMapping.getJavaPackageName(targetNS);
+ namespacePackageMap.put(targetNS, packageName);
+ }
this.seiPkgName = packageName;
File dirloc = utils.createPackage(dir.getAbsolutePath(), packageName);
createSEI(dirloc, wsdl);
- //xsdJava.generateJavaSource(wsdl.getTypes().getSchemaModel(), dir, packageName, true);
}
-
- /* (non-Javadoc)
- * @see org.jboss.ws.tools.WSDLToJavaIntf#setPackageNamespaceMap(java.util.Map)
- */
public void setPackageNamespaceMap(Map<String, String> map)
{
- //Lets convert the package->namespace map to namespace->package map
- Set<String> keys = map.keySet();
- Iterator<String> iter = keys.iterator();
- while(iter != null && iter.hasNext())
- {
- if(namespacePackageMap == null) namespacePackageMap = new HashMap<String,String>();
- String pkg = iter.next();
- namespacePackageMap.put(map.get(pkg),pkg);
- }
+ //Lets convert the package->namespace map to namespace->package map
+ Set<String> keys = map.keySet();
+ Iterator<String> iter = keys.iterator();
+ while (iter != null && iter.hasNext())
+ {
+ String pkg = iter.next();
+ namespacePackageMap.put(map.get(pkg), pkg);
+ }
}
public void setTypeMapping(LiteralTypeMapping tm)
@@ -224,7 +192,7 @@
public boolean unwrap()
{
- if (! Constants.DOCUMENT_LITERAL.equals(style))
+ if (!Constants.DOCUMENT_LITERAL.equals(style))
{
XSElementDeclaration unwrapped = SchemaUtils.unwrapArrayType(xt);
StringBuilder builder = new StringBuilder();
@@ -247,7 +215,6 @@
}
}
-
//***************************************************************************
// PRIVATE METHODS
//***************************************************************************
@@ -282,7 +249,7 @@
XSObjectList particles = group.getParticles();
for (int i = 0; i < particles.getLength(); i++)
{
- XSParticle particle = (XSParticle) particles.item(i);
+ XSParticle particle = (XSParticle)particles.item(i);
XSTerm term = particle.getTerm();
if (term instanceof XSModelGroup)
{
@@ -330,7 +297,7 @@
String returnType = null;
for (int i = 0; i < particles.getLength(); i++)
{
- XSParticle particle = (XSParticle) particles.item(i);
+ XSParticle particle = (XSParticle)particles.item(i);
XSTerm term = particle.getTerm();
if (term instanceof XSModelGroup)
{
@@ -354,7 +321,7 @@
return null;
}
- private void appendMethods(WSDLInterface intf, StringBuilder buf ) throws IOException
+ private void appendMethods(WSDLInterface intf, StringBuilder buf) throws IOException
{
buf.append(newline);
String itfname = intf.getName().toString();
@@ -370,18 +337,19 @@
WSDLInterfaceOperationOutput[] outs = op.getOutputs();
String returnType = getReturnType(outs);
buf.append(" public " + returnType + " ");
- buf.append(ToolsUtils.firstLetterLowerCase(op.getName().toString()) );
+ buf.append(ToolsUtils.firstLetterLowerCase(op.getName().toString()));
buf.append("(");
WSDLInterfaceOperationInput[] ins = op.getInputs();
- int inlen = ins != null? ins.length :0;
+ int inlen = ins != null ? ins.length : 0;
for (int j = 0; j < inlen; j++)
{
- if (j > 0) buf.append(",");
+ if (j > 0)
+ buf.append(",");
WSDLInterfaceOperationInput in = ins[j];
QName xmlName = in.getElement();
QName xmlType = in.getXMLType();
JBossXSModel xsmodel = WSDLUtils.getSchemaModel(wsdl.getWsdlTypes());
- XSTypeDefinition xt = xsmodel.getTypeDefinition(xmlType.getLocalPart(),xmlType.getNamespaceURI());
+ XSTypeDefinition xt = xsmodel.getTypeDefinition(xmlType.getLocalPart(), xmlType.getNamespaceURI());
if (shouldUnwrap())
{
@@ -409,12 +377,12 @@
XSTypeDefinition xt = xsmodel.getTypeDefinition(xmlType.getLocalPart(), xmlType.getNamespaceURI());
boolean primitive = true;
- WrappedArray wrappedArray = new WrappedArray(xt);
+ WrappedArray wrappedArray = new WrappedArray(xt);
if (wrappedArray.unwrap())
{
xt = wrappedArray.xt;
xmlType = wrappedArray.xmlType;
- primitive = !wrappedArray.nillable;
+ primitive = !wrappedArray.nillable;
}
if (xt instanceof XSSimpleTypeDefinition)
@@ -439,26 +407,25 @@
QName faultXMLName = intfFault.getXmlName();
QName faultXMLType = intfFault.getXmlType();
- XSElementDeclaration xe = xsmodel.getElementDeclaration(faultXMLName.getLocalPart(),faultXMLName.getNamespaceURI());
- XSTypeDefinition xt = xe.getTypeDefinition();
- if (! xt.getAnonymous())
+ XSElementDeclaration xe = xsmodel.getElementDeclaration(faultXMLName.getLocalPart(), faultXMLName.getNamespaceURI());
+ XSTypeDefinition xt = xe.getTypeDefinition();
+ if (!xt.getAnonymous())
xt = xsmodel.getTypeDefinition(xt.getName(), xt.getNamespace());
- if(xt instanceof XSComplexTypeDefinition)
- generateJavaSource((XSComplexTypeDefinition)xt,xsmodel, faultXMLName.getLocalPart(), true);
+ if (xt instanceof XSComplexTypeDefinition)
+ generateJavaSource((XSComplexTypeDefinition)xt, xsmodel, faultXMLName.getLocalPart(), true);
Class cl = getJavaType(faultXMLType, false);
if (cl == null)
{
String exceptionName = xt.getName();
- if (exceptionName==null)
+ if (exceptionName == null)
{
exceptionName = faultXMLName.getLocalPart();
}
buf.append(seiPkgName + "." + utils.firstLetterUpperCase(exceptionName));
}
- else
- buf.append( cl.getName());
- buf.append( "," );
+ else buf.append(cl.getName());
+ buf.append(",");
}
buf.append(" java.rmi.RemoteException");
buf.append(";");
@@ -466,7 +433,8 @@
}
}
- private void generateParameter(StringBuilder buf, WSDLInterfaceOperationInput in, QName xmlName, QName xmlType, JBossXSModel xsmodel, XSTypeDefinition xt, boolean array, boolean primitive) throws IOException
+ private void generateParameter(StringBuilder buf, WSDLInterfaceOperationInput in, QName xmlName, QName xmlType, JBossXSModel xsmodel, XSTypeDefinition xt,
+ boolean array, boolean primitive) throws IOException
{
WrappedArray wrappedArray = new WrappedArray(xt);
String arraySuffix = (array) ? "[]" : "";
@@ -479,13 +447,13 @@
}
if (xt instanceof XSSimpleTypeDefinition)
- xmlType = SchemaUtils.handleSimpleType((XSSimpleTypeDefinition) xt);
+ xmlType = SchemaUtils.handleSimpleType((XSSimpleTypeDefinition)xt);
Class cl = getJavaType(xmlType, primitive);
//Class cl = typeMapping.getJavaType(inqname,true);
if (in != null)
- cl = this.checkNeedHolder(in,cl);
- if(cl != null)
+ cl = this.checkNeedHolder(in, cl);
+ if (cl != null)
{
buf.append(JavaUtils.getSourceName(cl) + arraySuffix);
}
@@ -498,33 +466,40 @@
className = utils.firstLetterUpperCase(className);
buf.append(seiPkgName + "." + className + arraySuffix);
- if(xt instanceof XSComplexTypeDefinition)
+ if (xt instanceof XSComplexTypeDefinition)
generateJavaSource((XSComplexTypeDefinition)xt, xsmodel, xmlName.getLocalPart());
}
}
private void createSEIFile(WSDLInterface intf, File loc) throws IOException
{
- String fname = utils.chopPortType(intf.getName().toString());
- //Check if the portType name conflicts with a service name
- if(wsdl.getService(new NCName(fname)) != null )
- fname += "_PortType";
+ String seiName = getServiceEndpointInterfaceName(intf);
StringBuilder buf = new StringBuilder();
utils.writeJbossHeader(buf);
buf.append("package " + seiPkgName + ";" + newline);
- buf.append("public interface " + fname + " extends java.rmi.Remote" + newline + "{" + newline);
+ buf.append("public interface " + seiName + " extends java.rmi.Remote" + newline + "{" + newline);
appendMethods(intf, buf);
buf.append("}" + newline);
- File sei = utils.createPhysicalFile(loc, fname);
+ File sei = utils.createPhysicalFile(loc, seiName);
FileWriter writer = new FileWriter(sei);
writer.write(buf.toString());
writer.flush();
writer.close();
}
+ public String getServiceEndpointInterfaceName(WSDLInterface wsdlInterface)
+ {
+ String seiName = utils.chopPortType(wsdlInterface.getName().toString());
+ //Check if the portType name conflicts with a service name
+ if (wsdl.getService(new NCName(seiName)) != null)
+ seiName += "_PortType";
+
+ return seiName;
+ }
+
private void createSEI(File loc, WSDLDefinitions wsdl)
{
WSDLInterface[] intarr = wsdl.getInterfaces();
@@ -547,14 +522,15 @@
private String getReturnType(WSDLInterfaceOperationOutput[] outs) throws IOException
{
- if (outs == null || outs.length == 0) return "void ";
+ if (outs == null || outs.length == 0)
+ return "void ";
WSDLInterfaceOperationOutput out = outs[0];
QName xmlType = out.getXMLType();
QName xmlName = out.getElement();
JBossXSModel xsmodel = WSDLUtils.getSchemaModel(wsdl.getWsdlTypes());
- XSTypeDefinition xt = xsmodel.getTypeDefinition(xmlType.getLocalPart(),xmlType.getNamespaceURI());
+ XSTypeDefinition xt = xsmodel.getTypeDefinition(xmlType.getLocalPart(), xmlType.getNamespaceURI());
if (shouldUnwrap())
return unwrapResponse(xt);
@@ -571,15 +547,15 @@
}
if (xt instanceof XSSimpleTypeDefinition)
- xmlType = SchemaUtils.handleSimpleType((XSSimpleTypeDefinition) xt);
+ xmlType = SchemaUtils.handleSimpleType((XSSimpleTypeDefinition)xt);
Class cls = getJavaType(xmlType, primitive);
//Class cls = typeMapping.getJavaType(qname,true);
- if(xt instanceof XSComplexTypeDefinition)
+ if (xt instanceof XSComplexTypeDefinition)
generateJavaSource((XSComplexTypeDefinition)xt, xsmodel, xmlName.getLocalPart());
- if(cls == null)
+ if (cls == null)
{
String className = xmlType.getLocalPart();
if (className.charAt(0) == '>')
@@ -588,13 +564,13 @@
return seiPkgName + "." + className + arraySuffix;
}
- if(isInOutHolder(out))
+ if (isInOutHolder(out))
return "void"; //Taken care by the input args
- if(isOutHolder(out))
+ if (isOutHolder(out))
return utils.getHolder(cls).getName();
- if(cls.isArray())
+ if (cls.isArray())
return JavaUtils.getSourceName(cls);
- return cls.getName() + arraySuffix;
+ return cls.getName() + arraySuffix;
}
/**
@@ -605,28 +581,28 @@
*/
private Class checkNeedHolder(WSDLInterfaceOperationInput win, Class cls)
{
- //Now check if the part exists in both input and output => Need Holder
- WSDLInterfaceOperation op = win.getWsdlOperation();
- QName el = win.getElement();
+ //Now check if the part exists in both input and output => Need Holder
+ WSDLInterfaceOperation op = win.getWsdlOperation();
+ QName el = win.getElement();
- WSDLInterfaceOperationOutput out = op.getOutput(el);
+ WSDLInterfaceOperationOutput out = op.getOutput(el);
- if(out != null)
- cls = utils.getHolder(cls); //Need a holder
+ if (out != null)
+ cls = utils.getHolder(cls); //Need a holder
- return cls;
+ return cls;
}
private void checkTypeMapping()
{
- if(typeMapping == null)
+ if (typeMapping == null)
throw new WSException("TypeMapping has not been set.");
}
private boolean isInOutHolder(WSDLInterfaceOperationOutput wout)
{
//Now check if the part exists in both input and output => Need Holder
- WSDLInterfaceOperation op = wout.getWsdlOperation();
+ WSDLInterfaceOperation op = wout.getWsdlOperation();
QName el = wout.getElement();
WSDLInterfaceOperationInput inp = op.getInput(el);
@@ -635,11 +611,11 @@
private boolean isOutHolder(WSDLInterfaceOperationOutput wout)
{
- if(isInOutHolder(wout))
+ if (isInOutHolder(wout))
return false;
// Case when there are multiple outputs - need holders
WSDLInterfaceOperationOutput[] ops = wout.getWsdlOperation().getOutputs();
- if(ops != null && ops.length > 1)
+ if (ops != null && ops.length > 1)
return true;
return false;
}
@@ -651,8 +627,7 @@
* Special case - when qname=xsd:anyType && cls == Element
* then cls has to be javax.xml.soap.SOAPElement
*/
- if( qname.getNamespaceURI().equals(Constants.NS_SCHEMA_XSD)
- && "anyType".equals(qname.getLocalPart()) && cls == Element.class)
+ if (qname.getNamespaceURI().equals(Constants.NS_SCHEMA_XSD) && "anyType".equals(qname.getLocalPart()) && cls == Element.class)
cls = SOAPElement.class;
return cls;
}
@@ -664,7 +639,7 @@
private File getLocationForJavaGeneration()
{
- return new File( this.directoryToGenerate + "/" + seiPkgName.replace(".","/"));
+ return new File(this.directoryToGenerate + "/" + seiPkgName.replace(".", "/"));
}
private void generateJavaSource(XSComplexTypeDefinition xt, JBossXSModel xsmodel, String containingElement) throws IOException
Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/tools/WSDotXMLCreator.java
===================================================================
--- branches/jbossws-1.0/src/main/java/org/jboss/ws/tools/WSDotXMLCreator.java 2006-10-10 17:12:11 UTC (rev 1194)
+++ branches/jbossws-1.0/src/main/java/org/jboss/ws/tools/WSDotXMLCreator.java 2006-10-10 19:55:31 UTC (rev 1195)
@@ -185,7 +185,7 @@
private WebservicesMetaData constructWSMetaData()
{
- WebservicesMetaData wm = new WebservicesMetaData(null);
+ WebservicesMetaData wm = new WebservicesMetaData();
WebserviceDescriptionMetaData wsdm = new WebserviceDescriptionMetaData(wm);
populateWebserviceDescriptionMetaData(wsdm);
wm.addWebserviceDescription(wsdm);
Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/tools/config/ToolsSchemaConfigReader.java
===================================================================
--- branches/jbossws-1.0/src/main/java/org/jboss/ws/tools/config/ToolsSchemaConfigReader.java 2006-10-10 17:12:11 UTC (rev 1194)
+++ branches/jbossws-1.0/src/main/java/org/jboss/ws/tools/config/ToolsSchemaConfigReader.java 2006-10-10 19:55:31 UTC (rev 1195)
@@ -266,7 +266,14 @@
wsdl2jc.mappingFileNeeded = true;
wsdl2jc.mappingFileName = attrs.getValue(FILE_ATTRIBUTE);
}
-
+ else if (WEBSERVICES_TAG.equals(localName))
+ {
+ wsdl2jc.wsxmlFileNeeded = true;
+ wsdl2jc.servletLink = getOptionalAttribute(attrs, SERVLET_LINK_ATTRIBUTE, null);
+ wsdl2jc.ejbLink = getOptionalAttribute(attrs, EJB_LINK_ATTRIBUTE, null);
+ if (wsdl2jc.ejbLink == null && wsdl2jc.servletLink == null)
+ throw new WSException("Either servletLink or ejbLink should be specified");
+ }
return wsdl2jc;
}
Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/tools/helpers/ToolsHelper.java
===================================================================
--- branches/jbossws-1.0/src/main/java/org/jboss/ws/tools/helpers/ToolsHelper.java 2006-10-10 17:12:11 UTC (rev 1194)
+++ branches/jbossws-1.0/src/main/java/org/jboss/ws/tools/helpers/ToolsHelper.java 2006-10-10 19:55:31 UTC (rev 1195)
@@ -36,8 +36,6 @@
import javax.xml.namespace.QName;
import org.jboss.logging.Logger;
-import org.jboss.ws.utils.DOMUtils;
-import org.jboss.ws.utils.DOMWriter;
import org.jboss.ws.Constants;
import org.jboss.ws.WSException;
import org.jboss.ws.jaxrpc.LiteralTypeMapping;
@@ -51,7 +49,6 @@
import org.jboss.ws.metadata.jaxrpcmapping.JavaXmlTypeMapping;
import org.jboss.ws.metadata.wsdl.NCName;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLException;
import org.jboss.ws.metadata.wsdl.WSDLService;
import org.jboss.ws.tools.Configuration;
import org.jboss.ws.tools.JavaToWSDL;
@@ -66,6 +63,8 @@
import org.jboss.ws.tools.client.ServiceCreator;
import org.jboss.ws.tools.interfaces.WSDotXMLCreatorIntf;
import org.jboss.ws.tools.mapping.MappingFileGenerator;
+import org.jboss.ws.utils.DOMUtils;
+import org.jboss.ws.utils.DOMWriter;
import org.jboss.ws.utils.IOUtils;
import org.jboss.ws.utils.JavaUtils;
@@ -141,27 +140,6 @@
writer.close();
}
- // MappingFileGenerator mgf = new MappingFileGenerator(wsdl,jwsdl.getTypeMapping() );
- // mgf.setPackageName(endpointClass.getPackage().getName());
- // mgf.setServiceEndpointInterface(endpointClass);
- // mgf.setServiceName(j2wc.serviceName);
- // mgf.setTypeNamespace(j2wc.typeNamespace);
- // //mgf.generate();
- // JavaWsdlMapping jwm = mgf.generate();
- // fw = new FileWriter(outDir + "/" + j2wc.mappingFileName);
- // fw.write(DOMWriter.printNode(DOMUtils.parse(jwm.serialize()), true));
- // fw.close();
- //
- // //Generate the Request/Response structures also
- // if(j2wc.wsdlStyle.equals("document"))
- // {
- // String seiName = endpointClass.getName();
- // mgf.generateJavaSourceFileForRequestResponseStruct(new File(outDir),
- // jwm.getServiceEndpointInterfaceMapping(seiName),
- // WSDLUtils.getSchemaModel(wsdl.getWsdlTypes()),j2wc.typeNamespace );
- // }
- // }
-
//Generate the webservices.xml file
if (j2wc.wsxmlFileNeeded)
{
@@ -193,8 +171,7 @@
}
}
- private void createWrapperTypes(JavaToWSDLConfig j2wc, String outDir, UnifiedMetaData wsMetaData, JavaWsdlMapping mapping, Class endpointClass)
- throws IOException
+ private void createWrapperTypes(JavaToWSDLConfig j2wc, String outDir, UnifiedMetaData wsMetaData, JavaWsdlMapping mapping, Class endpointClass) throws IOException
{
Map<QName, JavaXmlTypeMapping> index = indexMappingTypes(mapping);
@@ -327,6 +304,7 @@
//Generate the Service File
this.generateServiceFile(getPackageName(wsdl, glc), wsdl, outDir);
+
//Generate the Mapping File
if (w2jc.mappingFileNeeded)
{
@@ -342,19 +320,56 @@
writer.write(DOMWriter.printNode(DOMUtils.parse(jwm.serialize()), true));
writer.close();
}
+
+ //Generate the webservices.xml file
+ if (w2jc.wsxmlFileNeeded)
+ {
+ String seiName = "mypackage.MyServiceEndpointInterface";
+ String serviceName = "MyServiceName";
+
+ if (wsdl.getServices().length == 1)
+ serviceName = wsdl.getServices()[0].getName().toString();
+
+ if (wsdl.getInterfaces().length == 1)
+ {
+ String seiPackage = wsdlToJava.getNamespacePackageMap().get(wsdl.getTargetNamespace());
+ seiName = seiPackage + "." + wsdlToJava.getServiceEndpointInterfaceName(wsdl.getInterfaces()[0]);
+ }
+
+ WSDotXMLCreatorIntf wscr = new WSDotXMLCreator();
+ wscr.setTargetNamespace(wsdl.getTargetNamespace());
+ wscr.setSeiName(seiName);
+ wscr.setServiceName(serviceName);
+ WSDLService wsdlService = wsdl.getService(new NCName(serviceName));
+ String portName = wsdlService.getEndpoints()[0].getName().toString();
+ wscr.setPortName(portName);
+
+ String wsdlShortName = wsdlURL.getPath();
+ wsdlShortName = wsdlShortName.substring(wsdlShortName.lastIndexOf("/"));
+
+ if (w2jc.servletLink != null)
+ {
+ wscr.setMappingFile("WEB-INF/" + w2jc.mappingFileName);
+ wscr.setWsdlFile("WEB-INF/wsdl" + wsdlShortName);
+ wscr.setServletLink(w2jc.servletLink);
+ }
+ else
+ {
+ wscr.setMappingFile("META-INF/" + w2jc.mappingFileName);
+ wscr.setWsdlFile("META-INF/wsdl" + wsdlShortName);
+ wscr.setEjbLink(w2jc.ejbLink);
+ }
+ wscr.generateWSXMLDescriptor(new File(outDir + "/webservices.xml"));
+ }
}
- catch (MalformedURLException e)
+ catch (RuntimeException rte)
{
- throw new WSException(e);
+ throw rte;
}
- catch (WSDLException e)
+ catch (Exception ex)
{
- throw new WSException(e);
+ throw new WSException(ex);
}
- catch (IOException e)
- {
- throw new WSException(e);
- }
}
//PRIVATE METHODS
Modified: branches/jbossws-1.0/src/main/resources/schema/jbossws-tool_1_0.xsd
===================================================================
--- branches/jbossws-1.0/src/main/resources/schema/jbossws-tool_1_0.xsd 2006-10-10 17:12:11 UTC (rev 1194)
+++ branches/jbossws-1.0/src/main/resources/schema/jbossws-tool_1_0.xsd 2006-10-10 19:55:31 UTC (rev 1195)
@@ -225,6 +225,11 @@
<xs:documentation>Specifies the JSR-109 mapping file to generate.</xs:documentation>
</xs:annotation>
</xs:element>
+ <xs:element name="webservices" type="ns1:wsxmlType" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation>Used to generate the JSR-109 webservices.xml file</xs:documentation>
+ </xs:annotation>
+ </xs:element>
</xs:sequence>
<xs:attribute name="file" type="xs:anyURI" use="required">
<xs:annotation>
Modified: branches/jbossws-1.0/src/test/build.xml
===================================================================
--- branches/jbossws-1.0/src/test/build.xml 2006-10-10 17:12:11 UTC (rev 1194)
+++ branches/jbossws-1.0/src/test/build.xml 2006-10-10 19:55:31 UTC (rev 1195)
@@ -206,6 +206,7 @@
<javac destdir="${build.test.dir}/classes" debug="${javac.debug}" verbose="${javac.verbose}" deprecation="${javac.deprecation}" failonerror="${javac.fail.onerror}">
<src path="${test.java.dir}"/>
<exclude name="org/jboss/test/ws/interop/**"/>
+ <exclude name="org/jboss/test/ws/jaxrpc/jbws718/**"/>
<classpath refid="javac.classpath"/>
</javac>
</target>
@@ -214,6 +215,8 @@
<mkdir dir="${build.test.dir}/classes"/>
<javac destdir="${build.test.dir}/classes" debug="${javac.debug}" verbose="${javac.verbose}" deprecation="${javac.deprecation}" failonerror="${javac.fail.onerror}">
<src path="${build.test.dir}/wstools/java"/>
+ <src path="${test.java.dir}"/>
+ <exclude name="org/jboss/test/ws/interop/**"/>
<classpath refid="javac.classpath"/>
</javac>
</target>
@@ -261,6 +264,7 @@
<classpath path="${build.test.dir}/classes"/>
</taskdef>
<mkdir dir="${build.test.dir}/wstools/java"/>
+ <wstools dest="${build.test.dir}/wstools/resources/jaxrpc/jbws718/WEB-INF" config="${test.resources.dir}/jaxrpc/jbws718/wstools-config.xml"/>
<!--wstools dest="${build.test.dir}/wstools/resources/jaxrpc/jbws958/WEB-INF" config="${test.resources.dir}/jaxrpc/jbws958/wstools-config.xml"/-->
<wstools dest="${build.test.dir}/wstools/resources/jaxrpc/samples/docstyle/bare/WEB-INF" config="${test.resources.dir}/jaxrpc/samples/docstyle/bare/wstools-config.xml"/>
<wstools dest="${build.test.dir}/wstools/resources/jaxrpc/samples/docstyle/wrapped/WEB-INF" config="${test.resources.dir}/jaxrpc/samples/docstyle/wrapped/wstools-config.xml"/>
@@ -282,6 +286,7 @@
<wstools dest="${build.test.dir}/wstools/resources/jaxws/samples/jsr181pojo/META-INF" config="${test.resources.dir}/jaxws/samples/jsr181pojo/wstools-config.xml"/>
<wstools dest="${build.test.dir}/wstools/resources/jaxws/samples/wsaddressing/META-INF" config="${test.resources.dir}/jaxws/samples/wsaddressing/wstools-config.xml"/>
<move todir="${build.test.dir}/wstools/java">
+ <fileset dir="${build.test.dir}/wstools/resources/jaxrpc/jbws718/WEB-INF" includes="org/**"/>
<fileset dir="${build.test.dir}/wstools/resources/jaxrpc/samples/docstyle/wrapped/WEB-INF" includes="org/**"/>
</move>
</target>
Deleted: branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws718/PingMsg.java
===================================================================
--- branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws718/PingMsg.java 2006-10-10 17:12:11 UTC (rev 1194)
+++ branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws718/PingMsg.java 2006-10-10 19:55:31 UTC (rev 1195)
@@ -1,24 +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.jaxrpc.jbws718;
-
-
-public class PingMsg
-{
-
- protected java.lang.String message;
- public PingMsg(){}
-
- public PingMsg(java.lang.String message){
- this.message=message;
- }
- public java.lang.String getMessage() { return message ;}
-
- public void setMessage(java.lang.String message){ this.message=message; }
-
-}
Deleted: branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws718/PingMsgResponse.java
===================================================================
--- branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws718/PingMsgResponse.java 2006-10-10 17:12:11 UTC (rev 1194)
+++ branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws718/PingMsgResponse.java 2006-10-10 19:55:31 UTC (rev 1195)
@@ -1,15 +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.jaxrpc.jbws718;
-
-
-public class PingMsgResponse
-{
- public PingMsgResponse(){
- }
-}
Deleted: branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws718/TestService_PortType.java
===================================================================
--- branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws718/TestService_PortType.java 2006-10-10 17:12:11 UTC (rev 1194)
+++ branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws718/TestService_PortType.java 2006-10-10 19:55:31 UTC (rev 1195)
@@ -1,12 +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.jaxrpc.jbws718;
-public interface TestService_PortType extends java.rmi.Remote
-{
-
- public org.jboss.test.ws.jaxrpc.jbws718.PingMsgResponse ping(org.jboss.test.ws.jaxrpc.jbws718.PingMsg pingMsg) throws java.rmi.RemoteException;
-}
Deleted: branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws718/TestService_Service.java
===================================================================
--- branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws718/TestService_Service.java 2006-10-10 17:12:11 UTC (rev 1194)
+++ branches/jbossws-1.0/src/test/java/org/jboss/test/ws/jaxrpc/jbws718/TestService_Service.java 2006-10-10 19:55:31 UTC (rev 1195)
@@ -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.jaxrpc.jbws718;
-
-
-import javax.xml.rpc.ServiceException;
-
-
-public interface TestService_Service extends javax.xml.rpc.Service
-{
-
- public org.jboss.test.ws.jaxrpc.jbws718.TestService_PortType getTestServicePort() throws ServiceException;
-
-}
Deleted: branches/jbossws-1.0/src/test/resources/jaxrpc/jbws718/WEB-INF/jaxrpc-mapping.xml
===================================================================
--- branches/jbossws-1.0/src/test/resources/jaxrpc/jbws718/WEB-INF/jaxrpc-mapping.xml 2006-10-10 17:12:11 UTC (rev 1194)
+++ branches/jbossws-1.0/src/test/resources/jaxrpc/jbws718/WEB-INF/jaxrpc-mapping.xml 2006-10-10 19:55:31 UTC (rev 1195)
@@ -1,51 +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.jaxrpc.jbws718</package-type>
- <namespaceURI>http://jboss.org/test/ws/jbws718</namespaceURI>
- </package-mapping>
- <java-xml-type-mapping>
- <java-type>org.jboss.test.ws.jaxrpc.jbws718.PingMsg</java-type>
- <anonymous-type-qname xmlns:typeNS='http://jboss.org/test/ws/jbws718'>typeNS:>PingMsg</anonymous-type-qname>
- <qname-scope>complexType</qname-scope>
- <variable-mapping>
- <java-variable-name>message</java-variable-name>
- <xml-element-name>message</xml-element-name>
- </variable-mapping>
- </java-xml-type-mapping>
- <java-xml-type-mapping>
- <java-type>org.jboss.test.ws.jaxrpc.jbws718.PingMsgResponse</java-type>
- <anonymous-type-qname xmlns:typeNS='http://jboss.org/test/ws/jbws718'>typeNS:>PingMsgResponse</anonymous-type-qname>
- <qname-scope>complexType</qname-scope>
- </java-xml-type-mapping>
- <service-interface-mapping>
- <service-interface>org.jboss.test.ws.jaxrpc.jbws718.TestService_Service</service-interface>
- <wsdl-service-name xmlns:serviceNS='http://jboss.org/test/ws/jbws718'>serviceNS:TestService</wsdl-service-name>
- <port-mapping>
- <port-name>TestServicePort</port-name>
- <java-port-name>TestServicePort</java-port-name>
- </port-mapping>
- </service-interface-mapping>
- <service-endpoint-interface-mapping>
- <service-endpoint-interface>org.jboss.test.ws.jaxrpc.jbws718.TestService_PortType</service-endpoint-interface>
- <wsdl-port-type xmlns:portTypeNS='http://jboss.org/test/ws/jbws718'>portTypeNS:TestService</wsdl-port-type>
- <wsdl-binding xmlns:bindingNS='http://jboss.org/test/ws/jbws718'>bindingNS:TestServiceBinding</wsdl-binding>
- <service-endpoint-method-mapping>
- <java-method-name>ping</java-method-name>
- <wsdl-operation>ping</wsdl-operation>
- <method-param-parts-mapping>
- <param-position>0</param-position>
- <param-type>org.jboss.test.ws.jaxrpc.jbws718.PingMsg</param-type>
- <wsdl-message-mapping>
- <wsdl-message xmlns:wsdlMsgNS='http://jboss.org/test/ws/jbws718'>wsdlMsgNS:PingIn</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.jaxrpc.jbws718.PingMsgResponse</method-return-value>
- <wsdl-message xmlns:wsdlMsgNS='http://jboss.org/test/ws/jbws718'>wsdlMsgNS:PingOut</wsdl-message>
- <wsdl-message-part-name>parameters</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
Deleted: branches/jbossws-1.0/src/test/resources/jaxrpc/jbws718/WEB-INF/webservices.xml
===================================================================
--- branches/jbossws-1.0/src/test/resources/jaxrpc/jbws718/WEB-INF/webservices.xml 2006-10-10 17:12:11 UTC (rev 1194)
+++ branches/jbossws-1.0/src/test/resources/jaxrpc/jbws718/WEB-INF/webservices.xml 2006-10-10 19:55:31 UTC (rev 1195)
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<webservices xmlns="http://java.sun.com/xml/ns/j2ee"
- xmlns:impl="http://jboss.org/test/ws/jbws718"
- 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"
- version="1.1">
-
- <webservice-description>
- <webservice-description-name>TestService</webservice-description-name>
- <wsdl-file>WEB-INF/wsdl/TestService.wsdl</wsdl-file>
- <jaxrpc-mapping-file>WEB-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
- <port-component>
- <port-component-name>TestServicePort</port-component-name>
- <wsdl-port>impl:TestServicePort</wsdl-port>
- <service-endpoint-interface>org.jboss.test.ws.jaxrpc.jbws718.TestService_PortType</service-endpoint-interface>
- <service-impl-bean>
- <servlet-link>TestService</servlet-link>
- </service-impl-bean>
- </port-component>
- </webservice-description>
-</webservices>
Modified: branches/jbossws-1.0/src/test/resources/jaxrpc/jbws718/wstools-config.xml
===================================================================
--- branches/jbossws-1.0/src/test/resources/jaxrpc/jbws718/wstools-config.xml 2006-10-10 17:12:11 UTC (rev 1194)
+++ branches/jbossws-1.0/src/test/resources/jaxrpc/jbws718/wstools-config.xml 2006-10-10 19:55:31 UTC (rev 1195)
@@ -9,8 +9,12 @@
xsi:schemaLocation="http://www.jboss.org/jbossws-tools
http://www.jboss.org/jbossws-tools/schema/jbossws-tool_1_0.xsd">
- <wsdl-java file="WEB-INF/wsdl/TestService.wsdl">
+ <global>
+ <package-namespace package="org.jboss.test.ws.jaxrpc.jbws718" namespace="http://jboss.org/test/ws/jbws718"/>
+ </global>
+ <wsdl-java file="resources/jaxrpc/jbws718/WEB-INF/wsdl/TestService.wsdl">
<mapping file="jaxrpc-mapping.xml" />
+ <webservices servlet-link="TestService" />
</wsdl-java>
</configuration>
Modified: branches/jbossws-1.0/src/test/resources/jaxrpc/jbws807/wstools-config.xml
===================================================================
--- branches/jbossws-1.0/src/test/resources/jaxrpc/jbws807/wstools-config.xml 2006-10-10 17:12:11 UTC (rev 1194)
+++ branches/jbossws-1.0/src/test/resources/jaxrpc/jbws807/wstools-config.xml 2006-10-10 19:55:31 UTC (rev 1195)
@@ -9,6 +9,9 @@
xsi:schemaLocation="http://www.jboss.org/jbossws-tools
http://www.jboss.org/jbossws-tools/schema/jbossws-tool_1_0.xsd">
+ <global>
+ <package-namespace package="org.jboss.test.ws.jaxrpc.jbws807" namespace="http://jboss.org/test/ws/jbws807"/>
+ </global>
<wsdl-java file="WEB-INF/wsdl/TestService.wsdl">
<mapping file="jaxrpc-mapping.xml" />
</wsdl-java>
Modified: branches/jbossws-1.0/version.properties
===================================================================
--- branches/jbossws-1.0/version.properties 2006-10-10 17:12:11 UTC (rev 1194)
+++ branches/jbossws-1.0/version.properties 2006-10-10 19:55:31 UTC (rev 1195)
@@ -18,7 +18,7 @@
ibm-wsdl4j=1.5.2jboss
javassist=3.3.0.GA
jboss-common=1.0.0.GA
-jboss-jbossxb=snapshot
+jboss-jbossxb=1.0.0.CR6
jboss-microcontainer=1.0.2
jboss-remoting=1.4.3.GA
18 years, 5 months
JBossWS SVN: r1194 - in trunk/src/test: ant java/org/jboss/test/ws/jaxws/jsr181/webservice resources/jaxws/jsr181/webservice
by jbossws-commits@lists.jboss.org
Author: jason.greene(a)jboss.com
Date: 2006-10-10 13:12:11 -0400 (Tue, 10 Oct 2006)
New Revision: 1194
Added:
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/JSR181WebServiceBase.java
Removed:
trunk/src/test/resources/jaxws/jsr181/webservice/META-INF/
Modified:
trunk/src/test/ant/build-jars-jaxws.xml
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/EndpointInterface.java
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/JSR181WebServiceEJB21TestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/JSR181WebServiceEJB3TestCase.java
trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/JSR181WebServiceJSETestCase.java
Log:
Convert JSR-181 webservice test cases to use a JAX-WS client
Modified: trunk/src/test/ant/build-jars-jaxws.xml
===================================================================
--- trunk/src/test/ant/build-jars-jaxws.xml 2006-10-10 16:20:55 UTC (rev 1193)
+++ trunk/src/test/ant/build-jars-jaxws.xml 2006-10-10 17:12:11 UTC (rev 1194)
@@ -266,17 +266,6 @@
<include name="org/jboss/test/ws/jaxws/jsr181/webservice/EndpointInterface03.class"/>
</fileset>
</jar>
- <jar jarfile="${build.test.dir}/libs/jaxws-jsr181-webservice-client.jar">
- <fileset dir="${build.test.dir}/classes">
- <include name="org/jboss/test/ws/jaxws/jsr181/webservice/EndpointInterface.class"/>
- </fileset>
- <metainf dir="${build.test.dir}/resources/jaxws/jsr181/webservice/META-INF">
- <include name="application-client.xml"/>
- <include name="jaxrpc-mapping.xml"/>
- <include name="jboss-client.xml"/>
- <include name="wsdl/**"/>
- </metainf>
- </jar>
<!-- jaxws-logicalhandler -->
<war warfile="${build.test.dir}/libs/jaxws-logicalhandler-source.war" webxml="${build.test.dir}/resources/jaxws/logicalhandler/WEB-INF/web-source.xml">
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/EndpointInterface.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/EndpointInterface.java 2006-10-10 16:20:55 UTC (rev 1193)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/EndpointInterface.java 2006-10-10 17:12:11 UTC (rev 1194)
@@ -24,6 +24,10 @@
import java.rmi.Remote;
import java.rmi.RemoteException;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.jws.soap.SOAPBinding.Style;
+
/**
* Test the JSR-181 annotation: javax.jws.WebService
* This interface is only used in the client deployment.
@@ -31,6 +35,8 @@
* @author Thomas.Diesler(a)jboss.org
* @since 29-Apr-2005
*/
+@WebService
+@SOAPBinding(style = Style.RPC)
public interface EndpointInterface extends Remote
{
String echo(String input) throws RemoteException;
Added: trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/JSR181WebServiceBase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/JSR181WebServiceBase.java 2006-10-10 16:20:55 UTC (rev 1193)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/JSR181WebServiceBase.java 2006-10-10 17:12:11 UTC (rev 1194)
@@ -0,0 +1,91 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.jsr181.webservice;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.rmi.RemoteException;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+import org.jboss.test.ws.JBossWSTest;
+import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
+import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
+
+// $Id$
+
+/**
+ * Base testing class for @WebService
+ *
+ * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+public class JSR181WebServiceBase extends JBossWSTest
+{
+ private static EndpointInterface port;
+
+ private EndpointInterface getPort() throws MalformedURLException
+ {
+ if (port == null)
+ {
+ QName serviceName = new QName("http://www.openuri.org/2004/04/HelloWorld", "TestService");
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jsr181?wsdl");
+
+ Service service = Service.create(wsdlURL, serviceName);
+ port = (EndpointInterface)service.getPort(EndpointInterface.class);
+ }
+
+ return port;
+ }
+
+ private void sayHello() throws RemoteException, MalformedURLException
+ {
+ assertWSDLAccess();
+ String helloWorld = "Hello world!";
+ Object retObj = getPort().echo(helloWorld);
+ assertEquals(helloWorld, retObj);
+ }
+
+ public void testWebService() throws Exception
+ {
+ sayHello();
+ }
+
+ public void testWebServiceWsdlLocation() throws Exception
+ {
+ sayHello();
+ }
+
+ public void testWebServiceEndpointInterface() throws Exception
+ {
+ sayHello();
+ }
+
+ private void assertWSDLAccess() throws MalformedURLException
+ {
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jsr181?wsdl");
+ WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
+ WSDLDefinitions wsdlDefinitions = factory.parse(wsdlURL);
+ assertNotNull(wsdlDefinitions);
+ }
+}
\ No newline at end of file
Property changes on: trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/JSR181WebServiceBase.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/JSR181WebServiceEJB21TestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/JSR181WebServiceEJB21TestCase.java 2006-10-10 16:20:55 UTC (rev 1193)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/JSR181WebServiceEJB21TestCase.java 2006-10-10 17:12:11 UTC (rev 1194)
@@ -37,38 +37,22 @@
* Test the JSR-181 annotation: javax.jws.WebService
*
* @author Thomas.Diesler(a)jboss.org
+ * @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
* @since 29-Apr-2005
*/
-public class JSR181WebServiceEJB21TestCase extends JBossWSTest
+public class JSR181WebServiceEJB21TestCase extends JSR181WebServiceBase
{
- private static EndpointInterface port;
-
public static Test suite()
{
- return JBossWSTestSetup.newTestSetup(JSR181WebServiceEJB21TestCase.class, "jaxws-jsr181-webservice-client.jar");
+ return JBossWSTestSetup.newTestSetup(JSR181WebServiceEJB21TestCase.class, "");
}
- protected void setUp() throws Exception
- {
- super.setUp();
- if (port == null)
- {
- InitialContext iniCtx = getInitialContext();
- Service service = (Service)iniCtx.lookup("java:comp/env/service/TestService");
- port = (EndpointInterface)service.getPort(EndpointInterface.class);
- }
- }
-
public void testWebService() throws Exception
{
deploy("jaxws-jsr181-webservice01.jar");
try
{
- assertWSDLAccess();
-
- String helloWorld = "Hello world!";
- Object retObj = port.echo(helloWorld);
- assertEquals(helloWorld, retObj);
+ super.testWebService();
}
finally
{
@@ -81,11 +65,7 @@
deploy("jaxws-jsr181-webservice02.jar");
try
{
- assertWSDLAccess();
-
- String helloWorld = "Hello world!";
- Object retObj = port.echo(helloWorld);
- assertEquals(helloWorld, retObj);
+ super.testWebServiceWsdlLocation();
}
finally
{
@@ -98,23 +78,11 @@
deploy("jaxws-jsr181-webservice03.jar");
try
{
- assertWSDLAccess();
-
- String helloWorld = "Hello world!";
- Object retObj = port.echo(helloWorld);
- assertEquals(helloWorld, retObj);
+ super.testWebServiceEndpointInterface();
}
finally
{
undeploy("jaxws-jsr181-webservice03.jar");
}
}
-
- private void assertWSDLAccess() throws MalformedURLException
- {
- URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jsr181?wsdl");
- WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
- WSDLDefinitions wsdlDefinitions = factory.parse(wsdlURL);
- assertNotNull(wsdlDefinitions);
- }
}
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/JSR181WebServiceEJB3TestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/JSR181WebServiceEJB3TestCase.java 2006-10-10 16:20:55 UTC (rev 1193)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/JSR181WebServiceEJB3TestCase.java 2006-10-10 17:12:11 UTC (rev 1194)
@@ -21,45 +21,26 @@
*/
package org.jboss.test.ws.jaxws.jsr181.webservice;
-import java.net.MalformedURLException;
-import java.net.URL;
-
import javax.naming.InitialContext;
-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.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
/**
* Test the JSR-181 annotation: javax.jws.WebService
*
* @author Thomas.Diesler(a)jboss.org
+ * @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
* @since 29-Apr-2005
*/
-public class JSR181WebServiceEJB3TestCase extends JBossWSTest
+public class JSR181WebServiceEJB3TestCase extends JSR181WebServiceBase
{
- private static EndpointInterface port;
-
public static Test suite()
{
- return JBossWSTestSetup.newTestSetup(JSR181WebServiceEJB3TestCase.class, "jaxws-jsr181-webservice-client.jar");
+ return JBossWSTestSetup.newTestSetup(JSR181WebServiceEJB3TestCase.class, "");
}
- protected void setUp() throws Exception
- {
- super.setUp();
- if (port == null)
- {
- InitialContext iniCtx = getInitialContext();
- Service service = (Service)iniCtx.lookup("java:comp/env/service/TestService");
- port = (EndpointInterface)service.getPort(EndpointInterface.class);
- }
- }
-
public void testRemoteAccess() throws Exception
{
deploy("jaxws-jsr181-webservice01.ejb3");
@@ -83,11 +64,7 @@
deploy("jaxws-jsr181-webservice01.ejb3");
try
{
- assertWSDLAccess();
-
- String helloWorld = "Hello world!";
- Object retObj = port.echo(helloWorld);
- assertEquals(helloWorld, retObj);
+ super.testWebService();
}
finally
{
@@ -100,11 +77,7 @@
deploy("jaxws-jsr181-webservice02.ejb3");
try
{
- assertWSDLAccess();
-
- String helloWorld = "Hello world!";
- Object retObj = port.echo(helloWorld);
- assertEquals(helloWorld, retObj);
+ super.testWebServiceWsdlLocation();
}
finally
{
@@ -117,23 +90,11 @@
deploy("jaxws-jsr181-webservice03.ejb3");
try
{
- assertWSDLAccess();
-
- String helloWorld = "Hello world!";
- Object retObj = port.echo(helloWorld);
- assertEquals(helloWorld, retObj);
+ super.testWebServiceEndpointInterface();
}
finally
{
undeploy("jaxws-jsr181-webservice03.ejb3");
}
}
-
- private void assertWSDLAccess() throws MalformedURLException
- {
- URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jsr181?wsdl");
- WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
- WSDLDefinitions wsdlDefinitions = factory.parse(wsdlURL);
- assertNotNull(wsdlDefinitions);
- }
}
Modified: trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/JSR181WebServiceJSETestCase.java
===================================================================
--- trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/JSR181WebServiceJSETestCase.java 2006-10-10 16:20:55 UTC (rev 1193)
+++ trunk/src/test/java/org/jboss/test/ws/jaxws/jsr181/webservice/JSR181WebServiceJSETestCase.java 2006-10-10 17:12:11 UTC (rev 1194)
@@ -21,55 +21,30 @@
*/
package org.jboss.test.ws.jaxws.jsr181.webservice;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import javax.naming.InitialContext;
-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.metadata.wsdl.WSDLDefinitions;
-import org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory;
/**
* Test the JSR-181 annotation: javax.jws.WebService
*
* @author Thomas.Diesler(a)jboss.org
+ * @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
* @since 29-Apr-2005
*/
-public class JSR181WebServiceJSETestCase extends JBossWSTest
+public class JSR181WebServiceJSETestCase extends JSR181WebServiceBase
{
- private static EndpointInterface port;
-
public static Test suite()
{
- return JBossWSTestSetup.newTestSetup(JSR181WebServiceJSETestCase.class, "jaxws-jsr181-webservice-client.jar");
+ return JBossWSTestSetup.newTestSetup(JSR181WebServiceJSETestCase.class, "");
}
- protected void setUp() throws Exception
- {
- super.setUp();
- if (port == null)
- {
- InitialContext iniCtx = getInitialContext();
- Service service = (Service)iniCtx.lookup("java:comp/env/service/TestService");
- port = (EndpointInterface)service.getPort(EndpointInterface.class);
- }
- }
-
public void testWebService() throws Exception
{
deploy("jaxws-jsr181-webservice01.war");
try
{
- assertWSDLAccess();
-
- String helloWorld = "Hello world!";
- Object retObj = port.echo(helloWorld);
- assertEquals(helloWorld, retObj);
+ super.testWebService();
}
finally
{
@@ -82,11 +57,7 @@
deploy("jaxws-jsr181-webservice02.war");
try
{
- assertWSDLAccess();
-
- String helloWorld = "Hello world!";
- Object retObj = port.echo(helloWorld);
- assertEquals(helloWorld, retObj);
+ super.testWebServiceWsdlLocation();
}
finally
{
@@ -99,23 +70,11 @@
deploy("jaxws-jsr181-webservice03.war");
try
{
- assertWSDLAccess();
-
- String helloWorld = "Hello world!";
- Object retObj = port.echo(helloWorld);
- assertEquals(helloWorld, retObj);
+ super.testWebServiceEndpointInterface();
}
finally
{
undeploy("jaxws-jsr181-webservice03.war");
}
}
-
- private void assertWSDLAccess() throws MalformedURLException
- {
- URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jsr181?wsdl");
- WSDLDefinitionsFactory factory = WSDLDefinitionsFactory.newInstance();
- WSDLDefinitions wsdlDefinitions = factory.parse(wsdlURL);
- assertNotNull(wsdlDefinitions);
- }
}
18 years, 5 months
JBossWS SVN: r1193 - in branches/jbossws-1.0/src: main/java/org/jboss/ws/utils test/java/org/jboss/test/ws/common/utils
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2006-10-10 12:20:55 -0400 (Tue, 10 Oct 2006)
New Revision: 1193
Modified:
branches/jbossws-1.0/src/main/java/org/jboss/ws/utils/DOMWriter.java
branches/jbossws-1.0/src/test/java/org/jboss/test/ws/common/utils/DOMWriterTestCase.java
Log:
[JBWS-762] DOMUtils.parse skips peer comments on Document node
Modified: branches/jbossws-1.0/src/main/java/org/jboss/ws/utils/DOMWriter.java
===================================================================
--- branches/jbossws-1.0/src/main/java/org/jboss/ws/utils/DOMWriter.java 2006-10-10 16:18:27 UTC (rev 1192)
+++ branches/jbossws-1.0/src/main/java/org/jboss/ws/utils/DOMWriter.java 2006-10-10 16:20:55 UTC (rev 1193)
@@ -106,6 +106,13 @@
this.out = new PrintWriter(w);
}
+ public DOMWriter(Writer w, String charsetName)
+ {
+ this.out = new PrintWriter(w);
+ this.charsetName = charsetName;
+ this.writeXMLDeclaration = true;
+ }
+
public DOMWriter(OutputStream stream)
{
try
@@ -194,9 +201,9 @@
* Set wheter the XML declaration should be written.
* The default is false.
*/
- public DOMWriter setWriteXMLDeclaration(boolean writeXMLDeclaration)
+ public DOMWriter setWriteXMLDeclaration(boolean flag)
{
- this.writeXMLDeclaration = writeXMLDeclaration;
+ this.writeXMLDeclaration = flag;
return this;
}
@@ -223,7 +230,10 @@
if (charsetName != null)
out.print(" encoding='" + charsetName + "'");
- out.println("?>");
+ out.print("?>");
+ if (prettyprint)
+ out.println();
+
wroteXMLDeclaration = true;
}
Modified: branches/jbossws-1.0/src/test/java/org/jboss/test/ws/common/utils/DOMWriterTestCase.java
===================================================================
--- branches/jbossws-1.0/src/test/java/org/jboss/test/ws/common/utils/DOMWriterTestCase.java 2006-10-10 16:18:27 UTC (rev 1192)
+++ branches/jbossws-1.0/src/test/java/org/jboss/test/ws/common/utils/DOMWriterTestCase.java 2006-10-10 16:20:55 UTC (rev 1193)
@@ -23,6 +23,7 @@
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
+import java.io.StringWriter;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.SOAPMessage;
@@ -30,6 +31,7 @@
import org.jboss.test.ws.JBossWSTest;
import org.jboss.util.xml.DOMUtils;
import org.jboss.ws.utils.DOMWriter;
+import org.w3c.dom.Document;
import org.w3c.dom.Element;
/**
@@ -242,4 +244,24 @@
assertEquals(expStr, wasStr);
}
+
+ // [JBWS-762] DOMUtils.parse skips peer comments on Document node
+ public void testDocumentComments() throws Exception
+ {
+ String expStr =
+ "<?xml version='1.0' encoding='UTF-8'?>" +
+ "<!-- Some root comment -->" +
+ "<root>" +
+ "<!-- Some element comment -->" +
+ "<element>some value</element>" +
+ "</root>";
+
+
+ Document doc = DOMUtils.parse(expStr).getOwnerDocument();
+ StringWriter strwr = new StringWriter();
+ new DOMWriter(strwr, "UTF-8").print(doc);
+ String wasStr = strwr.toString();
+
+ assertEquals(expStr, wasStr);
+ }
}
18 years, 5 months