Author: ajith
Date: Wed May 3 04:33:24 2006
New Revision: 399267
URL: http://svn.apache.org/viewcvs?rev=399267&view=rev
Log:
1. A compromise for the issue 655. Now there is an option -ssi to indicate
whether to generate an interface for the client side or not. If this is omitted
then it will be just the normal style with concrete skeleton.
2. Fixed a minor issue in ADBBeanTemplate.xsl
Modified:
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/WSDL2Code.java
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodegenConfigLoader.java
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/i18n/resource.properties
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonTemplate.xsl
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/util/CommandLineOptionConstants.java
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/util/WSDL2JavaOptionsValidator.java
webservices/axis2/trunk/java/modules/integration/test/samples/wsdl/perf/PerfPortTypeSkeleton.java
webservices/axis2/trunk/java/modules/integration/test/samples/wsdl/perf2/PerfPortTypeSkeleton.java
webservices/axis2/trunk/java/modules/security/interop/org/apache/axis2/oasis/ping/PingPortSkeleton.java
Modified:
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl
URL:
http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl?rev=399267&r1=399266&r2=399267&view=diff
==============================================================================
---
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl
(original)
+++
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl
Wed May 3 04:33:24 2006
@@ -473,6 +473,7 @@
*/
public static <xsl:value-of select="$name"/>
parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{
<xsl:value-of select="$name"/> object = new <xsl:value-of
select="$name"/>();
+ int event;
try {
<!-- Advance to our start element, or if we are a complex
type, to our first property start element or the outer end element if no
properties -->
while (!reader.isStartElement() &&
!reader.isEndElement())
Modified:
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/WSDL2Code.java
URL:
http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/WSDL2Code.java?rev=399267&r1=399266&r2=399267&view=diff
==============================================================================
---
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/WSDL2Code.java
(original)
+++
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/WSDL2Code.java
Wed May 3 04:33:24 2006
@@ -51,6 +51,7 @@
System.out.println(CodegenMessages.getMessage("wsdl2code.arg14"));
System.out.println(CodegenMessages.getMessage("wsdl2code.arg15"));
System.out.println(CodegenMessages.getMessage("wsdl2code.arg16"));
+ System.out.println(CodegenMessages.getMessage("wsdl2code.arg17"));
System.exit(0);
}
Modified:
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java
URL:
http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java?rev=399267&r1=399266&r2=399267&view=diff
==============================================================================
---
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java
(original)
+++
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java
Wed May 3 04:33:24 2006
@@ -140,6 +140,18 @@
//user selected servicename
private String serviceName;
+ //option to generate server side interface or not
+ private boolean serverSideInterface = false;
+
+
+ public boolean isServerSideInterface() {
+ return serverSideInterface;
+ }
+
+ public void setServerSideInterface(boolean serverSideInterface) {
+ this.serverSideInterface = serverSideInterface;
+ }
+
public String getPortName() {
return portName;
Modified:
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodegenConfigLoader.java
URL:
http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodegenConfigLoader.java?rev=399267&r1=399266&r2=399267&view=diff
==============================================================================
---
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodegenConfigLoader.java
(original)
+++
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodegenConfigLoader.java
Wed May 3 04:33:24 2006
@@ -97,6 +97,11 @@
CommandLineOption repositoryPathOption =
loadOption(WSDL2JavaConstants.REPOSITORY_PATH_OPTION,
WSDL2JavaConstants.REPOSITORY_PATH_OPTION_LONG, optionMap);
config.setRepositoryPath(repositoryPathOption != null ?
repositoryPathOption.getOptionValue() : null);
+ CommandLineOption serverSideInterfaceOption =
loadOption(WSDL2JavaConstants.REPOSITORY_PATH_OPTION,
WSDL2JavaConstants.REPOSITORY_PATH_OPTION_LONG, optionMap);
+ if (serverSideInterfaceOption != null){
+ config.setServerSideInterface(true);
+ }
+
CommandLineOption generateAllOption =
loadOption(WSDL2JavaConstants.GENERATE_ALL_OPTION,
WSDL2JavaConstants.GENERATE_ALL_OPTION_LONG, optionMap);
if (generateAllOption != null) {
config.setGenerateAll(true);
Modified:
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
URL:
http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java?rev=399267&r1=399266&r2=399267&view=diff
==============================================================================
---
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
(original)
+++
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
Wed May 3 04:33:24 2006
@@ -682,9 +682,10 @@
generateAndPopulateFaultNames();
updateFaultPackageForSkeleton();
- //write skeletonInterface
- writeSkeletonInterface();
-
+ if (codeGenConfiguration.isServerSideInterface()){
+ //write skeletonInterface
+ writeSkeletonInterface();
+ }
// write skeleton
writeSkeleton();
@@ -792,7 +793,9 @@
Iterator it = MEPtoClassMap.keySet().iterator();
while (it.hasNext()) {
String mep = (String) it.next();
- Document classModel = createDocumentForMessageReceiver(mep);
+ Document classModel = createDocumentForMessageReceiver(
+ mep,
+ codeGenConfiguration.isServerSideInterface());
debugLogDocument("Document for message receiver:", classModel);
//write the class only if any methods are found
if (Boolean.TRUE.equals(infoHolder.get(mep))) {
@@ -806,7 +809,7 @@
}
}
- protected Document createDocumentForMessageReceiver(String mep) {
+ protected Document createDocumentForMessageReceiver(String mep,boolean
isServerSideInterface) {
Document doc = getEmptyDocument();
Element rootElement = doc.createElement("interface");
@@ -817,9 +820,13 @@
addAttribute(doc, "name", localPart + MEPtoSuffixMap.get(mep),
rootElement);
addAttribute(doc, "skeletonname", localPart + SKELETON_CLASS_SUFFIX,
rootElement);
- addAttribute(doc, "skeletonInterfaceName", localPart +
SKELETON_INTERFACE_SUFFIX,
- rootElement);
-
+ if (isServerSideInterface){
+ addAttribute(doc, "skeletonInterfaceName", localPart +
SKELETON_INTERFACE_SUFFIX,
+ rootElement);
+ }else{
+ addAttribute(doc, "skeletonInterfaceName", localPart +
SKELETON_CLASS_SUFFIX,
+ rootElement);
+ }
addAttribute(doc, "basereceiver", (String) MEPtoClassMap.get(mep),
rootElement);
fillSyncAttributes(doc, rootElement);
@@ -1070,7 +1077,7 @@
}
private void writeSkeleton() throws Exception {
- Document skeletonModel = createDOMDocumentForSkeleton();
+ Document skeletonModel =
createDOMDocumentForSkeleton(codeGenConfiguration.isServerSideInterface());
debugLogDocument("Document for skeleton:", skeletonModel);
ClassWriter skeletonWriter = new
SkeletonWriter(getOutputDirectory(this.codeGenConfiguration.getOutputLocation(),
"src"), this.codeGenConfiguration.getOutputLanguage());
@@ -1093,7 +1100,7 @@
}
- private Document createDOMDocumentForSkeleton() {
+ private Document createDOMDocumentForSkeleton(boolean isSkeletonInterface)
{
Document doc = getEmptyDocument();
Element rootElement = doc.createElement("interface");
@@ -1102,8 +1109,10 @@
addAttribute(doc, "name", serviceName + SKELETON_CLASS_SUFFIX,
rootElement);
addAttribute(doc, "callbackname", serviceName +
CALL_BACK_HANDLER_SUFFIX,
rootElement);
- addAttribute(doc, "skeletonInterfaceName", serviceName +
SKELETON_INTERFACE_SUFFIX,
- rootElement);
+ if (isSkeletonInterface){
+ addAttribute(doc, "skeletonInterfaceName", serviceName +
SKELETON_INTERFACE_SUFFIX,
+ rootElement);
+ }
fillSyncAttributes(doc, rootElement);
loadOperations(doc, rootElement, null);
Modified:
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/i18n/resource.properties
URL:
http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/i18n/resource.properties?rev=399267&r1=399266&r2=399267&view=diff
==============================================================================
---
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/i18n/resource.properties
(original)
+++
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/i18n/resource.properties
Wed May 3 04:33:24 2006
@@ -30,6 +30,7 @@
wsdl2code.arg14=-u : unpacks the databinding classes
wsdl2code.arg15=-r <repository_path> : path of the repository against which
code is generated
wsdl2code.arg16=-ns2p <namespace=packagename> :packages to replace the
namespace
+wsdl2code.arg17=-ssi generate an interface for the serverside - off by default
################## prop file loader #################################
propfileload.frameworkMismatch=Number of frameworks and extension names do not
match!
Modified:
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonTemplate.xsl
URL:
http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonTemplate.xsl?rev=399267&r1=399266&r2=399267&view=diff
==============================================================================
---
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonTemplate.xsl
(original)
+++
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonTemplate.xsl
Wed May 3 04:33:24 2006
@@ -11,7 +11,8 @@
/**
* <xsl:value-of select="@name"/> java skeleton for the axisService
*/
- public class <xsl:value-of select="@name"></xsl:value-of> implements
<xsl:value-of select="@skeletonInterfaceName"/>{
+ public class <xsl:value-of select="@name"></xsl:value-of>
+ <xsl:if test="@skeletonInterfaceName">implements <xsl:value-of
select="@skeletonInterfaceName"/></xsl:if>{
<xsl:for-each select="method">
<xsl:variable name="count"><xsl:value-of
select="count(output/param)"/></xsl:variable>
<xsl:variable name="outputtype"><xsl:value-of
select="output/param/@type"/></xsl:variable>
Modified:
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/util/CommandLineOptionConstants.java
URL:
http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/util/CommandLineOptionConstants.java?rev=399267&r1=399266&r2=399267&view=diff
==============================================================================
---
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/util/CommandLineOptionConstants.java
(original)
+++
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/util/CommandLineOptionConstants.java
Wed May 3 04:33:24 2006
@@ -37,6 +37,7 @@
String SERVICE_NAME_OPTION = "sn";
String REPOSITORY_PATH_OPTION = "r";
String NAME_SPACE_TO_PACKAGE_OPTION = "ns2p";
+ String SERVER_SIDE_INTERFACE_OPTION = "ssi";
//long option constants
String OUTPUT_LOCATION_OPTION_LONG = "output";
@@ -56,6 +57,7 @@
String EXTRA_OPTIONTYPE_PREFIX = "E";
String REPOSITORY_PATH_OPTION_LONG = "repository-path";
String NAME_SPACE_TO_PACKAGE_OPTION_LONG = "namespace2package";
+ String SERVER_SIDE_INTERFACE_OPTION_LONG = "serverside-interface";
}
Modified:
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/util/WSDL2JavaOptionsValidator.java
URL:
http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/util/WSDL2JavaOptionsValidator.java?rev=399267&r1=399266&r2=399267&view=diff
==============================================================================
---
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/util/WSDL2JavaOptionsValidator.java
(original)
+++
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/util/WSDL2JavaOptionsValidator.java
Wed May 3 04:33:24 2006
@@ -42,6 +42,7 @@
(WSDL2JavaConstants.SERVICE_NAME_OPTION).equalsIgnoreCase(optionType) ||
(WSDL2JavaConstants.REPOSITORY_PATH_OPTION).equalsIgnoreCase(optionType) ||
(WSDL2JavaConstants.NAME_SPACE_TO_PACKAGE_OPTION).equalsIgnoreCase(optionType)
||
+
(WSDL2JavaConstants.SERVER_SIDE_INTERFACE_OPTION).equalsIgnoreCase(optionType)
||
(WSDL2JavaConstants.OUTPUT_LOCATION_OPTION_LONG).equalsIgnoreCase(optionType) ||
(WSDL2JavaConstants.SERVER_SIDE_CODE_OPTION_LONG).equalsIgnoreCase(optionType)
||
@@ -57,6 +58,7 @@
(WSDL2JavaConstants.SERVICE_NAME_OPTION_LONG).equalsIgnoreCase(optionType) ||
(WSDL2JavaConstants.GENERATE_ALL_OPTION_LONG).equalsIgnoreCase(optionType) ||
(WSDL2JavaConstants.NAME_SPACE_TO_PACKAGE_OPTION_LONG).equalsIgnoreCase(optionType)
||
+
(WSDL2JavaConstants.SERVER_SIDE_INTERFACE_OPTION_LONG).equalsIgnoreCase(optionType)
||
(WSDL2JavaConstants.REPOSITORY_PATH_OPTION_LONG).equalsIgnoreCase(optionType)
);
Modified:
webservices/axis2/trunk/java/modules/integration/test/samples/wsdl/perf/PerfPortTypeSkeleton.java
URL:
http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/samples/wsdl/perf/PerfPortTypeSkeleton.java?rev=399267&r1=399266&r2=399267&view=diff
==============================================================================
---
webservices/axis2/trunk/java/modules/integration/test/samples/wsdl/perf/PerfPortTypeSkeleton.java
(original)
+++
webservices/axis2/trunk/java/modules/integration/test/samples/wsdl/perf/PerfPortTypeSkeleton.java
Wed May 3 04:33:24 2006
@@ -7,7 +7,7 @@
/**
* PerfPortTypeSkeleton java skeleton for the axisService
*/
-public class PerfPortTypeSkeleton implements PerfPortTypeSkeletonInterface {
+public class PerfPortTypeSkeleton{
/**
* Auto generated method signature
*
Modified:
webservices/axis2/trunk/java/modules/integration/test/samples/wsdl/perf2/PerfPortTypeSkeleton.java
URL:
http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/samples/wsdl/perf2/PerfPortTypeSkeleton.java?rev=399267&r1=399266&r2=399267&view=diff
==============================================================================
---
webservices/axis2/trunk/java/modules/integration/test/samples/wsdl/perf2/PerfPortTypeSkeleton.java
(original)
+++
webservices/axis2/trunk/java/modules/integration/test/samples/wsdl/perf2/PerfPortTypeSkeleton.java
Wed May 3 04:33:24 2006
@@ -7,7 +7,7 @@
/**
* PerfPortTypeSkeleton java skeleton for the axisService
*/
-public class PerfPortTypeSkeleton implements PerfPortTypeSkeletonInterface {
+public class PerfPortTypeSkeleton{
/**
* Auto generated method signature
*
Modified:
webservices/axis2/trunk/java/modules/security/interop/org/apache/axis2/oasis/ping/PingPortSkeleton.java
URL:
http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/security/interop/org/apache/axis2/oasis/ping/PingPortSkeleton.java?rev=399267&r1=399266&r2=399267&view=diff
==============================================================================
---
webservices/axis2/trunk/java/modules/security/interop/org/apache/axis2/oasis/ping/PingPortSkeleton.java
(original)
+++
webservices/axis2/trunk/java/modules/security/interop/org/apache/axis2/oasis/ping/PingPortSkeleton.java
Wed May 3 04:33:24 2006
@@ -17,7 +17,7 @@
/**
* Auto generated java skeleton for the service by the Axis code generator
*/
-public class PingPortSkeleton implements PingPortSkeletonInterface{
+public class PingPortSkeleton{
private MessageContext mc;