You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by aj...@apache.org on 2006/07/12 15:21:07 UTC
svn commit: r421268 - in /webservices/axis2/trunk/java/modules:
adb-codegen/src/org/apache/axis2/schema/template/
codegen/src/org/apache/axis2/wsdl/codegen/emitter/
codegen/src/org/apache/axis2/wsdl/template/java/
core/src/org/apache/axis2/description/
Author: ajith
Date: Wed Jul 12 06:21:06 2006
New Revision: 421268
URL: http://svn.apache.org/viewvc?rev=421268&view=rev
Log:
1. Changed the unwrapping algorithm to generate the types as anonymous inner types rather than names top level types.
2. Changed the implementation of unwrapping to have a different architecture.
I. Now the unwrapping happens using the objects rather than the XML. The approach with OM (the previous implementation) had the drawback of the complete tree being built.
II. Slightly Changed the structure of the intermediate XML format. Changed the templates to suit the change of the XML format.
Modified:
webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBDatabindingTemplate.xsl
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/template/java/InterfaceImplementationTemplate.xsl
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/MessageReceiverTemplate.xsl
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonInterfaceTemplate.xsl
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonTemplate.xsl
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java
Modified: webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBDatabindingTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBDatabindingTemplate.xsl?rev=421268&r1=421267&r2=421268&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBDatabindingTemplate.xsl (original)
+++ webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBDatabindingTemplate.xsl Wed Jul 12 06:21:06 2006
@@ -3,10 +3,10 @@
<!-- ################################################################################# -->
<!-- ############################ ADB template ############################## -->
<xsl:template match="databinders[@dbtype='adb']">
- <xsl:variable name="serverside"><xsl:value-of select="@isserverside"/></xsl:variable>
+ <xsl:variable name="serverside" select="@isserverside"></xsl:variable>
<!-- generate toOM for only non parts and non primitives!!! -->
- <xsl:for-each select="param[@type!='' and not(@primitive) and not(@partname)]">
+ <xsl:for-each select="param[@type!='' and not(@primitive)]">
private org.apache.axiom.om.OMElement toOM(<xsl:value-of select="@type"/> param, boolean optimizeContent){
return param.getOMElement(<xsl:value-of select="@type"/>.MY_QNAME,
org.apache.axiom.om.OMAbstractFactory.getOMFactory());
@@ -15,71 +15,51 @@
<xsl:for-each select="opnames/name">
- <xsl:variable name="opname"><xsl:value-of select="."/></xsl:variable>
- <xsl:variable name="opnsuri"><xsl:value-of select="@opnsuri"/></xsl:variable>
- <xsl:variable name="paramcount"><xsl:value-of select="count(../../param[@type!='' and @direction='in' and @opname=$opname])"/></xsl:variable>
+ <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])"/>
+
<xsl:if test="not($serverside)">
<xsl:choose>
- <xsl:when test="$paramcount=1">
- <!-- Assumption - The ADBBean here is always an element based bean -->
- private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, <xsl:value-of select="../../param[@type!='' and @direction='in' and @opname=$opname]/@type"/> param, boolean optimizeContent){
- org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope();
- emptyEnvelope.getBody().addChild(param.getOMElement(<xsl:value-of select="../../param[@type!='' and @direction='in' and @opname=$opname]/@type"/>.MY_QNAME,factory));
+ <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 = new <xsl:value-of select="$inputElementType"/>();
+ <xsl:for-each select="../../param[@type!='' and @direction='in' and @opname=$opname]/param">
+ wrappedType.set<xsl:value-of select="@partname"/>(param<xsl:value-of select="position()"/>);
+ </xsl:for-each>
+
+
+ org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope();
+ emptyEnvelope.getBody().addChild(wrappedType.getOMElement(<xsl:value-of select="$inputElementType"/>.MY_QNAME,factory));
+ return emptyEnvelope;
+ }
+
+
+
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- Assumption - the parameter is always an ADB element-->
+ 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 emptyEnvelope = factory.getDefaultEnvelope();
+ emptyEnvelope.getBody().addChild(param.getOMElement(<xsl:value-of select="$inputElementType"/>.MY_QNAME,factory));
return emptyEnvelope;
}
- </xsl:when>
- <xsl:when test="$paramcount > 1">
- 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]"><xsl:value-of select="@type"/> param<xsl:value-of select="position()"/>,</xsl:for-each>
- boolean optimizeContent){
- org.apache.axiom.om.OMElement elt;
- //make the OMfactory and generate the wrapper element
- org.apache.axiom.om.OMFactory fac = org.apache.axiom.om.OMAbstractFactory.getOMFactory();
- org.apache.axiom.om.OMElement wrapperElt =
- fac.createOMElement("<xsl:value-of select="$opname"/>","<xsl:value-of select="$opnsuri"/>",null);
- <xsl:for-each select="../../param[@type!='' and @direction='in' and @opname=$opname]">
-
- <xsl:choose>
- <xsl:when test="@primitive">
- elt = fac.createOMElement("<xsl:value-of select="@partname"/>","",null);
- elt.setText(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(param<xsl:value-of select="position()"/>));
- </xsl:when>
- <xsl:otherwise>
- <!-- elt = param<xsl:value-of select="position()"/>.getOMElement(
- new javax.xml.namespace.QName("","<xsl:value-of select="@partname"/>"),
- org.apache.axiom.om.OMAbstractFactory.getOMFactory()); -->
- <xsl:variable name="paramname">param<xsl:value-of select="position()"/></xsl:variable>
- <xsl:variable name="buildername">builder<xsl:value-of select="position()"/></xsl:variable>
- <xsl:variable name="docEltName">docElt<xsl:value-of select="position()"/></xsl:variable>
- elt = fac.createOMElement("<xsl:value-of select="@partname"/>","",null);
-
- org.apache.axiom.om.impl.builder.StAXOMBuilder <xsl:value-of select="$buildername"/> = new org.apache.axiom.om.impl.builder.StAXOMBuilder(factory,
- <xsl:value-of select="$paramname"/>.getPullParser(elt.getQName()));
-
- org.apache.axiom.om.OMElement <xsl:value-of select="$docEltName"/> = <xsl:value-of select="$buildername"/>.getDocumentElement();
- (( org.apache.axiom.om.impl.OMNodeEx) <xsl:value-of select="$docEltName"/>).setParent(null);
- <xsl:value-of select="$docEltName"/>.build();
- elt.addChild(<xsl:value-of select="$docEltName"/>);
-
- </xsl:otherwise>
- </xsl:choose>
- wrapperElt.addChild(elt);
- </xsl:for-each>
-
- org.apache.axis2.databinding.ADBSOAPModelBuilder builder =
- new org.apache.axis2.databinding.ADBSOAPModelBuilder(wrapperElt.getXMLStreamReader(),
- factory);
- return builder.getEnvelope();
- }
- </xsl:when>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
<xsl:otherwise>
- /**
- * get the default envelope
- */
- private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory){
- return factory.getDefaultEnvelope();
- }
+ <!-- Do nothing here -->
</xsl:otherwise>
</xsl:choose>
</xsl:if>
@@ -89,16 +69,33 @@
<xsl:when test="count(../../param[@type!='' and @direction='out' and @opname=$opname])=1">
<!-- Assumption - The ADBBean here is always an element based bean -->
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 emptyEnvelope = factory.getDefaultEnvelope();
+ org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope();
emptyEnvelope.getBody().addChild(param.getOMElement(<xsl:value-of select="../../param[@type!='' and @direction='out' and @opname=$opname]/@type"/>.MY_QNAME,factory));
return emptyEnvelope;
}
</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){
+ return wrappedType.get<xsl:value-of select="@partname"/>();
+ }
+ </xsl:for-each>
+ </xsl:if>
</xsl:if>
</xsl:for-each>
+ /**
+ * get the default envelope
+ */
+ private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory){
+ return factory.getDefaultEnvelope();
+ }
+
+
private java.lang.Object fromOM(
org.apache.axiom.om.OMElement param,
java.lang.Class type,
@@ -113,19 +110,11 @@
} catch (Exception e) {
throw new RuntimeException(e);
}
-
- return null;
+ return null;
}
- <!-- generate convert methods to convert from the primitive types -->
- <xsl:for-each select="param[@primitive and @type!='']">
- private <xsl:value-of select="@type"/> convertTo<xsl:value-of select="@shorttype"/>(
- org.apache.axiom.om.OMElement param
- ){
- return org.apache.axis2.databinding.utils.ConverterUtil.
- convertTo<xsl:value-of select="@shorttype"/>(param.getText());
- }
- </xsl:for-each>
+
</xsl:template>
+
</xsl:stylesheet>
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=421268&r1=421267&r2=421268&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 Jul 12 06:21:06 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.
@@ -1804,8 +1804,21 @@
AxisMessage inputMessage = operation.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
List paramElementList = new ArrayList();
if (inputMessage != null) {
+
+ // This is the wrapped component - add the type mapping
+ Element mainParameter = generateParamComponent(doc,
+ this.mapper.getParameterName(
+ inputMessage.getElementQName()),
+ this.mapper.getTypeMappingName(
+ inputMessage.getElementQName()),
+ operation.getName()
+ );
+
+ paramElementList.add(mainParameter);
+
// this message has been unwrapped - find the correct references of the
- // the message by looking at the unwrapped details object
+ // the message by looking at the unwrapped details object and attach the
+ // needed parameters inside main parameter element
if (inputMessage.getParameter(Constants.UNWRAPPED_KEY) != null) {
//we have this unwrapped earlier. get the info holder
//and then look at the parameters
@@ -1815,10 +1828,11 @@
(MessagePartInformationHolder)detailsParameter.getValue();
List partsList = infoHolder.getPartsList();
-
+ //populate the parts list - this list is needed to generate multiple
+ //parameters in the signatures
for (int i = 0; i < partsList.size(); i++) {
QName qName = (QName) partsList.get(i);
- paramElementList.add(generateParamComponent(doc,
+ mainParameter.appendChild(generateParamComponent(doc,
this.mapper.getParameterName(
qName),
this.mapper.getTypeMappingName(
@@ -1828,19 +1842,15 @@
(this.mapper.getTypeMappingStatus(qName)!=null))
);
}
- } else {
- // This is a wrapped component - just add the type mapping
- paramElementList.add(generateParamComponent(doc,
- this.mapper.getParameterName(
- inputMessage.getElementQName()),
- this.mapper.getTypeMappingName(
- inputMessage.getElementQName()),
- operation.getName()
- )
- );
+
+ // apart from the parts list we need to get the wrapping classname
+ // as well
}
+
+
+
}
return (Element[])paramElementList.toArray(
@@ -1920,7 +1930,9 @@
}
if (partName!= null){
- addAttribute(doc,"partname",partName,paramElement);
+ addAttribute(doc,"partname",
+ JavaUtils.capitalizeFirstChar(partName),
+ paramElement);
}
if (isPrimitive){
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl?rev=421268&r1=421267&r2=421268&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl Wed Jul 12 06:21:06 2006
@@ -228,7 +228,29 @@
*/
public <xsl:choose><xsl:when test="$outputtype=''">void</xsl:when><xsl:otherwise><xsl:value-of select="$outputtype"/></xsl:otherwise></xsl:choose>
<xsl:text> </xsl:text><xsl:value-of select="@name"/>(
- <xsl:for-each select="input/param[@type!='']">
+
+ <xsl:variable name="inputcount" select="count(input/param[@location='body' and @type!=''])"/>
+ <xsl:choose>
+ <xsl:when test="$inputcount=1">
+ <!-- Even when the parameters are 1 we have to see whether we have the
+ wrapped parameters -->
+ <xsl:variable name="inputWrappedCount" select="count(input/param[@location='body' and @type!='']/param)"/>
+ <xsl:choose>
+ <xsl:when test="$inputWrappedCount > 0">
+ <xsl:for-each select="input/param[@location='body' and @type!='']/param">
+ <xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="input/param[@location='body' and @type!='']/@type"/><xsl:text> </xsl:text><xsl:value-of select="input/param[@location='body' and @type!='']/@name"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise><!-- Just leave it - nothing we can do here --></xsl:otherwise>
+ </xsl:choose>
+
+ <xsl:if test="$inputcount=1 and input/param[not(@location='body') and @type!='']">,</xsl:if>
+ <xsl:for-each select="input/param[not(@location='body') and @type!='']">
<xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>
</xsl:for-each>)
throws java.rmi.RemoteException
@@ -245,29 +267,38 @@
// create SOAP envelope with that payload
org.apache.axiom.soap.SOAPEnvelope env = null;
- <xsl:variable name="count"><xsl:value-of select="count(input/param[@type!=''])"></xsl:value-of></xsl:variable>
+ <xsl:variable name="count" select="count(input/param[@type!=''])"/>
<xsl:choose>
<!-- test the number of input parameters
If the number of parameter is more then just run the normal test-->
- <xsl:when test="$count>0">
+ <xsl:when test="$count > 0">
<xsl:choose>
<!-- style being doclit or rpc does not matter -->
<xsl:when test="$style='rpc' or $style='document'">
//Style is Doc.
+ <xsl:variable name="inputcount" select="count(input/param[@location='body' and @type!=''])"/>
<xsl:choose>
- <xsl:when test="count(input/param[@location='body' and @type!=''])=1">
- env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),
- <xsl:value-of select="input/param[@location='body' and @type!='']/@name"/>,
- optimizeContent(new javax.xml.namespace.QName("<xsl:value-of select="$method-ns"/>",
- "<xsl:value-of select="$method-name"/>")));
- </xsl:when>
- <xsl:when test="count(input/param[@location='body' and @type!='']) > 1">
- env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),
- <xsl:for-each select="input/param[@location='body' and @type!='']">
- <xsl:value-of select="@name"/>,
- </xsl:for-each>
- optimizeContent(new javax.xml.namespace.QName("<xsl:value-of select="$method-ns"/>",
- "<xsl:value-of select="$method-name"/>")));
+ <xsl:when test="$inputcount=1">
+ <!-- Even when the parameters are 1 we have to see whether we have the
+ wrapped parameters -->
+ <xsl:variable name="inputWrappedCount" select="count(input/param[@location='body' and @type!='']/param)"/>
+ <xsl:choose>
+ <xsl:when test="$inputWrappedCount > 0">
+ env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),
+ <xsl:for-each select="input/param[@location='body' and @type!='']/param">
+ <xsl:value-of select="@name"/>,
+ </xsl:for-each>
+ optimizeContent(new javax.xml.namespace.QName("<xsl:value-of select="$method-ns"/>",
+ "<xsl:value-of select="$method-name"/>")));
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- there are no unwrapped parameters - go ahead and use the normal wrapped codegen-->
+ env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),
+ <xsl:value-of select="input/param[@location='body' and @type!='']/@name"/>,
+ optimizeContent(new javax.xml.namespace.QName("<xsl:value-of select="$method-ns"/>",
+ "<xsl:value-of select="$method-name"/>")));
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:when>
<xsl:otherwise>
env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()));
@@ -404,10 +435,32 @@
</xsl:text></xsl:for-each>
*/
public void start<xsl:value-of select="@name"/>(
- <xsl:variable name="paramCount"><xsl:value-of select="count(input/param[@type!=''])"></xsl:value-of></xsl:variable>
- <xsl:for-each select="input/param[@type!='']">
- <xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"></xsl:value-of></xsl:for-each>
- <xsl:if test="$paramCount>0">,</xsl:if>final <xsl:value-of select="$package"/>.<xsl:value-of select="$callbackname"/> callback)
+
+ <xsl:variable name="inputcount" select="count(input/param[@location='body' and @type!=''])"/>
+ <xsl:choose>
+ <xsl:when test="$inputcount=1">
+ <!-- Even when the parameters are 1 we have to see whether we have the
+ wrapped parameters -->
+ <xsl:variable name="inputWrappedCount" select="count(input/param[@location='body' and @type!='']/param)"/>
+ <xsl:choose>
+ <xsl:when test="$inputWrappedCount > 0">
+ <xsl:for-each select="input/param[@location='body' and @type!='']/param">
+ <xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="input/param[@location='body' and @type!='']/@type"/><xsl:text> </xsl:text><xsl:value-of select="input/param[@location='body' and @type!='']/@name"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise><!-- Just leave it - nothing we can do here --></xsl:otherwise>
+ </xsl:choose>
+ <xsl:if test="$inputcount=1 and input/param[not(@location='body') and @type!='']">,</xsl:if>
+ <xsl:for-each select="input/param[not(@location='body') and @type!='']">
+ <xsl:if test="position() > 1">,</xsl:if><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>
+ </xsl:for-each>
+
+ <xsl:if test="$inputcount > 0">,</xsl:if>final <xsl:value-of select="$package"/>.<xsl:value-of select="$callbackname"/> callback)
throws java.rmi.RemoteException{
@@ -419,36 +472,46 @@
// create SOAP envelope with that payload
org.apache.axiom.soap.SOAPEnvelope env=null;
- <xsl:variable name="count"><xsl:value-of select="count(input/param[@type!=''])"></xsl:value-of></xsl:variable>
+ <xsl:variable name="count" select="count(input/param[@type!=''])"/>
<xsl:choose>
<!-- test the number of input parameters
If the number of parameter is more then just run the normal test-->
- <xsl:when test="$count>0">
+ <xsl:when test="$count > 0">
<xsl:choose>
<xsl:when test="$style='document' or $style='rpc'">
//Style is Doc.
+ <xsl:variable name="inputcount" select="count(input/param[@location='body' and @type!=''])"/>
<xsl:choose>
- <xsl:when test="count(input/param[@location='body' and @type!=''])=1">
- env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),
- <xsl:value-of select="input/param[@location='body' and @type!='']/@name"/>,
- optimizeContent(new javax.xml.namespace.QName("<xsl:value-of select="$method-ns"/>",
- "<xsl:value-of select="$method-name"/>")));
- </xsl:when>
- <xsl:when test="count(input/param[@location='body' and @type!='']) > 1">
- env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),
- <xsl:for-each select="input/param[@location='body' and @type!='']">
- <xsl:value-of select="@name"/>,
- </xsl:for-each>
- optimizeContent(new javax.xml.namespace.QName("<xsl:value-of select="$method-ns"/>",
- "<xsl:value-of select="$method-name"/>")));
+ <xsl:when test="$inputcount=1">
+ <!-- Even when the parameters are 1 we have to see whether we have the
+ wrapped parameters -->
+ <xsl:variable name="inputWrappedCount" select="count(input/param[@location='body' and @type!='']/param)"/>
+ <xsl:choose>
+ <xsl:when test="$inputWrappedCount > 0">
+ env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),
+ <xsl:for-each select="input/param[@location='body' and @type!='']/param">
+ <xsl:value-of select="@name"/>,
+ </xsl:for-each>
+ optimizeContent(new javax.xml.namespace.QName("<xsl:value-of select="$method-ns"/>",
+ "<xsl:value-of select="$method-name"/>")));
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- there are no unwrapped parameters - go ahead and use the normal wrapped codegen-->
+ env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),
+ <xsl:value-of select="input/param[@location='body' and @type!='']/@name"/>,
+ optimizeContent(new javax.xml.namespace.QName("<xsl:value-of select="$method-ns"/>",
+ "<xsl:value-of select="$method-name"/>")));
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:when>
<xsl:otherwise>
env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()));
</xsl:otherwise>
</xsl:choose>
+
<xsl:choose>
<!-- If there are headers then build the envelope -->
- <xsl:when test="count(input/param[@location='header'])>0">
+ <xsl:when test="count(input/param[@location='header']) > 0">
env.build();
</xsl:when>
</xsl:choose>
@@ -525,13 +588,40 @@
</xsl:if>
<!-- End of in-out mep -->
</xsl:if>
+
+
+
+
<!-- Start of in only mep-->
<xsl:if test="$mep='10'"> <!-- These constants can be found in org.apache.axis2.wsdl.WSDLConstants -->
<!-- for the in only mep there is no notion of sync or async. And there is no return type also -->
public void <xsl:text> </xsl:text><xsl:value-of select="@name"/>(
- <xsl:for-each select="input/param[@type!='']">
- <xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>
- </xsl:for-each>) throws java.rmi.RemoteException{
+ <xsl:variable name="inputcount" select="count(input/param[@location='body' and @type!=''])"/>
+ <xsl:choose>
+ <xsl:when test="$inputcount=1">
+ <!-- Even when the parameters are 1 we have to see whether we have the
+ wrapped parameters -->
+ <xsl:variable name="inputWrappedCount" select="count(input/param[@location='body' and @type!='']/param)"/>
+ <xsl:choose>
+ <xsl:when test="$inputWrappedCount > 0">
+ <xsl:for-each select="input/param[@location='body' and @type!='']/param">
+ <xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="input/param[@location='body' and @type!='']/@type"/><xsl:text> </xsl:text><xsl:value-of select="input/param[@location='body' and @type!='']/@name"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise><!-- Just leave it - nothing we can do here --></xsl:otherwise>
+ </xsl:choose>
+
+ <xsl:if test="$inputcount=1 and input/param[not(@location='body') and @type!='']">,</xsl:if>
+ <xsl:for-each select="input/param[not(@location='body') and @type!='']">
+ <xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>
+ </xsl:for-each>
+
+ ) throws java.rmi.RemoteException{
org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[<xsl:value-of select="position()-1"/>].getName());
_operationClient.getOptions().setAction("<xsl:value-of select="$soapAction"/>");
@@ -540,36 +630,78 @@
<xsl:for-each select="input/param[@Action!='']">_operationClient.getOptions().setAction("<xsl:value-of select="@Action"/>");</xsl:for-each>
org.apache.axiom.soap.SOAPEnvelope env = null;
- <xsl:choose>
- <!-- test the number of input parameters
- If the number of parameter is more then just run the normal generation-->
- <xsl:when test="count(input/param[@type!=''])>0">
- <xsl:choose>
- <xsl:when test="$style='document' or $style='rpc'">
- <!-- for the doc lit case there can be only one element. So take the first element -->
- //Style is Doc.
- env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), <xsl:value-of select="input/param[1]/@name"/>, optimizeContent(new javax.xml.namespace.QName("<xsl:value-of select="$method-ns"/>", "<xsl:value-of select="$method-name"/>")));
- </xsl:when>
- <xsl:otherwise>
- //Unknown style detected !! No code is generated
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <!-- No input parameters present. So generate assuming no input parameters-->
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="$style='document' or $style='rpc'">
- //Style is Doc. No input parameters
- org.apache.axiom.soap.SOAPFactory factory = getFactory(_operationClient.getOptions().getSoapVersionURI());
- env = factory.getDefaultEnvelope();
- env.getBody().addChild(factory.createOMElement("<xsl:value-of select="$method-name"/>", "<xsl:value-of select="$method-ns"/>", ""));
- </xsl:when>
- <xsl:otherwise>
- //Unknown style detected !! No code is generated
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:variable name="count" select="count(input/param[@type!=''])"/>
+ <xsl:choose>
+ <!-- test the number of input parameters
+ If the number of parameter is more then just run the normal test-->
+ <xsl:when test="$count > 0">
+ <xsl:choose>
+ <!-- style being doclit or rpc does not matter -->
+ <xsl:when test="$style='rpc' or $style='document'">
+ //Style is Doc.
+ <xsl:variable name="inputcount" select="count(input/param[@location='body' and @type!=''])"/>
+ <xsl:choose>
+ <xsl:when test="$inputcount=1">
+ <!-- Even when the parameters are 1 we have to see whether we have the
+ wrapped parameters -->
+ <xsl:variable name="inputWrappedCount" select="count(input/param[@location='body' and @type!='']/param)"/>
+ <xsl:choose>
+ <xsl:when test="$inputWrappedCount > 0">
+ env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),
+ <xsl:for-each select="input/param[@location='body' and @type!='']/param">
+ <xsl:value-of select="@name"/>,
+ </xsl:for-each>
+ optimizeContent(new javax.xml.namespace.QName("<xsl:value-of select="$method-ns"/>",
+ "<xsl:value-of select="$method-name"/>")));
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- there are no unwrapped parameters - go ahead and use the normal wrapped codegen-->
+ env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),
+ <xsl:value-of select="input/param[@location='body' and @type!='']/@name"/>,
+ optimizeContent(new javax.xml.namespace.QName("<xsl:value-of select="$method-ns"/>",
+ "<xsl:value-of select="$method-name"/>")));
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()));
+ </xsl:otherwise>
+ </xsl:choose>
+
+ <xsl:choose>
+ <!-- If there are headers then build the envelope -->
+ <xsl:when test="count(input/param[@location='header'])>0">
+ env.build();
+ </xsl:when>
+ </xsl:choose>
+ <xsl:for-each select="input/param[@location='header']">
+ // add the children only if the parameter is not null
+ if (<xsl:value-of select="@name"/>!=null){
+ env.getHeader().addChild(toOM(<xsl:value-of select="@name"/>, optimizeContent(new javax.xml.namespace.QName("<xsl:value-of select="$method-ns"/>", "<xsl:value-of select="$method-name"/>"))));
+ }
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ //Unknown style detected !! No code is generated
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <!-- No input parameters present. So generate assuming no input parameters-->
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="$style='rpc' or $style='document'">
+ //Style is taken to be "document". No input parameters
+ org.apache.axiom.soap.SOAPFactory factory = getFactory(_operationClient.getOptions().getSoapVersionURI());
+ env = factory.getDefaultEnvelope();
+ env.getBody().addChild(factory.createOMElement("<xsl:value-of select="$method-name"/>", "<xsl:value-of select="$method-ns"/>", ""));
+ </xsl:when>
+ <xsl:otherwise>
+ //Unknown style detected !! No code is generated
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+
// create message context with that soap envelope
org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext() ;
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/MessageReceiverTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/MessageReceiverTemplate.xsl?rev=421268&r1=421267&r2=421268&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/MessageReceiverTemplate.xsl (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/MessageReceiverTemplate.xsl Wed Jul 12 06:21:06 2006
@@ -78,73 +78,51 @@
<!-- We really don't need to make a difference between these-->
<xsl:when test="$style='document' or $style='rpc'">
//doc style
- <xsl:variable name="paramCount"><xsl:value-of select="count(input/param[@location='body' and @type!=''])"/></xsl:variable>
- <xsl:choose>
- <!-- more than 1 argument - assume to be unwrapped -->
- <xsl:when test="$paramCount > 1">
- java.util.List eltList = explode(
- msgContext.getEnvelope().getBody().getFirstElement());
- <xsl:if test="$returntype!=''"><xsl:value-of select="$returnvariable"/> =</xsl:if>
- skel.<xsl:value-of select="@name"/>(
- <xsl:for-each select="input/param[@location='body' and @type!='']">
- <xsl:if test="position() > 1">,</xsl:if>
- <xsl:choose>
- <xsl:when test="@primitive">
- convertTo<xsl:value-of select="@shorttype"/>((org.apache.axiom.om.OMElement)eltList.get(<xsl:value-of select="position()-1"/>))
- </xsl:when>
- <xsl:otherwise>
- (<xsl:value-of select="@type"/>)fromOM(
- (org.apache.axiom.om.OMElement)eltList.get(<xsl:value-of select="position()-1"/>),
- <xsl:value-of select="@type"/>.class,
- getEnvelopeNamespaces(msgContext.getEnvelope()))
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>);
- </xsl:when>
- <!-- for a single parmeter we have to take care in taking the OMelement.
- The logic will be to check the partname attribute to determine
- whether it is wrapped or unwrapped
- -->
- <xsl:when test="$paramCount=1">
- <xsl:if test="input/param[@location='body' and @type!='']/@partname">
- java.util.List eltList = explode(
- msgContext.getEnvelope().getBody().getFirstElement());
- </xsl:if>
- <xsl:if test="$returntype!=''"><xsl:value-of select="$returnvariable"/> =</xsl:if>
- skel.<xsl:value-of select="@name"/>(
- <xsl:choose>
- <xsl:when test="input/param[@location='body' and @type!='' and @partname]/@primitive">
- <!--convert from the elt list -->
- convertTo<xsl:value-of select="@shorttype"/>((org.apache.axiom.om.OMElement)eltList.get(0))
- </xsl:when>
- <xsl:when test="input/param[@location='body' and @type!='' and not(@partname)]/@primitive">
- <!-- convert from the root child-->
- convertTo<xsl:value-of select="@shorttype"/>(msgContext.getEnvelope().getBody().getFirstElement())
- </xsl:when>
- <xsl:when test="(input/param[@location='body' and @type!='' and @partname and not(@primitive)])">
- <!--convert from the elt list -->
- (<xsl:value-of select="input/param[@location='body' and @type!='']/@type"/>)fromOM(
- (org.apache.axiom.om.OMElement)eltList.get(0),
- <xsl:value-of select="input/param[@location='body' and @type!='']/@type"/>.class,
- getEnvelopeNamespaces(msgContext.getEnvelope()))
-
- </xsl:when>
- <xsl:otherwise>
- (<xsl:value-of select="input/param[@location='body' and @type!='']/@type"/>)fromOM(
+ <xsl:variable name="inputcount" select="count(input/param[@location='body' and @type!=''])"/>
+ <xsl:variable name="inputtype" select="input/param[@location='body' and @type!='']/@type"/>
+
+
+ <xsl:value-of select="$inputtype"/> wrappedParam =
+ (<xsl:value-of select="$inputtype"/>)fromOM(
msgContext.getEnvelope().getBody().getFirstElement(),
- <xsl:value-of select="input/param[@location='body' and @type!='']/@type"/>.class,
- getEnvelopeNamespaces(msgContext.getEnvelope()))
- </xsl:otherwise>
- </xsl:choose>
- );
- </xsl:when>
- <!--No input parameters-->
-
- <xsl:otherwise>
- <xsl:if test="$returntype!=''"><xsl:value-of select="$returnvariable"/> =</xsl:if>
- skel.<xsl:value-of select="@name"/>();</xsl:otherwise>
- </xsl:choose>
+ <xsl:value-of select="$inputtype"/>.class,
+ getEnvelopeNamespaces(msgContext.getEnvelope()));
+
+ <xsl:choose>
+ <xsl:when test="$inputcount=1">
+ <!-- Even when the parameters are 1 we have to see whether we have the
+ wrapped parameters -->
+ <xsl:variable name="inputWrappedCount" select="count(input/param[@location='body' and @type!='']/param)"/>
+ <xsl:choose>
+ <xsl:when test="$inputWrappedCount > 0">
+ <!-- generate the references. the getters need to be
+ generated by the databinding-->
+ <xsl:for-each select="input/param[@location='body' and @type!='']/param">
+ <xsl:value-of select="@type"/> param<xsl:value-of select="position()"/>
+ = get<xsl:value-of select="@partname"/>(wrappedParam);
+ </xsl:for-each>
+
+ <xsl:if test="$returntype!=''"><xsl:value-of select="$returnvariable"/> =</xsl:if>
+ skel.<xsl:value-of select="@name"/>(
+ <xsl:for-each select="input/param[@location='body' and @type!='']/param">
+ <xsl:if test="position() > 1">,</xsl:if>
+ param<xsl:value-of select="position()"/>
+ </xsl:for-each>
+
+ );
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="$returntype!=''"><xsl:value-of select="$returnvariable"/> =</xsl:if>
+ skel.<xsl:value-of select="@name"/>(wrappedParam) ;
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="$returntype!=''"><xsl:value-of select="$returnvariable"/> =</xsl:if>
+ skel.<xsl:value-of select="@name"/>();
+ </xsl:otherwise>
+ </xsl:choose>
<xsl:choose>
<xsl:when test="$returntype!=''">
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonInterfaceTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonInterfaceTemplate.xsl?rev=421268&r1=421267&r2=421268&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonInterfaceTemplate.xsl (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonInterfaceTemplate.xsl Wed Jul 12 06:21:06 2006
@@ -25,9 +25,27 @@
</xsl:text></xsl:if></xsl:for-each>
*/
public <xsl:if test="$count=0 or $outputtype=''">void</xsl:if><xsl:if test="$outputtype!=''"><xsl:value-of select="$outputtype"/></xsl:if><xsl:text> </xsl:text><xsl:value-of select="@name"/>
- (<xsl:for-each select="input/param[@location='body']">
- <xsl:if test="@type!=''"><xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"/></xsl:if>
- </xsl:for-each> )
+ (
+ <xsl:variable name="inputcount" select="count(input/param[@location='body' and @type!=''])"/>
+ <xsl:choose>
+ <xsl:when test="$inputcount=1">
+ <!-- Even when the parameters are 1 we have to see whether we have the
+ wrapped parameters -->
+ <xsl:variable name="inputWrappedCount" select="count(input/param[@location='body' and @type!='']/param)"/>
+ <xsl:choose>
+ <xsl:when test="$inputWrappedCount > 0">
+ <xsl:for-each select="input/param[@location='body' and @type!='']/param">
+ <xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="input/param[@location='body' and @type!='']/@type"/><xsl:text> </xsl:text><xsl:value-of select="input/param[@location='body' and @type!='']/@name"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise><!-- Just leave it - nothing we can do here --></xsl:otherwise>
+ </xsl:choose>
+ )
<!--add the faults-->
<xsl:for-each select="fault/param[@type!='']">
<xsl:if test="position()=1">throws </xsl:if>
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonTemplate.xsl?rev=421268&r1=421267&r2=421268&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 Jul 12 06:21:06 2006
@@ -26,9 +26,27 @@
</xsl:text></xsl:if></xsl:for-each>
*/
public <xsl:if test="$count=0 or $outputtype=''">void</xsl:if><xsl:if test="$outputtype!=''"><xsl:value-of select="$outputtype"/></xsl:if><xsl:text> </xsl:text><xsl:value-of select="@name"/>
- (<xsl:for-each select="input/param[@location='body']">
- <xsl:if test="@type!=''"><xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"/></xsl:if>
- </xsl:for-each> )
+ (
+ <xsl:variable name="inputcount" select="count(input/param[@location='body' and @type!=''])"/>
+ <xsl:choose>
+ <xsl:when test="$inputcount=1">
+ <!-- Even when the parameters are 1 we have to see whether we have the
+ wrapped parameters -->
+ <xsl:variable name="inputWrappedCount" select="count(input/param[@location='body' and @type!='']/param)"/>
+ <xsl:choose>
+ <xsl:when test="$inputWrappedCount > 0">
+ <xsl:for-each select="input/param[@location='body' and @type!='']/param">
+ <xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@type"/><xsl:text> </xsl:text><xsl:value-of select="@name"/>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="input/param[@location='body' and @type!='']/@type"/><xsl:text> </xsl:text><xsl:value-of select="input/param[@location='body' and @type!='']/@name"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise><!-- Just leave it - nothing we can do here --></xsl:otherwise>
+ </xsl:choose>
+ )
<!--add the faults-->
<xsl:for-each select="fault/param[@type!='']">
<xsl:if test="position()=1">throws </xsl:if>
Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java?rev=421268&r1=421267&r2=421268&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java Wed Jul 12 06:21:06 2006
@@ -15,6 +15,7 @@
import org.apache.ws.policy.PolicyReference;
import org.apache.ws.policy.util.DOMPolicyReader;
import org.apache.ws.policy.util.PolicyFactory;
+import org.apache.woden.internal.util.dom.DOM2Writer;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.xml.sax.SAXException;
@@ -768,9 +769,8 @@
Element newComplexType = document.createElementNS(
XMLSCHEMA_NAMESPACE_URI, xsdPrefix + ":"
+ XML_SCHEMA_COMPLEX_TYPE_LOCAL_NAME);
- newComplexType.setAttribute(XSD_NAME, name);
- Element cmplxContentSequence = document.createElementNS(
+ Element cmplxTypeSequence = document.createElementNS(
XMLSCHEMA_NAMESPACE_URI, xsdPrefix + ":"
+ XML_SCHEMA_SEQUENCE_LOCAL_NAME);
Element child;
@@ -835,9 +835,9 @@
child.setAttribute(XSD_REF, prefix + ":"
+ schemaTypeName.getLocalPart());
}
- cmplxContentSequence.appendChild(child);
+ cmplxTypeSequence.appendChild(child);
}
- newComplexType.appendChild(cmplxContentSequence);
+ newComplexType.appendChild(cmplxTypeSequence);
//add this newly created complextype to the list
complexTypeElementsMap.put(wsdl4jMessage.getQName(),
newComplexType);
@@ -858,10 +858,10 @@
+ XML_SCHEMA_ELEMENT_LOCAL_NAME);
elementDeclaration.setAttribute(XSD_NAME, inputOpName);
- String typeValue = ((Message) inputOperationsMap.get(inputOpName))
- .getQName().getLocalPart();
- elementDeclaration.setAttribute(XSD_TYPE, AXIS2WRAPPED + ":"
- + typeValue);
+ QName typeQName = ((Message) inputOperationsMap.get(inputOpName))
+ .getQName();
+ // add the anonymous
+ elementDeclaration.appendChild((Element)complexTypeElementsMap.get(typeQName));
elementElementsList.add(elementDeclaration);
resolvedRpcWrappedElementMap.put(inputOpName, new QName(
targetNamespaceUri, inputOpName, AXIS2WRAPPED));
@@ -878,10 +878,13 @@
XMLSCHEMA_NAMESPACE_URI, xsdPrefix + ":"
+ XML_SCHEMA_ELEMENT_LOCAL_NAME);
elementDeclaration.setAttribute(XSD_NAME, outputOpName);
- String typeValue = ((Message) outputOperationsMap
- .get(baseoutputOpName)).getQName().getLocalPart();
- elementDeclaration.setAttribute(XSD_TYPE, AXIS2WRAPPED + ":"
- + typeValue);
+
+ QName typeQName = ((Message) outputOperationsMap
+ .get(baseoutputOpName)).getQName();
+ // add the anonymous
+ elementDeclaration.appendChild((Element)complexTypeElementsMap.get(typeQName));
+ elementElementsList.add(elementDeclaration);
+
elementElementsList.add(elementDeclaration);
resolvedRpcWrappedElementMap.put(outputOpName, new QName(
targetNamespaceUri, outputOpName, AXIS2WRAPPED));
@@ -898,10 +901,10 @@
XMLSCHEMA_NAMESPACE_URI, xsdPrefix + ":"
+ XML_SCHEMA_ELEMENT_LOCAL_NAME);
elementDeclaration.setAttribute(XSD_NAME, baseFaultOpName);
- String typeValue = ((Message) faultyOperationsMap
- .get(baseFaultOpName)).getQName().getLocalPart();
- elementDeclaration.setAttribute(XSD_TYPE, AXIS2WRAPPED + ":"
- + typeValue);
+
+ QName typeQName = ((Message) faultyOperationsMap
+ .get(baseFaultOpName)).getQName();
+ elementDeclaration.appendChild((Element)complexTypeElementsMap.get(typeQName));
elementElementsList.add(elementDeclaration);
resolvedRpcWrappedElementMap.put(baseFaultOpName, new QName(
targetNamespaceUri, baseFaultOpName, AXIS2WRAPPED));
@@ -942,12 +945,12 @@
}
- Element[] complexTypeElements = (Element[]) complexTypeElementsMap
- .values().toArray(new Element[complexTypeElementsMap.size()]);
- for (int i = 0; i < complexTypeElements.length; i++) {
- schemaElement.appendChild(complexTypeElements[i]);
-
- }
+// Element[] complexTypeElements = (Element[]) complexTypeElementsMap
+// .values().toArray(new Element[complexTypeElementsMap.size()]);
+// for (int i = 0; i < complexTypeElements.length; i++) {
+// schemaElement.appendChild(complexTypeElements[i]);
+//
+// }
Element[] elementDeclarations = (Element[]) elementElementsList
.toArray(new Element[elementElementsList.size()]);
@@ -956,6 +959,9 @@
}
+ //////////////////////////////////////////////////////////////////
+ //System.out.println(DOM2Writer.nodeToString(schemaElement));
+ /////////////////////////////////////////////////////////////////
return schemaElement;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org