You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by gd...@apache.org on 2005/07/11 17:49:55 UTC
svn commit: r210150 [19/35] - in /webservices/axis/trunk/java: ./ etc/
modules/addressing/
modules/addressing/src/org/apache/axis2/handlers/addressing/
modules/addressing/test-resources/
modules/addressing/test/org/apache/axis2/handlers/addressing/ mod...
Modified: webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/rest/RESTBasedEchoRawXMLTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/rest/RESTBasedEchoRawXMLTest.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/rest/RESTBasedEchoRawXMLTest.java (original)
+++ webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/rest/RESTBasedEchoRawXMLTest.java Mon Jul 11 08:49:30 2005
@@ -44,9 +44,9 @@
public class RESTBasedEchoRawXMLTest extends TestCase {
private EndpointReference targetEPR =
new EndpointReference(AddressingConstants.WSA_TO,
- "http://127.0.0.1:"
- + (UtilServer.TESTING_PORT)
- + "/axis/services/EchoXMLService/echoOMElement");
+ "http://127.0.0.1:"
+ + (UtilServer.TESTING_PORT)
+ + "/axis/services/EchoXMLService/echoOMElement");
private Log log = LogFactory.getLog(getClass());
private QName serviceName = new QName("EchoXMLService");
private QName operationName = new QName("echoOMElement");
@@ -55,15 +55,15 @@
private AxisConfiguration engineRegistry;
private MessageContext mc;
//private Thread thisThread;
- // private SimpleHTTPServer sas;
+ // private SimpleHTTPServer sas;
private ServiceContext serviceContext;
private ServiceDescription service;
private boolean finish = false;
-
-
+
+
private Thread thread;
-
+
private final MessageInformation messageInfo = new MessageInformation();
public RESTBasedEchoRawXMLTest() {
@@ -76,12 +76,12 @@
protected void setUp() throws Exception {
UtilServer.start();
- Parameter parameter = new ParameterImpl(Constants.Configuration.ENABLE_REST,"true");
- ((AxisConfigurationImpl)UtilServer.getConfigurationContext().getAxisConfiguration()).addParameter(parameter);
+ Parameter parameter = new ParameterImpl(Constants.Configuration.ENABLE_REST, "true");
+ ((AxisConfigurationImpl) UtilServer.getConfigurationContext().getAxisConfiguration()).addParameter(parameter);
service =
Utils.createSimpleService(serviceName,
- Echo.class.getName(),
- operationName);
+ Echo.class.getName(),
+ operationName);
UtilServer.deployService(service);
serviceContext =
UtilServer.getConfigurationContext().createServiceContext(service.getName());
@@ -126,7 +126,7 @@
// };
// thread = new Thread(runnable);
// thread.start();
-
+
}
@@ -142,11 +142,11 @@
OMElement value = fac.createOMElement("myValue", omNs);
value.addChild(fac.createText(value, "Isaac Assimov, the foundation Sega"));
method.addChild(value);
-
+
return method;
}
-
+
public void testEchoXMLSync() throws Exception {
SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
@@ -160,13 +160,13 @@
OMElement result =
(OMElement) call.invokeBlocking(operationName.getLocalPart(), payload);
result.serializeWithCache(new OMOutput(XMLOutputFactory.newInstance().createXMLStreamWriter(System.out)));
-
+
System.out.println(messageInfo.requestMessage);
call.close();
}
-
- public class MessageInformation{
+
+ public class MessageInformation {
private String requestMessage = null;
- private String responseMessage = null;
+ private String responseMessage = null;
}
}
Modified: webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/tcp/TCPEchoRawXMLTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/tcp/TCPEchoRawXMLTest.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/tcp/TCPEchoRawXMLTest.java (original)
+++ webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/tcp/TCPEchoRawXMLTest.java Mon Jul 11 08:49:30 2005
@@ -17,7 +17,6 @@
package org.apache.axis2.tcp;
-
import junit.framework.TestCase;
import org.apache.axis2.Constants;
import org.apache.axis2.addressing.AddressingConstants;
@@ -43,9 +42,9 @@
public class TCPEchoRawXMLTest extends TestCase {
private EndpointReference targetEPR =
new EndpointReference(AddressingConstants.WSA_TO,
- "tcp://127.0.0.1:"
- + (UtilServer.TESTING_PORT)
- + "/axis/services/EchoXMLService/echoOMElement");
+ "tcp://127.0.0.1:"
+ + (UtilServer.TESTING_PORT)
+ + "/axis/services/EchoXMLService/echoOMElement");
private QName serviceName = new QName("EchoXMLService");
private QName operationName = new QName("echoOMElement");
private QName transportName = new QName("http://localhost/my", "NullTransport");
@@ -54,7 +53,7 @@
private SimpleHTTPServer sas;
private ServiceDescription service;
private ServiceContext serviceContext;
-
+
private boolean finish = false;
public TCPEchoRawXMLTest() {
@@ -72,16 +71,15 @@
//create and deploy the service
service =
Utils.createSimpleService(serviceName,
- Echo.class.getName(),
- operationName);
+ Echo.class.getName(),
+ operationName);
UtilsTCPServer.deployService(service);
-
+
ServiceDescription service =
- Utils.createSimpleService(
- serviceName,
- org.apache.axis2.engine.Echo.class.getName(),
- operationName);
- serviceContext = UtilServer.createAdressedEnabledClientSide(service);
+ Utils.createSimpleService(serviceName,
+ org.apache.axis2.engine.Echo.class.getName(),
+ operationName);
+ serviceContext = UtilServer.createAdressedEnabledClientSide(service);
}
protected void tearDown() throws Exception {
@@ -95,12 +93,12 @@
OMElement value = fac.createOMElement("myValue", omNs);
value.addChild(fac.createText(value, "Isaac Assimov, the foundation Sega"));
method.addChild(value);
-
+
return method;
}
public void testEchoXMLASync() throws Exception {
- OMElement payload = createEnvelope();
+ OMElement payload = createEnvelope();
org.apache.axis2.clientapi.Call call = new org.apache.axis2.clientapi.Call(serviceContext);
@@ -130,7 +128,7 @@
while (!finish) {
Thread.sleep(1000);
index++;
- if(index > 10 ){
+ if (index > 10) {
throw new AxisFault("Server is shutdown as the Async response take too longs time");
}
}
@@ -153,32 +151,31 @@
result.serializeWithCache(new OMOutput(XMLOutputFactory.newInstance().createXMLStreamWriter(System.out)));
call.close();
}
-
+
public void testEchoXMLCompleteSync() throws Exception {
- ServiceDescription service =
- Utils.createSimpleService(
- serviceName,
- Echo.class.getName(),
- operationName);
-
- OMFactory fac = OMAbstractFactory.getOMFactory();
-
- OMNamespace omNs = fac.createOMNamespace("http://localhost/my", "my");
- OMElement method = fac.createOMElement("echoOMElement", omNs);
- OMElement value = fac.createOMElement("myValue", omNs);
- value.setText("Isaac Assimov, the foundation Sega");
- method.addChild(value);
-
- org.apache.axis2.clientapi.Call call = new org.apache.axis2.clientapi.Call(serviceContext);
- call.setTo(targetEPR);
- call.engageModule(new QName(Constants.MODULE_ADDRESSING));
- call.setTransportInfo(Constants.TRANSPORT_TCP, Constants.TRANSPORT_TCP, true);
-
- OMElement result = (OMElement) call.invokeBlocking(operationName.getLocalPart(), method);
- result.serializeWithCache(new OMOutput(XMLOutputFactory.newInstance().createXMLStreamWriter(System.out)));
- call.close();
-
- }
-
-
+ ServiceDescription service =
+ Utils.createSimpleService(serviceName,
+ Echo.class.getName(),
+ operationName);
+
+ OMFactory fac = OMAbstractFactory.getOMFactory();
+
+ OMNamespace omNs = fac.createOMNamespace("http://localhost/my", "my");
+ OMElement method = fac.createOMElement("echoOMElement", omNs);
+ OMElement value = fac.createOMElement("myValue", omNs);
+ value.setText("Isaac Assimov, the foundation Sega");
+ method.addChild(value);
+
+ org.apache.axis2.clientapi.Call call = new org.apache.axis2.clientapi.Call(serviceContext);
+ call.setTo(targetEPR);
+ call.engageModule(new QName(Constants.MODULE_ADDRESSING));
+ call.setTransportInfo(Constants.TRANSPORT_TCP, Constants.TRANSPORT_TCP, true);
+
+ OMElement result = (OMElement) call.invokeBlocking(operationName.getLocalPart(), method);
+ result.serializeWithCache(new OMOutput(XMLOutputFactory.newInstance().createXMLStreamWriter(System.out)));
+ call.close();
+
+ }
+
+
}
Modified: webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/tcp/TCPTwoChannelEchoRawXMLTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/tcp/TCPTwoChannelEchoRawXMLTest.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/tcp/TCPTwoChannelEchoRawXMLTest.java (original)
+++ webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/tcp/TCPTwoChannelEchoRawXMLTest.java Mon Jul 11 08:49:30 2005
@@ -17,7 +17,6 @@
package org.apache.axis2.tcp;
-
import junit.framework.TestCase;
import org.apache.axis2.Constants;
import org.apache.axis2.addressing.AddressingConstants;
@@ -42,9 +41,9 @@
public class TCPTwoChannelEchoRawXMLTest extends TestCase {
private EndpointReference targetEPR =
new EndpointReference(AddressingConstants.WSA_TO,
- "tcp://127.0.0.1:"
- + (UtilServer.TESTING_PORT)
- + "/axis/services/EchoXMLService/echoOMElement");
+ "tcp://127.0.0.1:"
+ + (UtilServer.TESTING_PORT)
+ + "/axis/services/EchoXMLService/echoOMElement");
private QName serviceName = new QName("EchoXMLService");
private QName operationName = new QName("echoOMElement");
private QName transportName = new QName("http://localhost/my", "NullTransport");
@@ -53,7 +52,7 @@
private SimpleHTTPServer sas;
private ServiceDescription service;
private ServiceContext serviceContext;
-
+
private boolean finish = false;
public TCPTwoChannelEchoRawXMLTest() {
@@ -71,16 +70,15 @@
//create and deploy the service
service =
Utils.createSimpleService(serviceName,
- Echo.class.getName(),
- operationName);
+ Echo.class.getName(),
+ operationName);
UtilsTCPServer.deployService(service);
-
+
ServiceDescription service =
- Utils.createSimpleService(
- serviceName,
- org.apache.axis2.engine.Echo.class.getName(),
- operationName);
- serviceContext = UtilServer.createAdressedEnabledClientSide(service);
+ Utils.createSimpleService(serviceName,
+ org.apache.axis2.engine.Echo.class.getName(),
+ operationName);
+ serviceContext = UtilServer.createAdressedEnabledClientSide(service);
}
protected void tearDown() throws Exception {
@@ -94,63 +92,60 @@
OMElement value = fac.createOMElement("myValue", omNs);
value.addChild(fac.createText(value, "Isaac Assimov, the foundation Sega"));
method.addChild(value);
-
+
return method;
}
public void testEchoXMLCompleteASync() throws Exception {
- ServiceDescription service =
- Utils.createSimpleService(
- serviceName,
- Echo.class.getName(),
- operationName);
-
-
-
- OMFactory fac = OMAbstractFactory.getOMFactory();
-
- OMNamespace omNs = fac.createOMNamespace("http://localhost/my", "my");
- OMElement method = fac.createOMElement("echoOMElement", omNs);
- OMElement value = fac.createOMElement("myValue", omNs);
- value.setText("Isaac Assimov, the foundation Sega");
- method.addChild(value);
-
- org.apache.axis2.clientapi.Call call = new org.apache.axis2.clientapi.Call(serviceContext);
- call.engageModule(new QName(Constants.MODULE_ADDRESSING));
-
- try {
- call.setTo(targetEPR);
- call.setTransportInfo(Constants.TRANSPORT_TCP, Constants.TRANSPORT_TCP, true);
- Callback callback = new Callback() {
- public void onComplete(AsyncResult result) {
- try {
- result.getResponseEnvelope().serialize(
- new OMOutput(XMLOutputFactory.newInstance().createXMLStreamWriter(System.out)));
- } catch (XMLStreamException e) {
- reportError(e);
- } finally {
- finish = true;
- }
- }
+ ServiceDescription service =
+ Utils.createSimpleService(serviceName,
+ Echo.class.getName(),
+ operationName);
+
+
+ OMFactory fac = OMAbstractFactory.getOMFactory();
- public void reportError(Exception e) {
- e.printStackTrace();
+ OMNamespace omNs = fac.createOMNamespace("http://localhost/my", "my");
+ OMElement method = fac.createOMElement("echoOMElement", omNs);
+ OMElement value = fac.createOMElement("myValue", omNs);
+ value.setText("Isaac Assimov, the foundation Sega");
+ method.addChild(value);
+
+ org.apache.axis2.clientapi.Call call = new org.apache.axis2.clientapi.Call(serviceContext);
+ call.engageModule(new QName(Constants.MODULE_ADDRESSING));
+
+ try {
+ call.setTo(targetEPR);
+ call.setTransportInfo(Constants.TRANSPORT_TCP, Constants.TRANSPORT_TCP, true);
+ Callback callback = new Callback() {
+ public void onComplete(AsyncResult result) {
+ try {
+ result.getResponseEnvelope().serialize(new OMOutput(XMLOutputFactory.newInstance().createXMLStreamWriter(System.out)));
+ } catch (XMLStreamException e) {
+ reportError(e);
+ } finally {
finish = true;
}
- };
+ }
- call.invokeNonBlocking(operationName.getLocalPart(), method, callback);
- int index = 0;
- while (!finish) {
- Thread.sleep(1000);
- index++;
- if (index > 10) {
- throw new AxisFault("Server is shutdown as the Async response take too longs time");
- }
+ public void reportError(Exception e) {
+ e.printStackTrace();
+ finish = true;
}
- } finally {
- call.close();
- }
+ };
+ call.invokeNonBlocking(operationName.getLocalPart(), method, callback);
+ int index = 0;
+ while (!finish) {
+ Thread.sleep(1000);
+ index++;
+ if (index > 10) {
+ throw new AxisFault("Server is shutdown as the Async response take too longs time");
+ }
+ }
+ } finally {
+ call.close();
}
+
+ }
}
Modified: webservices/axis/trunk/java/modules/samples/wsdl/Axis2SampleDocLit.wsdl
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/wsdl/Axis2SampleDocLit.wsdl?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/wsdl/Axis2SampleDocLit.wsdl (original)
+++ webservices/axis/trunk/java/modules/samples/wsdl/Axis2SampleDocLit.wsdl Mon Jul 11 08:49:30 2005
@@ -1,16 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
-<definitions name="Axis2SampleDocLitService"
- targetNamespace="http://userguide.axis2.apache.org/Axis2SampleDocLit"
- xmlns="http://schemas.xmlsoap.org/wsdl/"
- xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:tns="http://userguide.axis2.apache.org/Axis2SampleDocLit"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+<definitions name="Axis2SampleDocLitService"
+ targetNamespace="http://userguide.axis2.apache.org/Axis2SampleDocLit"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:tns="http://userguide.axis2.apache.org/Axis2SampleDocLit"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsd1="http://userguide.axis2.apache.org/xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<types>
<schema targetNamespace="http://userguide.axis2.apache.org/xsd"
- xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
elementFormDefault="qualified">
<complexType name="ArrayOfstring_literal">
@@ -18,24 +18,24 @@
<element maxOccurs="unbounded" minOccurs="1" name="string" type="xsd:string"/>
</sequence>
</complexType>
- <complexType name="SOAPStruct">
+ <complexType name="SOAPStruct">
<all>
<element name="varFloat" type="xsd:float"/>
<element name="varInt" type="xsd:int"/>
<element name="varString" type="xsd:string"/>
</all>
</complexType>
-
+
<element name="echoStringParam" type="xsd:string"/>
<element name="echoIntParam" type="xsd:int"/>
-
+
<element name="echoStringReturn" type="xsd:string"/>
<element name="echoStringArrayParam" type="xsd1:ArrayOfstring_literal"/>
-
+
<element name="echoStringArrayReturn" type="xsd1:ArrayOfstring_literal"/>
-
+
<element name="echoStructParam" type="xsd1:SOAPStruct"/>
-
+
<element name="echoStructReturn" type="xsd1:SOAPStruct"/>
</schema>
</types>
@@ -78,58 +78,58 @@
<output message="tns:echoVoidResponse" name="echoVoidResponse"/>
</operation>
</portType>
- <binding name="Axis2SampleDocLitPortBinding"
+ <binding name="Axis2SampleDocLitPortBinding"
type="tns:Axis2SampleDocLitPortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="echoString">
<soap:operation soapAction="echoString" style="rpc"/>
<input name="echoString">
- <soap:body namespace="http://userguide.axis2.apache.org/Axis2SampleDocLit"
+ <soap:body namespace="http://userguide.axis2.apache.org/Axis2SampleDocLit"
use="literal"/>
</input>
<output name="echoStringResponse">
- <soap:body namespace="http://userguide.axis2.apache.org/Axis2SampleDocLit"
+ <soap:body namespace="http://userguide.axis2.apache.org/Axis2SampleDocLit"
use="literal"/>
</output>
</operation>
<operation name="echoStringArray">
<soap:operation soapAction="echoStringArray" style="rpc"/>
<input name="echoStringArray">
- <soap:body namespace="http://userguide.axis2.apache.org/Axis2SampleDocLit"
+ <soap:body namespace="http://userguide.axis2.apache.org/Axis2SampleDocLit"
use="literal"/>
</input>
<output name="echoStringArrayResponse">
- <soap:body namespace="http://userguide.axis2.apache.org/Axis2SampleDocLit"
+ <soap:body namespace="http://userguide.axis2.apache.org/Axis2SampleDocLit"
use="literal"/>
</output>
</operation>
<operation name="echoStruct">
<soap:operation soapAction="echoStruct" style="rpc"/>
<input name="echoStruct">
- <soap:body namespace="http://userguide.axis2.apache.org/Axis2SampleDocLit"
+ <soap:body namespace="http://userguide.axis2.apache.org/Axis2SampleDocLit"
use="literal"/>
</input>
<output name="echoStructResponse">
- <soap:body namespace="http://userguide.axis2.apache.org/Axis2SampleDocLit"
+ <soap:body namespace="http://userguide.axis2.apache.org/Axis2SampleDocLit"
use="literal"/>
</output>
</operation>
<operation name="echoVoid">
<soap:operation soapAction="echoVoid" style="rpc"/>
<input name="echoVoid">
- <soap:body namespace="http://userguide.axis2.apache.org/Axis2SampleDocLit"
+ <soap:body namespace="http://userguide.axis2.apache.org/Axis2SampleDocLit"
use="literal"/>
</input>
<output name="echoVoidResponse">
- <soap:body namespace="http://userguide.axis2.apache.org/Axis2SampleDocLit"
+ <soap:body namespace="http://userguide.axis2.apache.org/Axis2SampleDocLit"
use="literal"/>
</output>
</operation>
</binding>
<service name="Axis2SampleDocLitService">
- <port binding="tns:Axis2SampleDocLitPortBinding"
+ <port binding="tns:Axis2SampleDocLitPortBinding"
name="Axis2SampleDocLitPort">
- <soap:address
+ <soap:address
location="http://userguide.axis2.apache.org/stkv3/wsdl/Axis2SampleDocLit.wsdl"/>
</port>
</service>
Modified: webservices/axis/trunk/java/modules/tool/conf/codegen/plugin.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/conf/codegen/plugin.xml?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/tool/conf/codegen/plugin.xml (original)
+++ webservices/axis/trunk/java/modules/tool/conf/codegen/plugin.xml Mon Jul 11 08:49:30 2005
@@ -1,50 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin
- id="Axis2_Codegen_Wizard"
- name="Axis2 Codegen Wizard Plug-in"
- version="1.0.0"
- provider-name="Apache Software Foundation"
- class="org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin">
+ id="Axis2_Codegen_Wizard"
+ name="Axis2 Codegen Wizard Plug-in"
+ version="1.0.0"
+ provider-name="Apache Software Foundation"
+ class="org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin">
- <runtime>
- <library name="Axis2CodegenWizard.jar">
- <export name="*"/>
- </library>
- <library name="lib/axis2-wsdl-M1.jar">
- <export name="*"/>
- </library>
- <library name="lib/axis2-xml-M1.jar">
- <export name="*"/>
- </library>
- <library name="lib/axis-wsdl4j-1.2-RC3.jar">
- <export name="*"/>
- </library>
- <library name="lib/stax-api-1.0.jar">
- <export name="*"/>
- </library>
- </runtime>
+ <runtime>
+ <library name="Axis2CodegenWizard.jar">
+ <export name="*"/>
+ </library>
+ <library name="lib/axis2-wsdl-M1.jar">
+ <export name="*"/>
+ </library>
+ <library name="lib/axis2-xml-M1.jar">
+ <export name="*"/>
+ </library>
+ <library name="lib/axis-wsdl4j-1.2-RC3.jar">
+ <export name="*"/>
+ </library>
+ <library name="lib/stax-api-1.0.jar">
+ <export name="*"/>
+ </library>
+ </runtime>
- <requires>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.core.resources"/>
- <import plugin="org.eclipse.ui.ide"/>
- </requires>
+ <requires>
+ <import plugin="org.eclipse.ui"/>
+ <import plugin="org.eclipse.core.runtime"/>
+ <import plugin="org.eclipse.core.resources"/>
+ <import plugin="org.eclipse.ui.ide"/>
+ </requires>
- <extension
- point="org.eclipse.ui.newWizards">
- <category
+ <extension
+ point="org.eclipse.ui.newWizards">
+ <category
name="Axis2 Wizards"
id="Axis2_Wizards">
- </category>
- <wizard
+ </category>
+ <wizard
name="Axis2 Code Generator"
icon="icons/icon.gif"
category="Axis2_Wizards"
class="org.apache.axis.tool.codegen.eclipse.CodeGenWizard"
id="org.apache.axis.tool.codegen.eclipse.CodeGenWizard">
- </wizard>
- </extension>
+ </wizard>
+ </extension>
</plugin>
Modified: webservices/axis/trunk/java/modules/tool/conf/service/plugin.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/conf/service/plugin.xml?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/tool/conf/service/plugin.xml (original)
+++ webservices/axis/trunk/java/modules/tool/conf/service/plugin.xml Mon Jul 11 08:49:30 2005
@@ -1,37 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin
- id="Axis_Service_Archiver"
- name="Axis Service Maker"
- version="1.0.0"
- provider-name="Apache Software Foundation"
- class="org.apache.axis.tool.service.eclipse.plugin.ServiceArchiver">
+ id="Axis_Service_Archiver"
+ name="Axis Service Maker"
+ version="1.0.0"
+ provider-name="Apache Software Foundation"
+ class="org.apache.axis.tool.service.eclipse.plugin.ServiceArchiver">
- <runtime>
- <library name="Axis_Service_Archiver.jar">
- <export name="*"/>
- </library>
- </runtime>
+ <runtime>
+ <library name="Axis_Service_Archiver.jar">
+ <export name="*"/>
+ </library>
+ </runtime>
- <requires>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.apache.ant"/>
- <import plugin="org.eclipse.jface.text"/>
- </requires>
+ <requires>
+ <import plugin="org.eclipse.ui"/>
+ <import plugin="org.eclipse.core.runtime"/>
+ <import plugin="org.apache.ant"/>
+ <import plugin="org.eclipse.jface.text"/>
+ </requires>
-<extension
- point="org.eclipse.ui.newWizards">
- <category
+ <extension
+ point="org.eclipse.ui.newWizards">
+ <category
name="Axis2 Wizards"
id="Axis2_Wizards">
- </category>
- <wizard
+ </category>
+ <wizard
name="Axis2 Service Archiver"
icon="icons/sample.gif"
category="Axis2_Wizards"
class="org.apache.axis.tool.service.eclipse.ui.ServiceArchiveWizard"
id="org.apache.axis.tool.service.serviceWizard">
- </wizard>
- </extension>
+ </wizard>
+ </extension>
</plugin>
Modified: webservices/axis/trunk/java/modules/tool/create-project.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/create-project.xml?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/tool/create-project.xml (original)
+++ webservices/axis/trunk/java/modules/tool/create-project.xml Mon Jul 11 08:49:30 2005
@@ -1,4 +1,4 @@
-<project basedir="." default="all" >
+<project basedir="." default="all">
<property name="src" value="./src"></property>
<property name="output" value="./eclipse_projects"></property>
@@ -13,41 +13,40 @@
<property name="service.resource.dir" value="./conf/service"></property>
-
- <target name="all">
- <antcall target="generate-service-project" />
- <antcall target="generate-codegen-project" />
- </target>
-
- <target name="init" >
- <mkdir dir="${output}"></mkdir>
- <mkdir dir="${service.output.dir}"></mkdir>
- <mkdir dir="${codegen.output.dir}"></mkdir>
- </target>
-
- <target name="generate-service-project" depends="init">
- <mkdir dir="${service.output.dir}/${source.dir.name}"></mkdir>
- <!-- copy the source to src -->
- <copy todir="${service.output.dir}/${source.dir.name}" >
- <fileset dir="${src}" excludes="**/codegen/**/*.java" />
- </copy>
-
- <copy todir="${service.output.dir}" >
- <fileset dir="${service.resource.dir}"></fileset>
- </copy>
- </target>
+ <target name="all">
+ <antcall target="generate-service-project"/>
+ <antcall target="generate-codegen-project"/>
+ </target>
+
+ <target name="init">
+ <mkdir dir="${output}"></mkdir>
+ <mkdir dir="${service.output.dir}"></mkdir>
+ <mkdir dir="${codegen.output.dir}"></mkdir>
+ </target>
+
+ <target name="generate-service-project" depends="init">
+ <mkdir dir="${service.output.dir}/${source.dir.name}"></mkdir>
+ <!-- copy the source to src -->
+ <copy todir="${service.output.dir}/${source.dir.name}">
+ <fileset dir="${src}" excludes="**/codegen/**/*.java"/>
+ </copy>
+
+ <copy todir="${service.output.dir}">
+ <fileset dir="${service.resource.dir}"></fileset>
+ </copy>
+ </target>
<target name="generate-codegen-project" depends="init">
- <mkdir dir="${codegen.output.dir}/${source.dir.name}"></mkdir>
- <!-- copy the source to src -->
- <copy todir="${codegen.output.dir}/${source.dir.name}" >
- <fileset dir="${src}" excludes="**/service/**/*.java" />
- </copy>
-
- <copy todir="${codegen.output.dir}" >
- <fileset dir="${codegen.resource.dir}"></fileset>
- </copy>
- </target>
+ <mkdir dir="${codegen.output.dir}/${source.dir.name}"></mkdir>
+ <!-- copy the source to src -->
+ <copy todir="${codegen.output.dir}/${source.dir.name}">
+ <fileset dir="${src}" excludes="**/service/**/*.java"/>
+ </copy>
+
+ <copy todir="${codegen.output.dir}">
+ <fileset dir="${codegen.resource.dir}"></fileset>
+ </copy>
+ </target>
<target name="clean">
<delete dir="${output}"></delete>
</target>
Modified: webservices/axis/trunk/java/modules/tool/maven.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/maven.xml?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/tool/maven.xml (original)
+++ webservices/axis/trunk/java/modules/tool/maven.xml Mon Jul 11 08:49:30 2005
@@ -9,17 +9,17 @@
xmlns:ant="jelly:ant">
<postGoal name="jar">
<!--<attainGoal name="jar-tool"/>-->
- </postGoal>
+ </postGoal>
<goal name="jar-tool">
- <!-- make the jar tool-->
- <mkdir dir="target/jar-tool"/>
- <mkdir dir="target/jar-tool"/>
- <copy todir="target/jar-tool">
- <fileset dir="target">
- <include name="axis2*.jar"/>
- </fileset>
- </copy>
- <copy file="${maven.repo.local}/ant/jars/ant-1.6.2.jar" todir="target/jar-tool"/>
+ <!-- make the jar tool-->
+ <mkdir dir="target/jar-tool"/>
+ <mkdir dir="target/jar-tool"/>
+ <copy todir="target/jar-tool">
+ <fileset dir="target">
+ <include name="axis2*.jar"/>
+ </fileset>
+ </copy>
+ <copy file="${maven.repo.local}/ant/jars/ant-1.6.2.jar" todir="target/jar-tool"/>
<copy file="src/script/jar-tool-UI.bat" todir="target/jar-tool"></copy>
- </goal>
- </project>
+ </goal>
+</project>
Modified: webservices/axis/trunk/java/modules/tool/project.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/project.xml?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/tool/project.xml (original)
+++ webservices/axis/trunk/java/modules/tool/project.xml Mon Jul 11 08:49:30 2005
@@ -17,28 +17,28 @@
*/
-->
<project>
- <pomVersion>3</pomVersion>
- <extend>../../etc/project.xml</extend>
- <id>axis2-tools</id>
- <name>tool</name>
- <description>Tools available for Axis 2.0.</description>
-
- <dependencies>
- <!-- external JARs -->
- <dependency>
- <groupId>ant</groupId>
- <artifactId>ant</artifactId>
- <version>1.6.2</version>
- <properties>
- <module>true</module>
- </properties>
- </dependency>
- <dependency>
+ <pomVersion>3</pomVersion>
+ <extend>../../etc/project.xml</extend>
+ <id>axis2-tools</id>
+ <name>tool</name>
+ <description>Tools available for Axis 2.0.</description>
+
+ <dependencies>
+ <!-- external JARs -->
+ <dependency>
+ <groupId>ant</groupId>
+ <artifactId>ant</artifactId>
+ <version>1.6.2</version>
+ <properties>
+ <module>true</module>
+ </properties>
+ </dependency>
+ <dependency>
<groupId>axis</groupId>
<artifactId>axis2-wsdl</artifactId>
<version>${pom.currentVersion}</version>
</dependency>
- <dependency>
+ <dependency>
<groupId>axis</groupId>
<artifactId>axis-wsdl4j</artifactId>
<version>1.2</version>
@@ -46,46 +46,46 @@
<module>true</module>
</properties>
</dependency>
- </dependencies>
-
- <build>
- <nagEmailAddress>axis-dev@ws.apache.org</nagEmailAddress>
- <sourceDirectory>src</sourceDirectory>
- <unitTestSourceDirectory>test</unitTestSourceDirectory>
-
- <sourceModifications>
- <sourceModification>
- <className>fakeClass</className>
- <excludes>
- <exclude>**/codegen/**/*.java</exclude>
- <exclude>**/core/**/*.java</exclude>
- <exclude>**/service/**/*.java</exclude>
- </excludes>
- </sourceModification>
- </sourceModifications>
-
- <unitTest>
- <includes>
- <include>**/*Test.java</include>
- </includes>
- </unitTest>
-
- <resources>
- <resource>
- <directory>conf</directory>
- <includes>
- <include>**/*.properties</include>
- </includes>
- </resource>
- <resource>
- <directory>src</directory>
- <includes>
- <include>**/*.properties</include>
- <include>**/*.xml</include>
- </includes>
- </resource>
+ </dependencies>
+
+ <build>
+ <nagEmailAddress>axis-dev@ws.apache.org</nagEmailAddress>
+ <sourceDirectory>src</sourceDirectory>
+ <unitTestSourceDirectory>test</unitTestSourceDirectory>
+
+ <sourceModifications>
+ <sourceModification>
+ <className>fakeClass</className>
+ <excludes>
+ <exclude>**/codegen/**/*.java</exclude>
+ <exclude>**/core/**/*.java</exclude>
+ <exclude>**/service/**/*.java</exclude>
+ </excludes>
+ </sourceModification>
+ </sourceModifications>
+
+ <unitTest>
+ <includes>
+ <include>**/*Test.java</include>
+ </includes>
+ </unitTest>
+
+ <resources>
+ <resource>
+ <directory>conf</directory>
+ <includes>
+ <include>**/*.properties</include>
+ </includes>
+ </resource>
+ <resource>
+ <directory>src</directory>
+ <includes>
+ <include>**/*.properties</include>
+ <include>**/*.xml</include>
+ </includes>
+ </resource>
</resources>
- </build>
- <reports/>
-
+ </build>
+ <reports/>
+
</project>
Modified: webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/ant/AntCodegenTask.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/ant/AntCodegenTask.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/ant/AntCodegenTask.java (original)
+++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/ant/AntCodegenTask.java Mon Jul 11 08:49:30 2005
@@ -1,21 +1,7 @@
package org.apache.axis2.tool.ant;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PrintStream;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.wsdl.WSDLException;
-
import org.apache.axis2.wsdl.WSDLVersionWrapper;
import org.apache.axis2.wsdl.builder.WOMBuilderFactory;
-import org.apache.axis2.wsdl.codegen.CodeGenConfiguration;
import org.apache.axis2.wsdl.codegen.CodeGenerationEngine;
import org.apache.axis2.wsdl.codegen.CommandLineOption;
import org.apache.axis2.wsdl.codegen.CommandLineOptionConstants;
@@ -25,6 +11,14 @@
import org.apache.tools.ant.Task;
import org.apache.wsdl.WSDLDescription;
+import javax.wsdl.WSDLException;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+
/*
* Copyright 2004,2005 The Apache Software Foundation.
*
@@ -42,18 +36,19 @@
*
*
*/
-public class AntCodegenTask extends Task{
- private String WSDLFileName=null;
- private String output=".";
- private String packageName=URLProcessor.DEFAULT_PACKAGE;
- private String language=CommandLineOptionConstants.LanguageNames.JAVA;
-
- private boolean asyncOnly=false;
- private boolean syncOnly=false;
- private boolean serverSide=false;
- private boolean testcase=false;
- private boolean generateServerXml=false;
+public class AntCodegenTask extends Task {
+
+ private String WSDLFileName = null;
+ private String output = ".";
+ private String packageName = URLProcessor.DEFAULT_PACKAGE;
+ private String language = CommandLineOptionConstants.LanguageNames.JAVA;
+
+ private boolean asyncOnly = false;
+ private boolean syncOnly = false;
+ private boolean serverSide = false;
+ private boolean testcase = false;
+ private boolean generateServerXml = false;
/**
*
@@ -62,68 +57,55 @@
Map optionMap = new HashMap();
optionMap.put(CommandLineOptionConstants.WSDL_LOCATION_URI_OPTION,
- new CommandLineOption(
- CommandLineOptionConstants.WSDL_LOCATION_URI_OPTION,
- getStringArray(WSDLFileName)));
+ new CommandLineOption(CommandLineOptionConstants.WSDL_LOCATION_URI_OPTION,
+ getStringArray(WSDLFileName)));
if (asyncOnly) {
optionMap
- .put(
- CommandLineOptionConstants.CODEGEN_ASYNC_ONLY_OPTION,
- new CommandLineOption(
- CommandLineOptionConstants.CODEGEN_ASYNC_ONLY_OPTION,
- new String[0]));
+ .put(CommandLineOptionConstants.CODEGEN_ASYNC_ONLY_OPTION,
+ new CommandLineOption(CommandLineOptionConstants.CODEGEN_ASYNC_ONLY_OPTION,
+ new String[0]));
}
if (syncOnly) {
optionMap
- .put(
- CommandLineOptionConstants.CODEGEN_SYNC_ONLY_OPTION,
- new CommandLineOption(
- CommandLineOptionConstants.CODEGEN_SYNC_ONLY_OPTION,
- new String[0]));
+ .put(CommandLineOptionConstants.CODEGEN_SYNC_ONLY_OPTION,
+ new CommandLineOption(CommandLineOptionConstants.CODEGEN_SYNC_ONLY_OPTION,
+ new String[0]));
}
optionMap.put(CommandLineOptionConstants.PACKAGE_OPTION,
- new CommandLineOption(
- CommandLineOptionConstants.PACKAGE_OPTION,
- getStringArray(packageName)));
+ new CommandLineOption(CommandLineOptionConstants.PACKAGE_OPTION,
+ getStringArray(packageName)));
optionMap.put(CommandLineOptionConstants.STUB_LANGUAGE_OPTION,
- new CommandLineOption(
- CommandLineOptionConstants.STUB_LANGUAGE_OPTION,
- getStringArray(language)));
+ new CommandLineOption(CommandLineOptionConstants.STUB_LANGUAGE_OPTION,
+ getStringArray(language)));
optionMap.put(CommandLineOptionConstants.OUTPUT_LOCATION_OPTION,
- new CommandLineOption(
- CommandLineOptionConstants.OUTPUT_LOCATION_OPTION,
- getStringArray(output)));
+ new CommandLineOption(CommandLineOptionConstants.OUTPUT_LOCATION_OPTION,
+ getStringArray(output)));
if (serverSide) {
optionMap.put(CommandLineOptionConstants.SERVER_SIDE_CODE_OPTION,
- new CommandLineOption(
- CommandLineOptionConstants.SERVER_SIDE_CODE_OPTION,
- new String[0]));
+ new CommandLineOption(CommandLineOptionConstants.SERVER_SIDE_CODE_OPTION,
+ new String[0]));
if (generateServerXml) {
- optionMap.put(
- CommandLineOptionConstants.GENERATE_SERVICE_DESCRIPTION_OPTION,
- new CommandLineOption(
- CommandLineOptionConstants.GENERATE_SERVICE_DESCRIPTION_OPTION,
- new String[0]));
+ optionMap.put(CommandLineOptionConstants.GENERATE_SERVICE_DESCRIPTION_OPTION,
+ new CommandLineOption(CommandLineOptionConstants.GENERATE_SERVICE_DESCRIPTION_OPTION,
+ new String[0]));
}
}
- if (testcase){
+ if (testcase) {
optionMap
- .put(
- CommandLineOptionConstants.GENERATE_TEST_CASE_OPTION,
- new CommandLineOption(
- CommandLineOptionConstants.GENERATE_TEST_CASE_OPTION,
- new String[0]));
+ .put(CommandLineOptionConstants.GENERATE_TEST_CASE_OPTION,
+ new CommandLineOption(CommandLineOptionConstants.GENERATE_TEST_CASE_OPTION,
+ new String[0]));
}
//System.out.println(page3.getOutputLocation());
return optionMap;
}
- private WSDLDescription getWOM(String wsdlLocation) throws WSDLException ,
+ private WSDLDescription getWOM(String wsdlLocation) throws WSDLException,
IOException {
InputStream in = new FileInputStream(new File(wsdlLocation));
- WSDLVersionWrapper wsdlvWrap = WOMBuilderFactory.getBuilder(WOMBuilderFactory.WSDL11).build(in);
+ WSDLVersionWrapper wsdlvWrap = WOMBuilderFactory.getBuilder(WOMBuilderFactory.WSDL11).build(in);
return wsdlvWrap.getDescription();
}
@@ -136,7 +118,7 @@
public void execute() throws BuildException {
try {
-
+
CommandLineOptionParser parser = new CommandLineOptionParser(this.fillOptionMap());
new CodeGenerationEngine(parser).generate();
} catch (Throwable e) {
@@ -180,8 +162,8 @@
public void setGenerateServerXml(boolean generateServerXml) {
this.generateServerXml = generateServerXml;
}
-
- public static void main(String[] args){
+
+ public static void main(String[] args) {
AntCodegenTask task = new AntCodegenTask();
task.setWSDLFileName("modules/samples/test-resources/wsdl/compound2.wsdl");
task.setOutput("temp");
Modified: webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/Java2WSDLGenerator.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/Java2WSDLGenerator.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/Java2WSDLGenerator.java (original)
+++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/Java2WSDLGenerator.java Mon Jul 11 08:49:30 2005
@@ -16,33 +16,32 @@
package org.apache.axis.tool.codegen;
-import java.util.Vector;
-
import org.apache.axis.utils.ClassUtils;
import org.apache.axis.wsdl.fromJava.Emitter;
+import java.util.Vector;
+
/**
* @author Ajith
- *
- * TODO To change the template for this generated type comment go to Window -
- * Preferences - Java - Code Style - Code Templates
+ * <p/>
+ * TODO To change the template for this generated type comment go to Window -
+ * Preferences - Java - Code Style - Code Templates
*/
public class Java2WSDLGenerator {
- public void emit(String classPath,
- String implementationClassName,
- String serviceLocationUrl,
- String inputWsdlName,
- String bindingName,
- String portypeName,
- String style,
- String outputFileName,
- int mode,
- Vector listOfIncludedMethods) throws Throwable{
+ public void emit(String classPath,
+ String implementationClassName,
+ String serviceLocationUrl,
+ String inputWsdlName,
+ String bindingName,
+ String portypeName,
+ String style,
+ String outputFileName,
+ int mode,
+ Vector listOfIncludedMethods) throws Throwable {
try {
- ClassUtils.setDefaultClassLoader(ClassUtils.createClassLoader(
- classPath, this.getClass().getClassLoader()));
+ ClassUtils.setDefaultClassLoader(ClassUtils.createClassLoader(classPath, this.getClass().getClassLoader()));
// Instantiate the emitter
Emitter emitter = new Emitter();
@@ -51,7 +50,7 @@
emitter.setCls(implementationClassName);
//service location
- if (serviceLocationUrl !=null && !serviceLocationUrl.trim().equals(""))
+ if (serviceLocationUrl != null && !serviceLocationUrl.trim().equals(""))
emitter.setLocationUrl(serviceLocationUrl);
//input wsdl
@@ -59,21 +58,21 @@
emitter.setInputWSDL(inputWsdlName);
//portype name
- if (portypeName!=null && !portypeName.trim().equals(""))
+ if (portypeName != null && !portypeName.trim().equals(""))
emitter.setPortTypeName(portypeName);
//Style
- if (style!=null && !style.trim().equals(""))
+ if (style != null && !style.trim().equals(""))
emitter.setStyle(style);
- if (listOfIncludedMethods!=null)
+ if (listOfIncludedMethods != null)
emitter.setAllowedMethods(listOfIncludedMethods);
-
- if (mode!= Emitter.MODE_ALL &&
- mode!= Emitter.MODE_IMPLEMENTATION &&
- mode!= Emitter.MODE_INTERFACE)
+
+ if (mode != Emitter.MODE_ALL &&
+ mode != Emitter.MODE_IMPLEMENTATION &&
+ mode != Emitter.MODE_INTERFACE)
mode = Emitter.MODE_ALL; // Default to all in unknown case
-
- emitter.emit(outputFileName,mode);
+
+ emitter.emit(outputFileName, mode);
} catch (Throwable t) {
throw t;
Modified: webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/WSDL2JavaGenerator.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/WSDL2JavaGenerator.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/WSDL2JavaGenerator.java (original)
+++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/WSDL2JavaGenerator.java Mon Jul 11 08:49:30 2005
@@ -15,6 +15,13 @@
*/
package org.apache.axis.tool.codegen;
+import org.apache.axis.tool.codegen.eclipse.util.UIConstants;
+import org.apache.axis.wsdl.builder.WOMBuilderFactory;
+import org.apache.axis.wsdl.codegen.CommandLineOption;
+import org.apache.axis.wsdl.codegen.CommandLineOptionConstants;
+import org.apache.wsdl.WSDLDescription;
+
+import javax.wsdl.WSDLException;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
@@ -22,42 +29,27 @@
import java.util.HashMap;
import java.util.Map;
-import javax.wsdl.WSDLException;
-
-import org.apache.axis.tool.codegen.eclipse.util.UIConstants;
-import org.apache.axis.wsdl.builder.WOMBuilderFactory;
-import org.apache.axis.wsdl.codegen.CommandLineOption;
-import org.apache.axis.wsdl.codegen.CommandLineOptionConstants;
-import org.apache.wsdl.WSDLDescription;
-
public class WSDL2JavaGenerator {
-
+
/**
* Maps a string containing the name of a language to a constant defined in CommandLineOptionConstants.LanguageNames
*
* @param UILangValue a string containg a language, e.g. "java", "cs", "cpp" or "vb"
* @return a normalized string constant
*/
- private String mapLanguagesWithCombo(String UILangValue)
- {
- if (UIConstants.JAVA.equals(UILangValue))
- {
- return CommandLineOptionConstants.LanguageNames.JAVA;
- }
- else if (UIConstants.C_SHARP.equals(UILangValue))
- {
- return CommandLineOptionConstants.LanguageNames.C_SHARP;
- }
- else if (UIConstants.C_PLUS_PLUS.equals(UILangValue))
- {
- return CommandLineOptionConstants.LanguageNames.C_PLUS_PLUS;
- }
- else
- {
- return null;
- }
+ private String mapLanguagesWithCombo(String UILangValue) {
+ if (UIConstants.JAVA.equals(UILangValue)) {
+ return CommandLineOptionConstants.LanguageNames.JAVA;
+ } else if (UIConstants.C_SHARP.equals(UILangValue)) {
+ return CommandLineOptionConstants.LanguageNames.C_SHARP;
+ } else if (UIConstants.C_PLUS_PLUS.equals(UILangValue)) {
+ return CommandLineOptionConstants.LanguageNames.C_PLUS_PLUS;
+ } else {
+ return null;
+ }
}
+
/**
* Creates a list of parameters for the code generator based on the decisions made by the user on the OptionsPage
* (page2). For each setting, there is a Command-Line option for the Axis2 code generator.
@@ -65,76 +57,60 @@
* @return a Map with keys from CommandLineOptionConstants with the values entered by the user on the Options Page.
*/
public Map fillOptionMap(boolean isAyncOnly,
- boolean isSyncOnly,
- boolean isServerSide,
- boolean isServerXML,
- boolean isTestCase,
- String WSDLFileName,
- String packageName,
- String selectedLanguage,
- String outputLocation
- )
- {
- Map optionMap = new HashMap();
- //WSDL file name
- optionMap.put(CommandLineOptionConstants.WSDL_LOCATION_URI_OPTION, new CommandLineOption(
- CommandLineOptionConstants.WSDL_LOCATION_URI_OPTION, getStringArray(WSDLFileName)));
-
- //Async only
- if (isAyncOnly)
- {
- optionMap.put(CommandLineOptionConstants.CODEGEN_ASYNC_ONLY_OPTION, new CommandLineOption(
- CommandLineOptionConstants.CODEGEN_ASYNC_ONLY_OPTION, new String[0]));
- }
- //sync only
- if (isSyncOnly)
- {
- optionMap.put(CommandLineOptionConstants.CODEGEN_SYNC_ONLY_OPTION, new CommandLineOption(
- CommandLineOptionConstants.CODEGEN_SYNC_ONLY_OPTION, new String[0]));
- }
- //serverside
- if (isServerSide)
- {
- optionMap.put(CommandLineOptionConstants.SERVER_SIDE_CODE_OPTION, new CommandLineOption(
- CommandLineOptionConstants.SERVER_SIDE_CODE_OPTION, new String[0]));
- //server xml
- if (isServerXML)
- {
- optionMap.put(CommandLineOptionConstants.GENERATE_SERVICE_DESCRIPTION_OPTION, new CommandLineOption(
- CommandLineOptionConstants.GENERATE_SERVICE_DESCRIPTION_OPTION, new String[0]));
- }
- }
- //test case
- if (isTestCase)
- {
- optionMap.put(CommandLineOptionConstants.GENERATE_TEST_CASE_OPTION, new CommandLineOption(
- CommandLineOptionConstants.GENERATE_TEST_CASE_OPTION, new String[0]));
- }
- //package name
- optionMap.put(CommandLineOptionConstants.PACKAGE_OPTION, new CommandLineOption(
- CommandLineOptionConstants.PACKAGE_OPTION, getStringArray(packageName)));
- //selected language
- optionMap.put(CommandLineOptionConstants.STUB_LANGUAGE_OPTION, new CommandLineOption(
- CommandLineOptionConstants.STUB_LANGUAGE_OPTION, getStringArray(mapLanguagesWithCombo(selectedLanguage))));
- //output location
- optionMap.put(CommandLineOptionConstants.OUTPUT_LOCATION_OPTION, new CommandLineOption(
- CommandLineOptionConstants.OUTPUT_LOCATION_OPTION, getStringArray(outputLocation)));
-
- // System.out.println(page3.getOutputLocation());
- return optionMap;
+ boolean isSyncOnly,
+ boolean isServerSide,
+ boolean isServerXML,
+ boolean isTestCase,
+ String WSDLFileName,
+ String packageName,
+ String selectedLanguage,
+ String outputLocation) {
+ Map optionMap = new HashMap();
+ //WSDL file name
+ optionMap.put(CommandLineOptionConstants.WSDL_LOCATION_URI_OPTION, new CommandLineOption(CommandLineOptionConstants.WSDL_LOCATION_URI_OPTION, getStringArray(WSDLFileName)));
+
+ //Async only
+ if (isAyncOnly) {
+ optionMap.put(CommandLineOptionConstants.CODEGEN_ASYNC_ONLY_OPTION, new CommandLineOption(CommandLineOptionConstants.CODEGEN_ASYNC_ONLY_OPTION, new String[0]));
+ }
+ //sync only
+ if (isSyncOnly) {
+ optionMap.put(CommandLineOptionConstants.CODEGEN_SYNC_ONLY_OPTION, new CommandLineOption(CommandLineOptionConstants.CODEGEN_SYNC_ONLY_OPTION, new String[0]));
+ }
+ //serverside
+ if (isServerSide) {
+ optionMap.put(CommandLineOptionConstants.SERVER_SIDE_CODE_OPTION, new CommandLineOption(CommandLineOptionConstants.SERVER_SIDE_CODE_OPTION, new String[0]));
+ //server xml
+ if (isServerXML) {
+ optionMap.put(CommandLineOptionConstants.GENERATE_SERVICE_DESCRIPTION_OPTION, new CommandLineOption(CommandLineOptionConstants.GENERATE_SERVICE_DESCRIPTION_OPTION, new String[0]));
+ }
+ }
+ //test case
+ if (isTestCase) {
+ optionMap.put(CommandLineOptionConstants.GENERATE_TEST_CASE_OPTION, new CommandLineOption(CommandLineOptionConstants.GENERATE_TEST_CASE_OPTION, new String[0]));
+ }
+ //package name
+ optionMap.put(CommandLineOptionConstants.PACKAGE_OPTION, new CommandLineOption(CommandLineOptionConstants.PACKAGE_OPTION, getStringArray(packageName)));
+ //selected language
+ optionMap.put(CommandLineOptionConstants.STUB_LANGUAGE_OPTION, new CommandLineOption(CommandLineOptionConstants.STUB_LANGUAGE_OPTION, getStringArray(mapLanguagesWithCombo(selectedLanguage))));
+ //output location
+ optionMap.put(CommandLineOptionConstants.OUTPUT_LOCATION_OPTION, new CommandLineOption(CommandLineOptionConstants.OUTPUT_LOCATION_OPTION, getStringArray(outputLocation)));
+
+ // System.out.println(page3.getOutputLocation());
+ return optionMap;
}
+
/**
* Reads the WSDL Object Model from the given location.
- *
+ *
* @param wsdlLocation the filesystem location (full path) of the WSDL file to read in.
* @return the WSDLDescription object containing the WSDL Object Model of the given WSDL file
* @throws WSDLException when WSDL File is invalid
- * @throws IOException on errors reading the WSDL file
+ * @throws IOException on errors reading the WSDL file
*/
- public WSDLDescription getWOM(String wsdlLocation) throws WSDLException, IOException
- {
- InputStream in = new FileInputStream(new File(wsdlLocation));
- return WOMBuilderFactory.getBuilder(WOMBuilderFactory.WSDL11).build(in);
+ public WSDLDescription getWOM(String wsdlLocation) throws WSDLException, IOException {
+ InputStream in = new FileInputStream(new File(wsdlLocation));
+ return WOMBuilderFactory.getBuilder(WOMBuilderFactory.WSDL11).build(in);
}
/**
@@ -143,10 +119,9 @@
* @param value a single string
* @return an array containing only one element
*/
- private String[] getStringArray(String value)
- {
- String[] values = new String[1];
- values[0] = value;
- return values;
+ private String[] getStringArray(String value) {
+ String[] values = new String[1];
+ values[0] = value;
+ return values;
}
}
Modified: webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/CodeGenWizard.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/CodeGenWizard.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/CodeGenWizard.java (original)
+++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/CodeGenWizard.java Mon Jul 11 08:49:30 2005
@@ -1,20 +1,9 @@
-
package org.apache.axis.tool.codegen.eclipse;
-import java.lang.reflect.InvocationTargetException;
-import java.util.Map;
-
import org.apache.axis.tool.codegen.Java2WSDLGenerator;
import org.apache.axis.tool.codegen.WSDL2JavaGenerator;
import org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin;
-import org.apache.axis.tool.codegen.eclipse.ui.AbstractWizardPage;
-import org.apache.axis.tool.codegen.eclipse.ui.JavaSourceSelectionPage;
-import org.apache.axis.tool.codegen.eclipse.ui.JavaWSDLOptionsPage;
-import org.apache.axis.tool.codegen.eclipse.ui.JavaWSDLOutputLocationPage;
-import org.apache.axis.tool.codegen.eclipse.ui.OptionsPage;
-import org.apache.axis.tool.codegen.eclipse.ui.OutputPage;
-import org.apache.axis.tool.codegen.eclipse.ui.ToolSelectionPage;
-import org.apache.axis.tool.codegen.eclipse.ui.WSDLFileSelectionPage;
+import org.apache.axis.tool.codegen.eclipse.ui.*;
import org.apache.axis.tool.codegen.eclipse.util.SettingsConstants;
import org.apache.axis.wsdl.codegen.CodeGenConfiguration;
import org.apache.axis.wsdl.codegen.CodeGenerationEngine;
@@ -31,284 +20,255 @@
import org.eclipse.ui.IWorkbenchWizard;
import org.eclipse.ui.actions.WorkspaceModifyOperation;
+import java.lang.reflect.InvocationTargetException;
+import java.util.Map;
+
/**
* The main wizard for the codegen wizard
*/
-public class CodeGenWizard extends Wizard implements INewWizard
-{
- private ToolSelectionPage toolSelectionPage;
- private WSDLFileSelectionPage wsdlSelectionPage;
- private OptionsPage optionsPage;
- private OutputPage outputPage;
- private JavaWSDLOptionsPage java2wsdlOptionsPage;
- private JavaSourceSelectionPage javaSourceSelectionPage;
- private JavaWSDLOutputLocationPage java2wsdlOutputLocationPage;
-
- private int selectedWizardType=SettingsConstants.WSDL_2_JAVA_TYPE;//TODO change this
- private ISelection selection;
- private boolean canFinish = false;
-
- /**
- * Constructor for CodeGenWizard.
- */
- public CodeGenWizard()
- {
- super();
- setNeedsProgressMonitor(true);
- this.setWindowTitle(org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin
- .getResourceString("general.name"));
- }
-
- /**
- * Adding the page to the wizard.
- */
-
- public void addPages()
- {
- toolSelectionPage = new ToolSelectionPage();
- addPage(toolSelectionPage);
-
- //add the wsdl2java wizard pages
- wsdlSelectionPage = new WSDLFileSelectionPage();
- addPage(wsdlSelectionPage);
- optionsPage = new OptionsPage();
- addPage(optionsPage);
- outputPage = new OutputPage();
- addPage(outputPage);
-
- //add java2wsdl wizard pages
- javaSourceSelectionPage = new JavaSourceSelectionPage();
- addPage(javaSourceSelectionPage);
- java2wsdlOptionsPage = new JavaWSDLOptionsPage();
- addPage(java2wsdlOptionsPage);
- java2wsdlOutputLocationPage = new JavaWSDLOutputLocationPage();
- addPage(java2wsdlOutputLocationPage);
-
+public class CodeGenWizard extends Wizard implements INewWizard {
+ private ToolSelectionPage toolSelectionPage;
+ private WSDLFileSelectionPage wsdlSelectionPage;
+ private OptionsPage optionsPage;
+ private OutputPage outputPage;
+ private JavaWSDLOptionsPage java2wsdlOptionsPage;
+ private JavaSourceSelectionPage javaSourceSelectionPage;
+ private JavaWSDLOutputLocationPage java2wsdlOutputLocationPage;
+
+ private int selectedWizardType = SettingsConstants.WSDL_2_JAVA_TYPE;//TODO change this
+ private ISelection selection;
+ private boolean canFinish = false;
-
+ /**
+ * Constructor for CodeGenWizard.
+ */
+ public CodeGenWizard() {
+ super();
+ setNeedsProgressMonitor(true);
+ this.setWindowTitle(org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin
+ .getResourceString("general.name"));
+ }
+
+ /**
+ * Adding the page to the wizard.
+ */
+
+ public void addPages() {
+ toolSelectionPage = new ToolSelectionPage();
+ addPage(toolSelectionPage);
+
+ //add the wsdl2java wizard pages
+ wsdlSelectionPage = new WSDLFileSelectionPage();
+ addPage(wsdlSelectionPage);
+ optionsPage = new OptionsPage();
+ addPage(optionsPage);
+ outputPage = new OutputPage();
+ addPage(outputPage);
+
+ //add java2wsdl wizard pages
+ javaSourceSelectionPage = new JavaSourceSelectionPage();
+ addPage(javaSourceSelectionPage);
+ java2wsdlOptionsPage = new JavaWSDLOptionsPage();
+ addPage(java2wsdlOptionsPage);
+ java2wsdlOutputLocationPage = new JavaWSDLOutputLocationPage();
+ addPage(java2wsdlOutputLocationPage);
+
+
+ }
- }
-
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.IWizard#canFinish()
*/
public boolean canFinish() {
- IWizardPage[] pages = getPages();
- AbstractWizardPage wizardPage = null;
- for (int i = 0; i < pages.length; i++) {
- wizardPage = (AbstractWizardPage)pages[i];
- if (wizardPage.getPageType()==this.selectedWizardType){
- if (!(wizardPage.isPageComplete()))
- return false;
- }
- }
- return true;
- }
- public IWizardPage getNextPage(IWizardPage page) {
- AbstractWizardPage currentPage=(AbstractWizardPage)page;
- AbstractWizardPage pageout = (AbstractWizardPage)super.getNextPage(page);
-
- while (pageout!=null && selectedWizardType!=pageout.getPageType()){
- AbstractWizardPage temp = pageout;
- pageout = (AbstractWizardPage)super.getNextPage(currentPage);
- currentPage = temp;
-
- }
- return pageout;
+ IWizardPage[] pages = getPages();
+ AbstractWizardPage wizardPage = null;
+ for (int i = 0; i < pages.length; i++) {
+ wizardPage = (AbstractWizardPage) pages[i];
+ if (wizardPage.getPageType() == this.selectedWizardType) {
+ if (!(wizardPage.isPageComplete()))
+ return false;
+ }
+ }
+ return true;
}
-
- /**
- * This method is called when 'Finish' button is pressed in the wizard. We will create an operation and run it using
- * wizard as execution context.
- */
- public boolean performFinish()
- {
- try
- {
- switch (selectedWizardType){
- case SettingsConstants.WSDL_2_JAVA_TYPE:doFinishWSDL2Java();break;
- case SettingsConstants.JAVA_2_WSDL_TYPE:doFinishJava2WSDL();break;
- case SettingsConstants.UNSPECIFIED_TYPE:break; //Do nothing
- default:throw new RuntimeException("Invalid state!");
+
+ public IWizardPage getNextPage(IWizardPage page) {
+ AbstractWizardPage currentPage = (AbstractWizardPage) page;
+ AbstractWizardPage pageout = (AbstractWizardPage) super.getNextPage(page);
+
+ while (pageout != null && selectedWizardType != pageout.getPageType()) {
+ AbstractWizardPage temp = pageout;
+ pageout = (AbstractWizardPage) super.getNextPage(currentPage);
+ currentPage = temp;
+
}
- }
- catch (Exception e)
- {
- MessageDialog.openError(getShell(), CodegenWizardPlugin.getResourceString("general.Error"), e.getMessage());
- return false;
- }
- MessageDialog.openInformation(this.getShell(), CodegenWizardPlugin.getResourceString("general.name"),
- CodegenWizardPlugin.getResourceString("wizard.success"));
- return true;
- }
-
- /**
- * The worker method, generates the code itself.
- */
- private void doFinishWSDL2Java()
- {
-
- WorkspaceModifyOperation op = new WorkspaceModifyOperation()
- {
- protected void execute(IProgressMonitor monitor)
- {
- if (monitor == null)
- monitor = new NullProgressMonitor();
-
- /*
- * "3" is the total amount of steps, see below monitor.worked(amount)
- */
- monitor.beginTask(CodegenWizardPlugin.getResourceString("generator.generating"), 3);
-
- try
- {
- /*
- * TODO: Introduce a progress monitor interface for CodeGenerationEngine.
- * Since this monitor here doesn't make much sense, we
- * should either remove the progress monitor from the CodeGenWizard,
- * or give a (custom) progress monitor to the generate() method, so
- * we will be informed by Axis2 about the progress of code generation.
- */
- WSDL2JavaGenerator generator = new WSDL2JavaGenerator();
- monitor.subTask(CodegenWizardPlugin.getResourceString("generator.readingWOM"));
- WSDLDescription wom = generator.getWOM(wsdlSelectionPage.getFileName());
- monitor.worked(1);
-
- Map optionsMap = generator.fillOptionMap(optionsPage.isAsyncOnlyOn(),
- optionsPage.isSyncOnlyOn(),
- optionsPage.isServerside(),
- optionsPage.isServerXML(),
- optionsPage.isGenerateTestCase(),
- wsdlSelectionPage.getFileName(),
- optionsPage.getPackageName(),
- optionsPage.getSelectedLanguage(),
- outputPage.getOutputLocation());
- CodeGenConfiguration codegenConfig = new CodeGenConfiguration(wom, optionsMap);
- monitor.worked(1);
-
- monitor.subTask(CodegenWizardPlugin.getResourceString("generator.generating"));
- new CodeGenerationEngine(codegenConfig).generate();
- monitor.worked(1);
+ return pageout;
+ }
+
+ /**
+ * This method is called when 'Finish' button is pressed in the wizard. We will create an operation and run it using
+ * wizard as execution context.
+ */
+ public boolean performFinish() {
+ try {
+ switch (selectedWizardType) {
+ case SettingsConstants.WSDL_2_JAVA_TYPE:
+ doFinishWSDL2Java();
+ break;
+ case SettingsConstants.JAVA_2_WSDL_TYPE:
+ doFinishJava2WSDL();
+ break;
+ case SettingsConstants.UNSPECIFIED_TYPE:
+ break; //Do nothing
+ default:
+ throw new RuntimeException("Invalid state!");
}
- catch (Exception e)
- {
- throw new RuntimeException(e);
+ } catch (Exception e) {
+ MessageDialog.openError(getShell(), CodegenWizardPlugin.getResourceString("general.Error"), e.getMessage());
+ return false;
+ }
+ MessageDialog.openInformation(this.getShell(), CodegenWizardPlugin.getResourceString("general.name"),
+ CodegenWizardPlugin.getResourceString("wizard.success"));
+ return true;
+ }
+
+ /**
+ * The worker method, generates the code itself.
+ */
+ private void doFinishWSDL2Java() {
+
+ WorkspaceModifyOperation op = new WorkspaceModifyOperation() {
+ protected void execute(IProgressMonitor monitor) {
+ if (monitor == null)
+ monitor = new NullProgressMonitor();
+
+ /*
+ * "3" is the total amount of steps, see below monitor.worked(amount)
+ */
+ monitor.beginTask(CodegenWizardPlugin.getResourceString("generator.generating"), 3);
+
+ try {
+ /*
+ * TODO: Introduce a progress monitor interface for CodeGenerationEngine.
+ * Since this monitor here doesn't make much sense, we
+ * should either remove the progress monitor from the CodeGenWizard,
+ * or give a (custom) progress monitor to the generate() method, so
+ * we will be informed by Axis2 about the progress of code generation.
+ */
+ WSDL2JavaGenerator generator = new WSDL2JavaGenerator();
+ monitor.subTask(CodegenWizardPlugin.getResourceString("generator.readingWOM"));
+ WSDLDescription wom = generator.getWOM(wsdlSelectionPage.getFileName());
+ monitor.worked(1);
+
+ Map optionsMap = generator.fillOptionMap(optionsPage.isAsyncOnlyOn(),
+ optionsPage.isSyncOnlyOn(),
+ optionsPage.isServerside(),
+ optionsPage.isServerXML(),
+ optionsPage.isGenerateTestCase(),
+ wsdlSelectionPage.getFileName(),
+ optionsPage.getPackageName(),
+ optionsPage.getSelectedLanguage(),
+ outputPage.getOutputLocation());
+ CodeGenConfiguration codegenConfig = new CodeGenConfiguration(wom, optionsMap);
+ monitor.worked(1);
+
+ monitor.subTask(CodegenWizardPlugin.getResourceString("generator.generating"));
+ new CodeGenerationEngine(codegenConfig).generate();
+ monitor.worked(1);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+
+ monitor.done();
}
+ };
+
+
+ /*
+ * Start the generation as new Workbench Operation, so the user
+ * can see the progress and, if needed, can stop the operation.
+ */
+ try {
+ getContainer().run(false, true, op);
+ } catch (InvocationTargetException e1) {
+ throw new RuntimeException(e1);
+ } catch (InterruptedException e1) {
+ throw new RuntimeException("User Aborted!");
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
- monitor.done();
- }
- };
-
-
- /*
- * Start the generation as new Workbench Operation, so the user
- * can see the progress and, if needed, can stop the operation.
- */
- try
- {
- getContainer().run(false, true, op);
- }
- catch (InvocationTargetException e1)
- {
- throw new RuntimeException(e1);
- }
- catch (InterruptedException e1)
- {
- throw new RuntimeException("User Aborted!");
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
- }
-
- private void doFinishJava2WSDL() throws Exception{
-
- WorkspaceModifyOperation op = new WorkspaceModifyOperation()
- {
- protected void execute(IProgressMonitor monitor)
- {
- if (monitor == null)
+ private void doFinishJava2WSDL() throws Exception {
+
+ WorkspaceModifyOperation op = new WorkspaceModifyOperation() {
+ protected void execute(IProgressMonitor monitor) {
+ if (monitor == null)
monitor = new NullProgressMonitor();
- /*
- * "2" is the total amount of steps, see below monitor.worked(amount)
- */
- monitor.beginTask(CodegenWizardPlugin.getResourceString("generator.generating"), 2);
-
- try
- {
- monitor.worked(1);
-
- new Java2WSDLGenerator().emit(
- javaSourceSelectionPage.getClassLocation(),
- javaSourceSelectionPage.getClassName(),
- java2wsdlOptionsPage.getLocationURL(),
- java2wsdlOptionsPage.getInputWSDLName(),
- java2wsdlOptionsPage.getBindingName(),
- java2wsdlOptionsPage.getPortypeName(),
- java2wsdlOptionsPage.getStyle(),
- java2wsdlOutputLocationPage.getFullFileName(),
- java2wsdlOptionsPage.getMode(),
- javaSourceSelectionPage.getSelectedMethods()
- );
- monitor.worked(1);
- }
- catch (Throwable e)
- {
+ /*
+ * "2" is the total amount of steps, see below monitor.worked(amount)
+ */
+ monitor.beginTask(CodegenWizardPlugin.getResourceString("generator.generating"), 2);
+
+ try {
+ monitor.worked(1);
+
+ new Java2WSDLGenerator().emit(javaSourceSelectionPage.getClassLocation(),
+ javaSourceSelectionPage.getClassName(),
+ java2wsdlOptionsPage.getLocationURL(),
+ java2wsdlOptionsPage.getInputWSDLName(),
+ java2wsdlOptionsPage.getBindingName(),
+ java2wsdlOptionsPage.getPortypeName(),
+ java2wsdlOptionsPage.getStyle(),
+ java2wsdlOutputLocationPage.getFullFileName(),
+ java2wsdlOptionsPage.getMode(),
+ javaSourceSelectionPage.getSelectedMethods());
+ monitor.worked(1);
+ } catch (Throwable e) {
throw new RuntimeException(e);
- }
+ }
- monitor.done();
- }
- };
-
- try
- {
- getContainer().run(false, true, op);
- }
- catch (InvocationTargetException e1)
- {
- throw new RuntimeException(e1);
- }
- catch (InterruptedException e1)
- {
- throw new RuntimeException("User Aborted!");
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
-
- }
-
-
-
- /**
- * We will accept the selection in the workbench to see if we can initialize from it.
- *
- * @see IWorkbenchWizard#init(IWorkbench, IStructuredSelection)
- */
- public void init(IWorkbench workbench, IStructuredSelection selection)
- {
- this.selection = selection;
- }
-
-
-
-
-/**
- * @return Returns the selectedWizardType.
- */
-public int getSelectedWizardType() {
- return selectedWizardType;
-}
-/**
- * @param selectedWizardType The selectedWizardType to set.
- */
-public void setSelectedWizardType(int selectedWizardType) {
- this.selectedWizardType = selectedWizardType;
-}
+ monitor.done();
+ }
+ };
+
+ try {
+ getContainer().run(false, true, op);
+ } catch (InvocationTargetException e1) {
+ throw new RuntimeException(e1);
+ } catch (InterruptedException e1) {
+ throw new RuntimeException("User Aborted!");
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+
+ }
+
+
+ /**
+ * We will accept the selection in the workbench to see if we can initialize from it.
+ *
+ * @see IWorkbenchWizard#init(IWorkbench, IStructuredSelection)
+ */
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ this.selection = selection;
+ }
+
+
+ /**
+ * @return Returns the selectedWizardType.
+ */
+ public int getSelectedWizardType() {
+ return selectedWizardType;
+ }
+
+ /**
+ * @param selectedWizardType The selectedWizardType to set.
+ */
+ public void setSelectedWizardType(int selectedWizardType) {
+ this.selectedWizardType = selectedWizardType;
+ }
}
Modified: webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/plugin/CodegenWizardPlugin.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/plugin/CodegenWizardPlugin.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/plugin/CodegenWizardPlugin.java (original)
+++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis2/tool/codegen/eclipse/plugin/CodegenWizardPlugin.java Mon Jul 11 08:49:30 2005
@@ -1,81 +1,81 @@
package org.apache.axis.tool.codegen.eclipse.plugin;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
/**
* The main plugin class to be used in the desktop.
*/
public class CodegenWizardPlugin extends AbstractUIPlugin {
- //The shared instance.
- private static CodegenWizardPlugin plugin;
- //Resource bundle.
- private ResourceBundle resourceBundle;
- private static ImageDescriptor wizardImageDescriptor;
-
- /**
- * The constructor.
- */
- public CodegenWizardPlugin() {
- super();
- plugin = this;
- try {
- resourceBundle = ResourceBundle.getBundle("org.apache.axis.tool.codegen.resource.Codegen");
- } catch (MissingResourceException x) {
- resourceBundle = null;
- }
- }
-
- /**
- * This method is called upon plug-in activation
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- }
-
- /**
- * This method is called when the plug-in is stopped
- */
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- }
-
- /**
- * Returns the shared instance.
- */
- public static CodegenWizardPlugin getDefault() {
- return plugin;
- }
-
- /**
- * Returns the string from the plugin's resource bundle,
- * or 'key' if not found.
- */
- public static String getResourceString(String key) {
- ResourceBundle bundle = CodegenWizardPlugin.getDefault().getResourceBundle();
- try {
- return (bundle != null) ? bundle.getString(key) : key;
- } catch (MissingResourceException e) {
- return key;
- }
- }
-
- /**
- * Returns the plugin's resource bundle,
- */
- public ResourceBundle getResourceBundle() {
- return resourceBundle;
- }
-
- public static ImageDescriptor getWizardImageDescriptor(){
- if (wizardImageDescriptor==null){
- wizardImageDescriptor =CodegenWizardPlugin.imageDescriptorFromPlugin("Axis2_Codegen_Wizard","icons/asf-feather.gif");
- }
- return wizardImageDescriptor;
- }
-
+ //The shared instance.
+ private static CodegenWizardPlugin plugin;
+ //Resource bundle.
+ private ResourceBundle resourceBundle;
+ private static ImageDescriptor wizardImageDescriptor;
+
+ /**
+ * The constructor.
+ */
+ public CodegenWizardPlugin() {
+ super();
+ plugin = this;
+ try {
+ resourceBundle = ResourceBundle.getBundle("org.apache.axis.tool.codegen.resource.Codegen");
+ } catch (MissingResourceException x) {
+ resourceBundle = null;
+ }
+ }
+
+ /**
+ * This method is called upon plug-in activation
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ }
+
+ /**
+ * This method is called when the plug-in is stopped
+ */
+ public void stop(BundleContext context) throws Exception {
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance.
+ */
+ public static CodegenWizardPlugin getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns the string from the plugin's resource bundle,
+ * or 'key' if not found.
+ */
+ public static String getResourceString(String key) {
+ ResourceBundle bundle = CodegenWizardPlugin.getDefault().getResourceBundle();
+ try {
+ return (bundle != null) ? bundle.getString(key) : key;
+ } catch (MissingResourceException e) {
+ return key;
+ }
+ }
+
+ /**
+ * Returns the plugin's resource bundle,
+ */
+ public ResourceBundle getResourceBundle() {
+ return resourceBundle;
+ }
+
+ public static ImageDescriptor getWizardImageDescriptor() {
+ if (wizardImageDescriptor == null) {
+ wizardImageDescriptor = CodegenWizardPlugin.imageDescriptorFromPlugin("Axis2_Codegen_Wizard", "icons/asf-feather.gif");
+ }
+ return wizardImageDescriptor;
+ }
+
}