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/06 18:51:57 UTC
svn commit: r419617 - in /webservices/axis2/trunk/java/modules:
adb-codegen/src/org/apache/axis2/schema/template/ integration/
integration/test-resources/rpc/
Author: ajith
Date: Thu Jul 6 09:51:57 2006
New Revision: 419617
URL: http://svn.apache.org/viewvc?rev=419617&view=rev
Log:
1. Added two tests that generate unwrapped code in ADB style and compile.
2. Fixed few minor errors in the ADBDatabindingTemplate.xsl
Added:
webservices/axis2/trunk/java/modules/integration/test-resources/rpc/
webservices/axis2/trunk/java/modules/integration/test-resources/rpc/test-rpc-2.wsdl
webservices/axis2/trunk/java/modules/integration/test-resources/rpc/test-rpc-3.wsdl
Modified:
webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBDatabindingTemplate.xsl
webservices/axis2/trunk/java/modules/integration/maven.xml
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=419617&r1=419616&r2=419617&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 Thu Jul 6 09:51:57 2006
@@ -13,7 +13,7 @@
};
</xsl:if>
<!-- generate toOM for only non parts - this is WRONG!!!! -->
- <xsl:for-each select="param[@type!='' and not(@primitive)]">
+ <xsl:for-each select="param[@type!='' and not(@primitive) and not(@partname)]">
private org.apache.axiom.om.OMElement toOM(<xsl:value-of select="@type"/> param, boolean optimizeContent){
return param.getOMElement(param.MY_QNAME,
org.apache.axiom.om.OMAbstractFactory.getOMFactory());
@@ -43,18 +43,19 @@
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]">
- elt = fac.createOMElement("<xsl:value-of select="@partname"/>","",null);
- // add the value here
+
<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.addChild(param.getOMElement(param.MY_QNAME,
- org.apache.axiom.om.OMAbstractFactory.getOMFactory()));
+ 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:otherwise>
</xsl:choose>
- wrapperElt.appendChild(elt);
+ wrapperElt.addChild(elt);
</xsl:for-each>
org.apache.axis2.databinding.ADBSOAPModelBuilder builder =
Modified: webservices/axis2/trunk/java/modules/integration/maven.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/maven.xml?rev=419617&r1=419616&r2=419617&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/maven.xml (original)
+++ webservices/axis2/trunk/java/modules/integration/maven.xml Thu Jul 6 09:51:57 2006
@@ -74,6 +74,25 @@
<classpath refid="maven.dependency.classpath"/>
<arg line="-src target/xmlbeans-src -d target/classes test-resources/xsd/type-test.xsd"/>
</java>
+
+
+ <ant:echo>Running codegen RPC WSDLs - take 1</ant:echo>
+ <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
+ <classpath refid="maven.dependency.classpath"/>
+ <arg line="-o target/rpc-test1 -uri test-resources/rpc/test-rpc-2.wsdl -uw"/>
+ </java>
+ <ant:ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="target/rpc-test1"
+ target="jar.client"/>
+
+ <!-- to be uncommented - currently the tests fail due to a prob with the toOM method-->
+ <ant:echo>Running codegen RPC WSDLs - take 2</ant:echo>
+ <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
+ <classpath refid="maven.dependency.classpath"/>
+ <arg line="-o target/rpc-test2 -uri test-resources/rpc/test-rpc-3.wsdl -uw"/>
+ </java>
+ <ant:ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="target/rpc-test2"
+ target="jar.client"/>
+
<j:if test="${context.getVariable('maven.test.skip') != 'true'}">
<j:if test="${context.getVariable('skip.enterprise.tests') != 'true'}">
Added: webservices/axis2/trunk/java/modules/integration/test-resources/rpc/test-rpc-2.wsdl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/test-resources/rpc/test-rpc-2.wsdl?rev=419617&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test-resources/rpc/test-rpc-2.wsdl (added)
+++ webservices/axis2/trunk/java/modules/integration/test-resources/rpc/test-rpc-2.wsdl Thu Jul 6 09:51:57 2006
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:types="http://www.example.com/types" xmlns:y="http://www.example.com" targetNamespace="http://www.example.com">
+ <types></types>
+ <message name="requestMessage">
+ <part name="part1" type="xs:string"/>
+ <part name="part2" type="xs:int"/>
+ </message>
+ <message name="responseMessage">
+ <part name="part1" type="xs:string"/>
+ </message>
+ <portType name="echoPortType">
+ <operation name="echo">
+ <input message="y:requestMessage"/>
+ <output message="y:responseMessage"/>
+ </operation>
+ </portType>
+ <binding name="echoBinding" type="y:echoPortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="echo">
+ <soap:operation soapAction="echo"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="serviceName">
+ <port binding="y:echoBinding" name="httpPort">
+ <soap:address location="http://localhost:8080/axis2/services/echo"/>
+ </port>
+ </service>
+</definitions>
Added: webservices/axis2/trunk/java/modules/integration/test-resources/rpc/test-rpc-3.wsdl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/test-resources/rpc/test-rpc-3.wsdl?rev=419617&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test-resources/rpc/test-rpc-3.wsdl (added)
+++ webservices/axis2/trunk/java/modules/integration/test-resources/rpc/test-rpc-3.wsdl Thu Jul 6 09:51:57 2006
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:types="http://www.example.com/types" xmlns:y="http://www.example.com" targetNamespace="http://www.example.com">
+ <types/>
+ <types>
+ <xs:schema targetNamespace="http://www.example.com/types">
+ <xs:complexType name="myComplexType">
+ <xs:sequence>
+ <xs:element name="myElt" type="xs:string"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:schema>
+ </types>
+ <message name="requestMessage">
+ <part name="part1" type="xs:string"/>
+ <part name="part2" type="xs:int"/>
+ <part name="part3" type="types:myComplexType"/>
+ </message>
+ <message name="responseMessage">
+ <part name="part1" type="xs:string"/>
+ </message>
+ <portType name="echoPortType">
+ <operation name="echo">
+ <input message="y:requestMessage"/>
+ <output message="y:responseMessage"/>
+ </operation>
+ </portType>
+ <binding name="echoBinding" type="y:echoPortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="echo">
+ <soap:operation soapAction="echo"/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="serviceName">
+ <port name="httpPort" binding="y:echoBinding">
+ <soap:address location="http://localhost:8080/axis2/services/echo"/>
+ </port>
+ </service>
+</definitions>
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org