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 aj...@apache.org on 2006/07/13 19:55:46 UTC
svn commit: r421674 - in /webservices/axis2/trunk/java/modules:
adb-codegen/src/org/apache/axis2/schema/
codegen/src/org/apache/axis2/wsdl/codegen/
codegen/src/org/apache/axis2/wsdl/codegen/emitter/
xmlbeans/src/org/apache/axis2/xmlbeans/ xmlbeans/src/...
Author: ajith
Date: Thu Jul 13 10:55:45 2006
New Revision: 421674
URL: http://svn.apache.org/viewvc?rev=421674&view=rev
Log:
1.Added unwrapping support for XMLBeans
I. Changed the XMLBeans extension to populate the inner types
II. Added the necessary changes to the XMLBeans databinding template
III. Updated the codegen-config.properties to include XMLBeans as a supported framework.
2. Removed an unnecessary parameter from one of the methods in the ExtensionUtility.java
3. Added a bit of verbosity to WSDL2JavaTest.java
A test case for unwrapping is pending
Modified:
webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/ExtensionUtility.java
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/codegen-config.properties
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
webservices/axis2/trunk/java/modules/xmlbeans/src/org/apache/axis2/xmlbeans/CodeGenerationUtility.java
webservices/axis2/trunk/java/modules/xmlbeans/src/org/apache/axis2/xmlbeans/template/XmlbeansDatabindingTemplate.xsl
webservices/axis2/trunk/java/modules/xmlbeans/test/org/apache/axis2/xmlbeans/WSDL2JavaTest.java
Modified: webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/ExtensionUtility.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/ExtensionUtility.java?rev=421674&r1=421673&r2=421674&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/ExtensionUtility.java (original)
+++ webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/ExtensionUtility.java Thu Jul 13 10:55:45 2006
@@ -131,7 +131,6 @@
if (WSDLUtil.isInputPresentForMEP(op.getMessageExchangePattern())) {
walkSchema(op.getMessage(
WSDLConstants.MESSAGE_LABEL_IN_VALUE),
- configuration,
mapper,
schemaMap,
op.getName().getLocalPart());
@@ -165,7 +164,6 @@
* @param mapper
*/
private static void walkSchema(AxisMessage message,
- CodeGenConfiguration configuration,
TypeMapper mapper,
Map schemaMap,
String opName) {
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/codegen-config.properties
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/codegen-config.properties?rev=421674&r1=421673&r2=421674&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/codegen-config.properties (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/codegen-config.properties Thu Jul 13 10:55:45 2006
@@ -23,6 +23,7 @@
# The third party schemas to be loaded. e.g. The Xmime extension
# Note - these will be loaded from the org.apache.axis2.wsdl.codegen.schema package.
# so whatever the third party schema's that are listed here should be present there
+#codegen.thirdparty.schema=
codegen.thirdparty.schema=xmime.xsd,soap-enc.xsd
#####################################################################################################################
#####################################################################################################################
@@ -32,7 +33,7 @@
codegen.databinding.frameworks=adb,xmlbeans,jaxme,jibx,jaxbri,none
# this property keeps the names of the databinding frameworks which support
# unwrapping
-codegen.databinding.unwrap.supported=adb
+codegen.databinding.unwrap.supported=adb,xmlbeans
# the related extensions for the specified data binding frameworks above
# Note - these are in the lexical order of the framework names. There is an implicit assumption
# that a given databinding framework will be processed only by one extension
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java?rev=421674&r1=421673&r2=421674&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 Thu Jul 13 10:55:45 2006
@@ -59,7 +59,7 @@
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.Text;
-import com.ibm.wsdl.util.xml.DOM2Writer;
+//import com.ibm.wsdl.util.xml.DOM2Writer;
/*
* Copyright 2004,2005 The Apache Software Foundation.
Modified: webservices/axis2/trunk/java/modules/xmlbeans/src/org/apache/axis2/xmlbeans/CodeGenerationUtility.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/xmlbeans/src/org/apache/axis2/xmlbeans/CodeGenerationUtility.java?rev=421674&r1=421673&r2=421674&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xmlbeans/src/org/apache/axis2/xmlbeans/CodeGenerationUtility.java (original)
+++ webservices/axis2/trunk/java/modules/xmlbeans/src/org/apache/axis2/xmlbeans/CodeGenerationUtility.java Thu Jul 13 10:55:45 2006
@@ -40,7 +40,13 @@
import org.apache.axis2.wsdl.databinding.JavaTypeMapper;
import org.apache.axis2.wsdl.databinding.TypeMapper;
import org.apache.axis2.wsdl.util.Constants;
+import org.apache.axis2.wsdl.WSDLUtil;
+import org.apache.axis2.wsdl.WSDLConstants;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.description.AxisOperation;
+import org.apache.axis2.description.AxisMessage;
import org.apache.ws.commons.schema.XmlSchema;
+import org.apache.ws.commons.schema.XmlSchemaType;
import org.apache.xmlbeans.BindingConfig;
import org.apache.xmlbeans.Filer;
import org.apache.xmlbeans.SchemaProperty;
@@ -49,6 +55,7 @@
import org.apache.xmlbeans.XmlBeans;
import org.apache.xmlbeans.XmlObject;
import org.apache.xmlbeans.XmlOptions;
+import org.apache.xmlbeans.SchemaGlobalElement;
import org.apache.xmlbeans.impl.xb.xsdschema.SchemaDocument;
import org.w3c.dom.Element;
import org.w3c.dom.Document;
@@ -179,11 +186,47 @@
//get the schematypes and add the document types to the type mapper
SchemaType[] schemaType = sts.documentTypes();
- SchemaType type;
for (int j = 0; j < schemaType.length; j++) {
- type = schemaType[j];
- mapper.addTypeMappingName(type.getDocumentElementName(),
- type.getFullJavaName());
+ mapper.addTypeMappingName(schemaType[j].getDocumentElementName(),
+ schemaType[j].getFullJavaName());
+
+ }
+
+
+ //process the unwrapped parameters
+ if (!cgconfig.isParametersWrapped()) {
+ //figure out the unwrapped operations
+ AxisService axisService = cgconfig.getAxisService();
+ for (Iterator operations = axisService.getOperations();
+ operations.hasNext();) {
+ AxisOperation op = (AxisOperation) operations.next();
+ if (WSDLUtil.isInputPresentForMEP(op.getMessageExchangePattern())) {
+ AxisMessage message = op.getMessage(
+ WSDLConstants.MESSAGE_LABEL_IN_VALUE);
+ if (message!= null && message.getParameter(Constants.UNWRAPPED_KEY) != null){
+ SchemaGlobalElement xmlbeansElement = sts.findElement(message.getElementQName());
+ SchemaType sType = xmlbeansElement.getType();
+
+ SchemaProperty[] elementProperties = sType.getElementProperties();
+ for (int i = 0; i < elementProperties.length; i++) {
+ SchemaProperty elementProperty = elementProperties[i];
+
+ QName partQName = WSDLUtil.getPartQName(op.getName().getLocalPart(),
+ WSDLConstants.INPUT_PART_QNAME_SUFFIX,
+ elementProperty.getName().getLocalPart());
+
+ //this type is based on a primitive type- use the
+ //primitive type name in this case
+ mapper.addTypeMappingName(partQName,elementProperty.getType().getFullJavaName());
+ SchemaType primitiveType = elementProperty.getType().getPrimitiveType();
+
+ if (primitiveType!=null){
+ mapper.addTypeMappingStatus(partQName,Boolean.TRUE);
+ }
+ }
+ }
+ }
+ }
}
//return mapper to be set in the config
@@ -195,7 +238,6 @@
}
}
-
/**
* Populate the base64 types
* The algo is to look for simpletypes that have base64 content, and then step out of that
@@ -510,6 +552,35 @@
return new ByteArrayInputStream(baos.toByteArray());
}
+
+ }
+
+ /**
+ * Populate the schema objects into the
+ *
+ * @param schemaMap
+ * @param schemaList
+ */
+ private static void populateSchemaMap(Map schemaMap, List schemaList) {
+ for (int i = 0; i < schemaList.size(); i++) {
+ XmlSchema xmlSchema = (XmlSchema) schemaList.get(i);
+ schemaMap.put(xmlSchema.getTargetNamespace(), xmlSchema);
+ }
+ }
+
+ /**
+ * Look for a given schema type given the schema type Qname
+ * @param schemaMap
+ * @param namespaceURI
+ * @return null if the schema is not found
+ */
+ private static XmlSchemaType findSchemaType(Map schemaMap, QName schemaTypeName) {
+ //find the schema
+ XmlSchema schema = (XmlSchema) schemaMap.get(schemaTypeName.getNamespaceURI());
+ if (schema!=null){
+ return schema.getTypeByName(schemaTypeName);
+ }
+ return null;
}
}
Modified: webservices/axis2/trunk/java/modules/xmlbeans/src/org/apache/axis2/xmlbeans/template/XmlbeansDatabindingTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/xmlbeans/src/org/apache/axis2/xmlbeans/template/XmlbeansDatabindingTemplate.xsl?rev=421674&r1=421673&r2=421674&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xmlbeans/src/org/apache/axis2/xmlbeans/template/XmlbeansDatabindingTemplate.xsl (original)
+++ webservices/axis2/trunk/java/modules/xmlbeans/src/org/apache/axis2/xmlbeans/template/XmlbeansDatabindingTemplate.xsl Thu Jul 13 10:55:45 2006
@@ -4,7 +4,7 @@
<!-- ################################################################################# -->
<!-- ############################ xmlbeans template ############################## -->
<xsl:template match="databinders[@dbtype='xmlbeans']">
-
+ <xsl:variable name="serverside" select="@isserverside"></xsl:variable>
<xsl:variable name="base64"><xsl:value-of select="base64Elements/name"/></xsl:variable>
<xsl:if test="$base64">
private static javax.xml.namespace.QName[] qNameArray = {
@@ -14,59 +14,143 @@
};
</xsl:if>
- <xsl:for-each select="param">
- <xsl:if test="@type!=''">
- private org.apache.axiom.om.OMElement toOM(<xsl:value-of select="@type"/> param, boolean optimizeContent){
- org.apache.axiom.om.impl.builder.StAXOMBuilder builder = new org.apache.axiom.om.impl.builder.StAXOMBuilder
- (org.apache.axiom.om.OMAbstractFactory.getOMFactory(),new org.apache.axis2.util.StreamWrapper(param.newXMLStreamReader())) ;
- org.apache.axiom.om.OMElement documentElement = builder.getDocumentElement();
-
- <xsl:if test="$base64">
- if (optimizeContent) {
- optimizeContent(documentElement,qNameArray);
- }
- </xsl:if>
+ <xsl:for-each select="param[@type!='']">
- ((org.apache.axiom.om.impl.OMNodeEx)documentElement).setParent(null);
- return documentElement;
+ private org.apache.axiom.om.OMElement toOM(<xsl:value-of select="@type"/> param, boolean optimizeContent){
+ org.apache.axiom.om.impl.builder.StAXOMBuilder builder = new org.apache.axiom.om.impl.builder.StAXOMBuilder
+ (org.apache.axiom.om.OMAbstractFactory.getOMFactory(),new org.apache.axis2.util.StreamWrapper(param.newXMLStreamReader())) ;
+ org.apache.axiom.om.OMElement documentElement = builder.getDocumentElement();
+
+ <xsl:if test="$base64">
+ if (optimizeContent) {
+ optimizeContent(documentElement,qNameArray);
}
+ </xsl:if>
- private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, <xsl:value-of select="@type"/> param, boolean optimizeContent){
- org.apache.axiom.soap.SOAPEnvelope envelope = factory.getDefaultEnvelope();
- if (param != null){
- envelope.getBody().addChild(toOM(param, optimizeContent));
- }
- return envelope;
- }
+ ((org.apache.axiom.om.impl.OMNodeEx)documentElement).setParent(null);
+ return documentElement;
+ }
+ </xsl:for-each>
+
+
+ <xsl:for-each select="opnames/name">
+
+ <xsl:variable name="opname" select="."/>
+ <xsl:variable name="opnsuri" select="@opnsuri"/>
+ <xsl:variable name="paramcount" select="count(../../param[@type!='' and @direction='in' and @opname=$opname])"/>
+ <!-- get the opname capitalized -->
+ <xsl:variable name="opnameCapitalized" select="concat(translate(substring($opname, 1, 1 ),'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' ), substring($opname, 2, string-length($opname)))"></xsl:variable>
+
+ <xsl:if test="not($serverside)">
+ <xsl:choose>
+ <xsl:when test="$paramcount > 0">
+ <xsl:variable name="inputElementType" select="../../param[@type!='' and @direction='in' and @opname=$opname]/@type"></xsl:variable>
+ <xsl:variable name="wrappedParameterCount" select="count(../../param[@type!='' and @direction='in' and @opname=$opname]/param)"></xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$wrappedParameterCount > 0">
+ <!-- geneate the toEnvelope method-->
+ private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory,
+ <xsl:for-each select="../../param[@type!='' and @direction='in' and @opname=$opname]/param">
+ <xsl:value-of select="@type"/> param<xsl:value-of select="position()"/>,
+ </xsl:for-each>
+ boolean optimizeContent){
+
+ <xsl:value-of select="$inputElementType"/> wrappedType = <xsl:value-of select="$inputElementType"/>.Factory.newInstance();
+ <xsl:value-of select="$inputElementType"/>.<xsl:value-of select="$opnameCapitalized"/> wrappedEltType = wrappedType.addNew<xsl:value-of select="$opnameCapitalized"/>();
+ <xsl:for-each select="../../param[@type!='' and @direction='in' and @opname=$opname]/param">
+ <xsl:choose>
+ <xsl:when test="@primitive">wrappedEltType.xset<xsl:value-of select="@partname"/>(param<xsl:value-of select="position()"/>);</xsl:when>
+ <xsl:otherwise>wrappedEltType.set<xsl:value-of select="@partname"/>(param<xsl:value-of select="position()"/>);</xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+
+
+ org.apache.axiom.soap.SOAPEnvelope envelope = factory.getDefaultEnvelope();
+ envelope.getBody().addChild(toOM(wrappedType, optimizeContent));
+ return envelope;
+
+ }
+
+
+
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- Assumption - the parameter is always an XMLBeans -->
+ private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, <xsl:value-of select="$inputElementType"/> param, boolean optimizeContent){
+ org.apache.axiom.soap.SOAPEnvelope envelope = factory.getDefaultEnvelope();
+ if (param != null){
+ envelope.getBody().addChild(toOM(param, optimizeContent));
+ }
+ return envelope;
+ }
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+
+ <xsl:otherwise>
+ <!-- Do nothing here -->
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:if>
+ <!-- this piece of logic needs to be generated only for the server side-->
+ <xsl:if test="$serverside">
+ <xsl:choose>
+ <xsl:when test="count(../../param[@type!='' and @direction='out' and @opname=$opname])=1">
+ <!-- Assumption - This is an XMLBeans element-->
+ private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, <xsl:value-of select="../../param[@type!='' and @direction='out' and @opname=$opname]/@type"/> param, boolean optimizeContent){
+ org.apache.axiom.soap.SOAPEnvelope envelope = factory.getDefaultEnvelope();
+ if (param != null){
+ envelope.getBody().addChild(toOM(param, optimizeContent));
+ }
+ return envelope;
+ }
+
+ </xsl:when>
+ </xsl:choose>
+ <xsl:if test="count(../../param[@type!='' and @direction='in' and @opname=$opname])=1">
+ <!-- generate the get methods -->
+ <xsl:for-each select="../../param[@type!='' and @direction='in' and @opname=$opname]/param">
+ private <xsl:value-of select="@type"/> get<xsl:value-of select="@partname"/>(
+ <xsl:value-of select="../@type"/> wrappedType){
+ <xsl:value-of select="../@type"/>.<xsl:value-of select="$opnameCapitalized"/> innerType =
+ wrappedType.get<xsl:value-of select="$opnameCapitalized"/>();
+ <xsl:choose>
+ <xsl:when test="@primitive">return innerType.xget<xsl:value-of select="@partname"/>();</xsl:when>
+ <xsl:otherwise>return innerType.get<xsl:value-of select="@partname"/>();</xsl:otherwise>
+ </xsl:choose>
+ }
+ </xsl:for-each>
+ </xsl:if>
+ </xsl:if>
</xsl:for-each>
+
/**
- * get the default envelope
- */
+ * get the default envelope
+ */
private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory){
- return factory.getDefaultEnvelope();
+ return factory.getDefaultEnvelope();
}
public org.apache.xmlbeans.XmlObject fromOM(
- org.apache.axiom.om.OMElement param,
- java.lang.Class type,
- java.util.Map extraNamespaces){
+ org.apache.axiom.om.OMElement param,
+ java.lang.Class type,
+ java.util.Map extraNamespaces){
try{
- <xsl:for-each select="param">
- <xsl:if test="@type!=''">
- if (<xsl:value-of select="@type"/>.class.equals(type)){
- if (extraNamespaces!=null){
- return <xsl:value-of select="@type"/>.Factory.parse(
- param.getXMLStreamReaderWithoutCaching(),
- new org.apache.xmlbeans.XmlOptions().setLoadAdditionalNamespaces(extraNamespaces));
- }else{
- return <xsl:value-of select="@type"/>.Factory.parse(
- param.getXMLStreamReaderWithoutCaching());
- }
- }
- </xsl:if>
+ <xsl:for-each select="param[@type!='' and not(@primitive)]">
+
+ if (<xsl:value-of select="@type"/>.class.equals(type)){
+ if (extraNamespaces!=null){
+ return <xsl:value-of select="@type"/>.Factory.parse(
+ param.getXMLStreamReaderWithoutCaching(),
+ new org.apache.xmlbeans.XmlOptions().setLoadAdditionalNamespaces(extraNamespaces));
+ }else{
+ return <xsl:value-of select="@type"/>.Factory.parse(
+ param.getXMLStreamReaderWithoutCaching());
+ }
+ }
+
</xsl:for-each>
}catch(java.lang.Exception e){
throw new RuntimeException("Data binding error",e);
@@ -74,29 +158,29 @@
return null;
}
- <!-- Generate the base 64 optimize methods only if the base64 items are present -->
- <xsl:if test="$base64">
+ <!-- Generate the base 64 optimize methods only if the base64 items are present -->
+ <xsl:if test="$base64">
- private void optimizeContent(org.apache.axiom.om.OMElement element, javax.xml.namespace.QName[] qNames){
- for (int i = 0; i < qNames.length; i++) {
+ private void optimizeContent(org.apache.axiom.om.OMElement element, javax.xml.namespace.QName[] qNames){
+ for (int i = 0; i < qNames.length; i++) {
markElementsAsOptimized(qNames[i],element);
- }
- }
+ }
+ }
- private void markElementsAsOptimized(javax.xml.namespace.QName qName,org.apache.axiom.om.OMElement rootElt){
- if (rootElt.getQName().equals(qName)){
+ private void markElementsAsOptimized(javax.xml.namespace.QName qName,org.apache.axiom.om.OMElement rootElt){
+ if (rootElt.getQName().equals(qName)){
//get the text node and mark it
org.apache.axiom.om.OMNode node = rootElt.getFirstOMChild();
if (node.getType()==org.apache.axiom.om.OMNode.TEXT_NODE){
- ((org.apache.axiom.om.OMText)node).setOptimize(true);
+ ((org.apache.axiom.om.OMText)node).setOptimize(true);
}
- }
- java.util.Iterator childElements = rootElt.getChildElements();
- while (childElements.hasNext()) {
+ }
+ java.util.Iterator childElements = rootElt.getChildElements();
+ while (childElements.hasNext()) {
markElementsAsOptimized(qName,(org.apache.axiom.om.OMElement)childElements.next());
- }
- }
- </xsl:if>
+ }
+ }
+ </xsl:if>
</xsl:template>
</xsl:stylesheet>
Modified: webservices/axis2/trunk/java/modules/xmlbeans/test/org/apache/axis2/xmlbeans/WSDL2JavaTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/xmlbeans/test/org/apache/axis2/xmlbeans/WSDL2JavaTest.java?rev=421674&r1=421673&r2=421674&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xmlbeans/test/org/apache/axis2/xmlbeans/WSDL2JavaTest.java (original)
+++ webservices/axis2/trunk/java/modules/xmlbeans/test/org/apache/axis2/xmlbeans/WSDL2JavaTest.java Thu Jul 13 10:55:45 2006
@@ -94,12 +94,13 @@
* Test for the WSAT wsdl
*/
public void testCodeGenerationWSAT(){
-
+ String wsdlName = "wsat.wsdl";
try {
- generateAndCompile("wsat.wsdl", OUTPUT_LOCATION_BASE+OUTPUT_LOCATION_PREFIX+folderCount++);
+
+ generateAndCompile(wsdlName, OUTPUT_LOCATION_BASE+OUTPUT_LOCATION_PREFIX+folderCount++);
} catch (CodeGenerationException e) {
e.printStackTrace();
- fail("Exception while code generation test!"+ e.getMessage());
+ fail("Exception while code generation test! " + wsdlName + e.getMessage());
}
}
@@ -111,22 +112,24 @@
public void testCodeGenerationNoService(){
try {
- generateAndCompile("no-service.wsdl", OUTPUT_LOCATION_BASE+OUTPUT_LOCATION_PREFIX+folderCount++);
+ String wsdlName = "no-service.wsdl";
+ generateAndCompile(wsdlName, OUTPUT_LOCATION_BASE+OUTPUT_LOCATION_PREFIX+folderCount++);
fail("Undesired behavior while code generating!");
} catch (CodeGenerationException e) {
//done - we are good if we reach here
}
}
- /**
+ /**
* Test for the Headers
*/
public void testCodeGenerationHeaders(){
-
+ String wsdlName = "headers.wsdl";
try {
- generateAndCompile("headers.wsdl", OUTPUT_LOCATION_BASE+OUTPUT_LOCATION_PREFIX+folderCount++);
+
+ generateAndCompile(wsdlName, OUTPUT_LOCATION_BASE+OUTPUT_LOCATION_PREFIX+folderCount++);
} catch (CodeGenerationException e) {
- fail("Exception while code generation test!"+ e.getMessage());
+ fail("Exception while code generation test! "+ wsdlName + e.getMessage());
}
}
@@ -134,12 +137,12 @@
* Test for the ping WSDL
*/
public void testCodeGenerationPing(){
-
+ String wsdlName = "ping.wsdl";
try {
- generateAndCompile("ping.wsdl", OUTPUT_LOCATION_BASE+OUTPUT_LOCATION_PREFIX+folderCount++);
+
+ generateAndCompile(wsdlName, OUTPUT_LOCATION_BASE+OUTPUT_LOCATION_PREFIX+folderCount++);
} catch (CodeGenerationException e) {
- e.printStackTrace();
- fail("Exception while code generation test!"+ e.getMessage());
+ fail("Exception while code generation test! "+wsdlName+ e.getMessage());
}
}
@@ -148,11 +151,12 @@
* Test for the interoptestdoclitparameters
*/
public void testCodeGenerationInteropTestDocLitParams(){
-
+ String wsdlName = "interoptestdoclitparameters.wsdl";
try {
- generateAndCompile("interoptestdoclitparameters.wsdl", OUTPUT_LOCATION_BASE+OUTPUT_LOCATION_PREFIX+folderCount++);
+
+ generateAndCompile(wsdlName, OUTPUT_LOCATION_BASE+OUTPUT_LOCATION_PREFIX+folderCount++);
} catch (CodeGenerationException e) {
- fail("Exception while code generation test!"+ e.getMessage());
+ fail("Exception while code generation test! "+wsdlName+ e.getMessage());
}
}
@@ -167,15 +171,16 @@
// }
// }
- /**
+ /**
* Test for the mime doc
*/
public void testCodeGenerationMimeDoc(){
-
+ String wsdlName = "mime-doc.wsdl";
try {
- generateAndCompile("mime-doc.wsdl", OUTPUT_LOCATION_BASE+OUTPUT_LOCATION_PREFIX+folderCount++);
+
+ generateAndCompile(wsdlName, OUTPUT_LOCATION_BASE+OUTPUT_LOCATION_PREFIX+folderCount++);
} catch (CodeGenerationException e) {
- fail("Exception while code generation test!"+ e.getMessage());
+ fail("Exception while code generation test! "+ wsdlName + e.getMessage());
}
}
@@ -194,11 +199,12 @@
* Test for the wscoor.wsdl
*/
public void testCodeGenerationWSCOOR(){
-
+ String wsdlName = "interoptestdoclit.wsdl";
try {
- generateAndCompile("interoptestdoclit.wsdl", OUTPUT_LOCATION_BASE+OUTPUT_LOCATION_PREFIX+folderCount++);
+
+ generateAndCompile(wsdlName, OUTPUT_LOCATION_BASE+OUTPUT_LOCATION_PREFIX+folderCount++);
} catch (CodeGenerationException e) {
- fail("Exception while code generation test!"+ e.getMessage());
+ fail("Exception while code generation test! " + wsdlName + e.getMessage());
}
}
@@ -227,7 +233,7 @@
generateAndCompile("ping-unbound.wsdl", OUTPUT_LOCATION_BASE+OUTPUT_LOCATION_PREFIX+folderCount++);
fail("Undesired behavior while code generating!");
} catch (CodeGenerationException e) {
- //we are good
+ //we are good
}
}
@@ -236,11 +242,12 @@
*
*/
public void testCodeGenerationSimpleDocLiteral(){
-
+ String wsdlName = "simple-doc-literal.wsdl";
try {
- generateAndCompile("simple-doc-literal.wsdl", OUTPUT_LOCATION_BASE+OUTPUT_LOCATION_PREFIX+folderCount++);
+
+ generateAndCompile(wsdlName, OUTPUT_LOCATION_BASE+OUTPUT_LOCATION_PREFIX+folderCount++);
} catch (CodeGenerationException e) {
- fail("Exception while code generation test!"+ e.getMessage());
+ fail("Exception while code generation test !" + wsdlName + e.getMessage());
}
}
@@ -249,11 +256,12 @@
*
*/
public void testCodeGenerationComplexDocLiteral(){
-
+ String wsdlName = "complex-doc-literal.wsdl";
try {
- generateAndCompile("complex-doc-literal.wsdl", OUTPUT_LOCATION_BASE+OUTPUT_LOCATION_PREFIX+folderCount++);
+
+ generateAndCompile(wsdlName, OUTPUT_LOCATION_BASE+OUTPUT_LOCATION_PREFIX+folderCount++);
} catch (CodeGenerationException e) {
- fail("Exception while code generation test!"+ e.getMessage());
+ fail("Exception while code generation test! "+wsdlName+ e.getMessage());
}
}
/**
@@ -262,11 +270,12 @@
*
*/
public void testCodeGenerationMTOMEcho(){
-
+ String wsdlName = "mtomecho.wsdl";
try {
- generateAndCompile("mtomecho.wsdl", OUTPUT_LOCATION_BASE+OUTPUT_LOCATION_PREFIX+folderCount++);
+
+ generateAndCompile(wsdlName, OUTPUT_LOCATION_BASE+OUTPUT_LOCATION_PREFIX+folderCount++);
} catch (CodeGenerationException e) {
- fail("Exception while code generation test!"+ e.getMessage());
+ fail("Exception while code generation test! "+wsdlName+ e.getMessage());
}
}
@@ -381,13 +390,13 @@
CommandLineOptionConstants.WSDL2JavaConstants.GENERATE_SERVICE_DESCRIPTION_OPTION,
new CommandLineOption(CommandLineOptionConstants.WSDL2JavaConstants.GENERATE_SERVICE_DESCRIPTION_OPTION,
new String[0]));
- // db is xmlbeans option is on
+ // db is xmlbeans option is on
optionMap.put(
CommandLineOptionConstants.WSDL2JavaConstants.DATA_BINDING_TYPE_OPTION,
new CommandLineOption(CommandLineOptionConstants.WSDL2JavaConstants.DATA_BINDING_TYPE_OPTION,
new String[]{TestConstants.Databinding.XML_BEANS}));
- optionMap.put(
+ optionMap.put(
CommandLineOptionConstants.WSDL2JavaConstants.GENERATE_ALL_OPTION,
new CommandLineOption(CommandLineOptionConstants.WSDL2JavaConstants.GENERATE_ALL_OPTION,
new String[0]));
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org