MyListPortsWriterpublic class MyListPortsWriter extends org.apache.axis.wsdl.toJava.JavaWriter This is my example of a class that writes a list of a service's
ports to a file named Lst.lst.
Note: because of a name clash problem, I add the suffix "Lst".
I hope to remove this in a future version of this example.
Details of the JavaWriter bug: JavaWriter looks to make sure a
class doesn't already exist before creating a file, but not all
files that we generate are .class files! This works with
deploy.wsdd and undeploy.wsdd because these files just happen
to begin with lowercase letters, where Java classes begin with
uppercase letters. But this example shows the problem quite
well. I would LIKE to call the file .lst, but
JavaWriter sees that we already have a class called
and won't let me proceed. |
Fields Summary |
---|
private javax.wsdl.Service | service | private String | fileName |
Methods Summary |
---|
protected java.lang.String | getFileName()
return fileName;
| protected void | writeFileBody(java.io.PrintWriter pw)Write the service list file.
Map portMap = service.getPorts();
Iterator portIterator = portMap.values().iterator();
while (portIterator.hasNext()) {
Port p = (Port) portIterator.next();
pw.println(p.getName());
}
pw.close(); // Note: this really should be done in JavaWriter.
| protected void | writeFileHeader(java.io.PrintWriter pw)Override the common JavaWriter header to a no-op.
|
|