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 am...@apache.org on 2007/02/22 11:55:12 UTC
svn commit: r510458 - in /webservices/axis2/trunk/java/modules: codegen/
codegen/src/org/apache/axis2/wsdl/template/java/ integration/
integration/test-resources/wsdl/
Author: amilas
Date: Thu Feb 22 02:55:11 2007
New Revision: 510458
URL: http://svn.apache.org/viewvc?view=rev&rev=510458
Log:
fixed inonly message receiver for unwrapping
Added:
webservices/axis2/trunk/java/modules/integration/test-resources/wsdl/RPCUnwrappingTest.wsdl
Modified:
webservices/axis2/trunk/java/modules/codegen/maven.xml
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/MessageReceiverTemplate.xsl
webservices/axis2/trunk/java/modules/integration/maven.xml
webservices/axis2/trunk/java/modules/integration/test-resources/wsdl/DocumentUnwrappingTest.wsdl
Modified: webservices/axis2/trunk/java/modules/codegen/maven.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/maven.xml?view=diff&rev=510458&r1=510457&r2=510458
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/maven.xml (original)
+++ webservices/axis2/trunk/java/modules/codegen/maven.xml Thu Feb 22 02:55:11 2007
@@ -28,4 +28,5 @@
</j:if>
</preGoal>
+
</project>
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?view=diff&rev=510458&r1=510457&r2=510458
==============================================================================
--- 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 Thu Feb 22 02:55:11 2007
@@ -80,7 +80,7 @@
<xsl:choose>
<!-- We really don't need to make a difference between these-->
<xsl:when test="$style='document' or $style='rpc'">
- //doc style
+
<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:variable name="inputComplexType" select="input/param[@location='body' and @type!='']/@complextype"/>
@@ -326,26 +326,39 @@
<xsl:variable name="usedbmethod"><xsl:value-of select="@usedbmethod"/></xsl:variable>
<xsl:choose>
<xsl:when test="string-length(normalize-space($usedbmethod))=0">
- <xsl:choose>
- <xsl:when test="$style='rpc'">
- //rpc style -- this needs to be filled
+ <xsl:choose>
+ <!-- style does not matter since we create the message formats correctly -->
+ <xsl:when test="$style='rpc' or $style='document'">
- </xsl:when>
- <xsl:when test="$style='document'">
- //doc style
- <xsl:variable name="paramCount"><xsl:value-of select="count(input/param[@location='body'])"/></xsl:variable>
+ <xsl:variable name="paramCount" select="count(input/param[@location='body' and @type!=''])"/>
+ <xsl:variable name="inputWrappedCount" select="count(input/param[@location='body' and @type!='']/param)"/>
<xsl:choose>
- <xsl:when test="$paramCount > 0"> skel.<xsl:value-of select="@name"/>(
- <xsl:for-each select="input/param[@location='body']">
- <xsl:if test="@type!=''">(<xsl:value-of select="@type"/>)fromOM(
- inMessage.getEnvelope().getBody().getFirstElement(),
- <xsl:value-of select="@type"/>.class,
- getEnvelopeNamespaces(inMessage.getEnvelope())
- )<xsl:if test="position() > 1">,</xsl:if></xsl:if>
- </xsl:for-each>);
+ <xsl:when test="$paramCount =1">
+ <xsl:value-of select="input/param[@location='body' and @type!='']/@type"/> wrappedParam = (<xsl:value-of select="input/param[@location='body' and @type!='']/@type"/>)fromOM(
+ inMessage.getEnvelope().getBody().getFirstElement(),
+ <xsl:value-of select="input/param[@location='body' and @type!='']/@type"/>.class,
+ getEnvelopeNamespaces(inMessage.getEnvelope()));
+ <xsl:choose>
+ <xsl:when test="($inputWrappedCount > 0)">
+ <!-- generate the references. the getters need to be
+ generated by the databinding-->
+
+ <!-- wrap it if it in unwarping mode -->
+ skel.<xsl:value-of select="@name"/>(
+ <xsl:for-each select="input/param[@location='body' and @type!='']/param">
+ <xsl:if test="position() > 1">,</xsl:if>
+ get<xsl:value-of select="@partname"/>(wrappedParam)
+ </xsl:for-each>);
+ </xsl:when>
+ <xsl:otherwise>
+ skel.<xsl:value-of select="@name"/>(wrappedParam);
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:when>
- <xsl:otherwise>skel.<xsl:value-of select="@name"/>();</xsl:otherwise>
+ <xsl:otherwise>
+ skel.<xsl:value-of select="@name"/>();
+ </xsl:otherwise>
</xsl:choose>
</xsl:when>
@@ -354,6 +367,7 @@
throw new UnsupportedOperationException("Unknown Style");
</xsl:otherwise>
</xsl:choose>
+
</xsl:when>
<xsl:otherwise>
Modified: webservices/axis2/trunk/java/modules/integration/maven.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/maven.xml?view=diff&rev=510458&r1=510457&r2=510458
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/maven.xml (original)
+++ webservices/axis2/trunk/java/modules/integration/maven.xml Thu Feb 22 02:55:11 2007
@@ -43,6 +43,16 @@
</java>
<ant:ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="target/wsdl/documentunwrapping"/>
+ <ant:echo>Compiling RPCUnwrappingTest.wsdl </ant:echo>
+ <mkdir dir="${wsdl.output.base.dir}/rpcunwrapping"/>
+ <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
+ <jvmarg line="${maven.junit.jvmargs}"/>
+ <classpath refid="maven.dependency.classpath"/>
+ <classpath location="${compiled.classes.dir}"/>
+ <arg line="-o target/wsdl/rpcunwrapping -ss -sd -ssi -u -t -g -uw -uri test-resources/wsdl/RPCUnwrappingTest.wsdl"/>
+ </java>
+ <ant:ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="target/wsdl/rpcunwrapping"/>
+
<java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
<classpath refid="maven.dependency.classpath"/>
<arg line="-d xmlbeans -p samples.wsdl.perf -o target/perf -s -t -ss -sd -g -uri test/samples/wsdl/perf/perf.wsdl"/>
Modified: webservices/axis2/trunk/java/modules/integration/test-resources/wsdl/DocumentUnwrappingTest.wsdl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/test-resources/wsdl/DocumentUnwrappingTest.wsdl?view=diff&rev=510458&r1=510457&r2=510458
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test-resources/wsdl/DocumentUnwrappingTest.wsdl (original)
+++ webservices/axis2/trunk/java/modules/integration/test-resources/wsdl/DocumentUnwrappingTest.wsdl Thu Feb 22 02:55:11 2007
@@ -63,14 +63,52 @@
</xsd:sequence>
</xsd:complexType>
+ <xsd:element name="Request5" >
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="tns:AbstractComplexType">
+ <xsd:sequence>
+ <xsd:element name="parm3" type="xsd:string"/>
+ <xsd:any></xsd:any>
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:element name="Response5" >
+ <xsd:complexType>
+ <xsd:complexContent>
+ <xsd:extension base="tns:AbstractComplexType">
+ <xsd:sequence>
+ <xsd:element name="parm3" type="xsd:string"/>
+ <xsd:any></xsd:any>
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:element name="Request6" type="tns:ChildComplexType"/>
+ <xsd:element name="Response6" type="tns:ChildComplexType"/>
+
<xsd:complexType name="AbstractComplexType">
<xsd:sequence>
- <xsd:element name="param1" type="xsd:string"/>
+ <xsd:element name="param1" type="xsd:anyType"/>
<xsd:element name="param2" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
-
+ <xsd:complexType name="ChildComplexType">
+ <xsd:complexContent>
+ <xsd:extension base="tns:AbstractComplexType">
+ <xsd:sequence>
+ <xsd:element name="parm3" type="xsd:string"/>
+ <xsd:any></xsd:any>
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
</xsd:schema>
</wsdl:types>
<wsdl:message name="OperationRequestMessage1">
@@ -101,6 +139,24 @@
<wsdl:part element="tns:Response4" name="parameters"/>
</wsdl:message>
+ <wsdl:message name="OperationRequestMessage5">
+ <wsdl:part element="tns:Request5" name="parameters"/>
+ </wsdl:message>
+ <wsdl:message name="OperationResponseMessage5">
+ <wsdl:part element="tns:Response5" name="parameters"/>
+ </wsdl:message>
+
+ <wsdl:message name="OperationRequestMessage6">
+ <wsdl:part element="tns:Request6" name="parameters"/>
+ </wsdl:message>
+ <wsdl:message name="OperationResponseMessage6">
+ <wsdl:part element="tns:Response6" name="parameters"/>
+ </wsdl:message>
+
+ <wsdl:message name="FaultMessage">
+ <wsdl:part element="tns:Request1" name="parameters"/>
+ </wsdl:message>
+
<wsdl:portType name="DocumentUnwrappingPortType">
<wsdl:operation name="Operation1">
<wsdl:input message="tns:OperationRequestMessage1"/>
@@ -118,6 +174,23 @@
<wsdl:input message="tns:OperationRequestMessage4"/>
<wsdl:output message="tns:OperationResponseMessage4"/>
</wsdl:operation>
+ <wsdl:operation name="Operation5">
+ <wsdl:input message="tns:OperationRequestMessage5"/>
+ <wsdl:output message="tns:OperationResponseMessage5"/>
+ </wsdl:operation>
+ <wsdl:operation name="Operation6">
+ <wsdl:input message="tns:OperationRequestMessage6"/>
+ <wsdl:output message="tns:OperationResponseMessage6"/>
+ </wsdl:operation>
+
+ <wsdl:operation name="Operation7">
+ <wsdl:input message="tns:OperationRequestMessage1"/>
+ </wsdl:operation>
+
+ <wsdl:operation name="Operation8">
+ <wsdl:input message="tns:OperationRequestMessage1"/>
+ <wsdl:fault message="tns:FaultMessage" name="TestFault"/>
+ </wsdl:operation>
</wsdl:portType>
<wsdl:binding name="DocumentUnwrappingTestBinding" type="tns:DocumentUnwrappingPortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
@@ -156,6 +229,39 @@
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="Operation5">
+ <soap:operation soapAction="http://www.example.org/wsdltest/Operation5"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="Operation6">
+ <soap:operation soapAction="http://www.example.org/wsdltest/Operation6"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="Operation7">
+ <soap:operation soapAction="http://www.example.org/wsdltest/Operation6"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ </wsdl:operation>
+ <wsdl:operation name="Operation8">
+ <soap:operation soapAction="http://www.example.org/wsdltest/Operation6"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:fault name="TestFault">
+ <soap:body use="literal" name="TestFault"/>
+ </wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="DocumentUnwrappingTestService">
Added: webservices/axis2/trunk/java/modules/integration/test-resources/wsdl/RPCUnwrappingTest.wsdl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/test-resources/wsdl/RPCUnwrappingTest.wsdl?view=auto&rev=510458
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test-resources/wsdl/RPCUnwrappingTest.wsdl (added)
+++ webservices/axis2/trunk/java/modules/integration/test-resources/wsdl/RPCUnwrappingTest.wsdl Thu Feb 22 02:55:11 2007
@@ -0,0 +1,141 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions name="wsdladmintest"
+ targetNamespace="http://www.example.org/wsdltest/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:tns="http://www.example.org/wsdltest/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <wsdl:types>
+ <xsd:schema targetNamespace="http://www.example.org/wsdltest/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:p="http://schemas.xmlsoap.org/wsdl/soap/">
+ <xsd:complexType name="RequestType1">
+ <xsd:sequence>
+ <xsd:element name="param1" type="xsd:int"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:complexType name="ResponseType1">
+ <xsd:sequence>
+ <xsd:element name="param1" type="xsd:int"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:complexType name="AbstractType">
+ <xsd:sequence>
+ <xsd:element name="param1" type="xsd:int"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:complexType name="RequestType2">
+ <xsd:complexContent>
+ <xsd:extension base="tns:AbstractType">
+ <xsd:sequence>
+ <xsd:element name="param2" type="xsd:int"/>
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ <xsd:complexType name="ResponseType2">
+ <xsd:complexContent>
+ <xsd:extension base="tns:AbstractType">
+ <xsd:sequence>
+ <xsd:element name="param2" type="xsd:int"/>
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+ </xsd:schema>
+ </wsdl:types>
+
+ <wsdl:message name="OperationRequestMessage1">
+ <wsdl:part name="part1" type="xsd:string"/>
+ </wsdl:message>
+ <wsdl:message name="OperationResponseMessage1">
+ <wsdl:part name="part1" type="xsd:string"/>
+ </wsdl:message>
+
+ <wsdl:message name="OperationRequestMessage2">
+ <wsdl:part name="part1" type="xsd:string"/>
+ <wsdl:part name="part2" type="xsd:int"/>
+ </wsdl:message>
+ <wsdl:message name="OperationResponseMessage2">
+ <wsdl:part name="part1" type="xsd:string"/>
+ <wsdl:part name="part2" type="xsd:boolean"/>
+ </wsdl:message>
+
+ <wsdl:message name="OperationRequestMessage3">
+ <wsdl:part name="part1" type="tns:RequestType1"/>
+ </wsdl:message>
+ <wsdl:message name="OperationResponseMessage3">
+ <wsdl:part name="part1" type="tns:ResponseType1"/>
+ </wsdl:message>
+
+ <wsdl:message name="OperationRequestMessage4">
+ <wsdl:part name="part1" type="tns:RequestType2"/>
+ </wsdl:message>
+ <wsdl:message name="OperationResponseMessage4">
+ <wsdl:part name="part1" type="tns:ResponseType2"/>
+ </wsdl:message>
+
+ <wsdl:portType name="RPCUnwrappingPortType">
+ <wsdl:operation name="Operation1">
+ <wsdl:input message="tns:OperationRequestMessage1"/>
+ <wsdl:output message="tns:OperationResponseMessage1"/>
+ </wsdl:operation>
+ <wsdl:operation name="Operation2">
+ <wsdl:input message="tns:OperationRequestMessage2"/>
+ <wsdl:output message="tns:OperationResponseMessage2"/>
+ </wsdl:operation>
+ <wsdl:operation name="Operation3">
+ <wsdl:input message="tns:OperationRequestMessage3"/>
+ <wsdl:output message="tns:OperationResponseMessage3"/>
+ </wsdl:operation>
+ <wsdl:operation name="Operation4">
+ <wsdl:input message="tns:OperationRequestMessage4"/>
+ <wsdl:output message="tns:OperationResponseMessage4"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="RPCUnwrappingBinding" type="tns:RPCUnwrappingPortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="Operation1">
+ <soap:operation soapAction="http://www.example.org/wsdltest/Operation1"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="Operation2">
+ <soap:operation soapAction="http://www.example.org/wsdltest/Operation2"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="Operation3">
+ <soap:operation soapAction="http://www.example.org/wsdltest/Operation2"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="Operation4">
+ <soap:operation soapAction="http://www.example.org/wsdltest/Operation2"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="RPCUnwrappingServiceTest">
+ <wsdl:port binding="tns:RPCUnwrappingBinding" name="port1">
+ <soap:address location="http://www.example.org/"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
+
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org