Thanks Glen !
Please see my comments in line.
Glen Mazza wrote:
Am Mittwoch, den 26.09.2007, 09:14 +0000 schrieb [EMAIL PROTECTED]:
Author: ema
Date: Wed Sep 26 02:14:55 2007
}
+
+ fw = new FileWriterUtil((String)env.get(ToolConstants.CFG_SOURCEDIR));
fw = new FileWriterUtil((String)env.get(getOutputDirectory()); ?
Since the only difference between parseOutputName() here and in the base
class is the line of code above (ToolConstants.CFG_SOURCEDIR vs.
ToolConstants.CFG_OUTPUTDIR), perhaps best to instead write a one-line
method getOutputDirectory(), which in the base class returns
CFG_OUTPUTDIR and in this class returns CFG_SOURCEDIR. That way, we can
get rid of repeated implementations of pON() here and in
AbstractSimpleGenerator below.
You are definitely right . This is already on my today's To-Do list :
refactor the AbstarctGenerator in wsdlto module
to remove the hard code CFG_OUTPUTDIR .
+ try {
+ writer = fw.getWriter(packageName, filename + ext);
+ } catch (IOException ioe) {
+ Message msg = new Message("FAIL_TO_WRITE_FILE", LOG, packageName +
"." + filename + ext);
+ throw new ToolException(msg, ioe);
+ }
+
+ return writer;
+ }
+
public void register(final ClassCollector collector, String packageName, String fileName) {
}
Modified:
incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/AbstractSimpleGenerator.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/AbstractSimpleGenerator.java?rev=579529&r1=579528&r2=579529&view=diff
==============================================================================
---
incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/AbstractSimpleGenerator.java
(original)
+++
incubator/cxf/trunk/tools/javato/ws/src/main/java/org/apache/cxf/tools/java2wsdl/processor/internal/simple/generator/AbstractSimpleGenerator.java
Wed Sep 26 02:14:55 2007
@@ -18,12 +18,18 @@
*/
public abstract class AbstractSimpleGenerator extends AbstractGenerator {
@@ -37,5 +43,27 @@
public void register(final ClassCollector collector, String packageName,
String fileName) {
}
+
+ protected Writer parseOutputName(String packageName, String filename, String ext) throws ToolException {
+ FileWriterUtil fw = null;
+ Writer writer = null;
+
Same story as above.
}
Added:
incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/GreeterImpl.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/GreeterImpl.java?rev=579529&view=auto
==============================================================================
---
incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/GreeterImpl.java
(added)
+++
incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/GreeterImpl.java
Wed Sep 26 02:14:55 2007
@@ -0,0 +1,29 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.tools.fortest;
+
+import javax.jws.WebService;
+
[EMAIL PROTECTED]
+public class GreeterImpl {
+ public String greetMe() {
+ return "";
+ }
Perhaps best to have it return a string.
Yes . I will add a non-empty value for it .
+
+}
Added:
incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/HelloImpl.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/HelloImpl.java?rev=579529&view=auto
==============================================================================
---
incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/HelloImpl.java
(added)
+++
incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/fortest/HelloImpl.java
Wed Sep 26 02:14:55 2007
@@ -0,0 +1,30 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.tools.fortest;
+
+import javax.jws.WebService;
+
[EMAIL PROTECTED]
+public class HelloImpl implements Hello {
+
+ public String sayHi(String arg) {
+ return "";
+ }
+
+}
Same thing.
Modified:
incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/JavaToWSTest.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/JavaToWSTest.java?rev=579529&r1=579528&r2=579529&view=diff
==============================================================================
---
incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/JavaToWSTest.java
(original)
+++
incubator/cxf/trunk/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/JavaToWSTest.java
Wed Sep 26 02:14:55 2007
@@ -207,6 +207,24 @@
assertTrue("jaxb databinding warning should be detected", getStdErr()
.indexOf("Simple front end only supports aegis databinding")
> -1);
}
+
+ @Test
+ public void testImplClassWithoutSei() throws Exception {
+ File wsdlFile = outputFile("tmp.wsdl");
+ String[] args = new String[] {"-wsdl", "-o", output.getPath() + "/tmp.wsdl",
"-verbose", "-s",
+ output.getPath(), "-frontend", "jaxws", "-client",
"-server",
+
"org.apache.cxf.tools.fortest.GreeterImpl"};
+ JavaToWS.main(args);
+ assertTrue("Failed to generate WSDL file", wsdlFile.exists());
+
+ File sei = outputFile("org/apache/cxf/tools/fortest/GreeterImpl_PortType.java");
+ assertTrue("Failed to generate SEI file : GreeterImpl_PortType.java",
sei.exists());
file: (no space)
+ File client =
outputFile("org/apache/cxf/tools/fortest/GreeterImpl_PortTypeClient.java");
+ assertTrue("Failed to generate client file :
GreeterImpl_PortTypeClient.java", client.exists());
again
+ File server =
outputFile("org/apache/cxf/tools/fortest/GreeterImpl_PortTypeServer.java");
+ assertTrue("Failed to generate SEI file :
GreeterImpl_PortTypeServer.java", server.exists());
here too
Will fix it.
Regards,
Glen
Thanks
Jim