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 pr...@apache.org on 2005/11/08 13:20:23 UTC

svn commit: r331793 - in /webservices/axis/trunk/c/tests/auto_build/testcases: ./ client/cpp/ output/ tests/ wsdls/

Author: prestonf
Date: Tue Nov  8 04:20:01 2005
New Revision: 331793

URL: http://svn.apache.org/viewcvs?rev=331793&view=rev
Log:
This is a new UT for checking complex object types with nillable simple elements.  This test is linked to AXISCPP-149.

Added:
    webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ComplexTypeWithNillableSimpleElementClient.cpp
    webservices/axis/trunk/c/tests/auto_build/testcases/output/ComplexTypeWithNillableSimpleElement_Output.expected
    webservices/axis/trunk/c/tests/auto_build/testcases/output/ComplexTypeWithNillableSimpleElement_Request.expected
    webservices/axis/trunk/c/tests/auto_build/testcases/output/ComplexTypeWithNillableSimpleElement_Response.expected
    webservices/axis/trunk/c/tests/auto_build/testcases/tests/ComplexTypeWithNillableSimpleElement.xml
    webservices/axis/trunk/c/tests/auto_build/testcases/wsdls/ComplexTypeWithNillableSimpleElement.wsdl
Modified:
    webservices/axis/trunk/c/tests/auto_build/testcases/unitTest.list

Added: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ComplexTypeWithNillableSimpleElementClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ComplexTypeWithNillableSimpleElementClient.cpp?rev=331793&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ComplexTypeWithNillableSimpleElementClient.cpp (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/ComplexTypeWithNillableSimpleElementClient.cpp Tue Nov  8 04:20:01 2005
@@ -0,0 +1,69 @@
+// Copyright 2003-2004 The Apache Software Foundation.
+// (c) Copyright IBM Corp. 2004, 2005 All Rights Reserved
+// 
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// 
+//        http://www.apache.org/licenses/LICENSE-2.0
+// 
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <iostream>
+#include "ComplexTypeWithNillableSimpleElement.hpp"
+
+void main( int argc, char* argv[])
+{
+	char *	pszEndpoint = "http://localhost:9080/ComplexTypeWithNillableSimpleElement";
+
+    if( argc > 1)
+	{
+        pszEndpoint = argv[1];
+	}
+
+    try
+    {
+		ComplexTypeWithNillableSimpleElement *	pWS = new ComplexTypeWithNillableSimpleElement( pszEndpoint, APTHTTP1_1);
+
+		SimpleComplexType *	pSCTI = new SimpleComplexType();
+		SimpleComplexType * pSCTO = NULL;
+		xsd__int *			pI = new xsd__int();
+		xsd__int			iInput = 1738;
+		xsd__int			iOutput = 8371;
+
+		*pI = iInput;
+
+		pSCTI->setcomplexTypeElement( pI);
+
+		pSCTO = pWS->echo( pSCTI);
+
+		cout << "The output should be the reverse of the input." << endl <<
+			 "Input = " << *pI << " Output = " << *pSCTO->getcomplexTypeElement() << endl <<
+			 (iOutput == *pSCTO->getcomplexTypeElement() ? "Success" : "Failed") << endl;
+
+		delete pI;
+		delete pSCTI;
+		delete pSCTO;
+		delete pWS;
+    }
+    catch( AxisException& e)
+    {
+        cout << "Exception : " << e.what() << endl;
+    }
+    catch( exception& e)
+    {
+        cout << "Unknown exception has occured: " << e.what() << endl;
+    }
+    catch(...)
+    {
+        cout << "Unknown exception has occured" << endl;
+    }
+
+    cout << "---------------------- TEST COMPLETE -----------------------------" << endl;
+
+	return;
+}
\ No newline at end of file

Added: webservices/axis/trunk/c/tests/auto_build/testcases/output/ComplexTypeWithNillableSimpleElement_Output.expected
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/output/ComplexTypeWithNillableSimpleElement_Output.expected?rev=331793&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/output/ComplexTypeWithNillableSimpleElement_Output.expected (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/output/ComplexTypeWithNillableSimpleElement_Output.expected Tue Nov  8 04:20:01 2005
@@ -0,0 +1,4 @@
+The output should be the reverse of the input.
+Input = 1738 Output = 8371
+Success
+---------------------- TEST COMPLETE -----------------------------

Added: webservices/axis/trunk/c/tests/auto_build/testcases/output/ComplexTypeWithNillableSimpleElement_Request.expected
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/output/ComplexTypeWithNillableSimpleElement_Request.expected?rev=331793&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/output/ComplexTypeWithNillableSimpleElement_Request.expected (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/output/ComplexTypeWithNillableSimpleElement_Request.expected Tue Nov  8 04:20:01 2005
@@ -0,0 +1,16 @@
+POST /axis/ComplexTypeWithNillableSimpleElement HTTP/1.1
+Host: 127.0.0.1:13260
+Content-Type: text/xml; charset=UTF-8
+SOAPAction: "ComplexTypeWithNillableSimpleElement#echo"
+Content-Length: 443
+
+<?xml version='1.0' encoding='utf-8' ?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<SOAP-ENV:Body>
+<ns1:echo xmlns:ns1="http://localhost/axis/Calculator">
+<ns1:simpleComplexType><ns1:complexTypeElement>1738</ns1:complexTypeElement>
+</ns1:simpleComplexType>
+</ns1:echo>
+</SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+

Added: webservices/axis/trunk/c/tests/auto_build/testcases/output/ComplexTypeWithNillableSimpleElement_Response.expected
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/output/ComplexTypeWithNillableSimpleElement_Response.expected?rev=331793&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/output/ComplexTypeWithNillableSimpleElement_Response.expected (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/output/ComplexTypeWithNillableSimpleElement_Response.expected Tue Nov  8 04:20:01 2005
@@ -0,0 +1,18 @@
+HTTP/1.1 200 OK
+Server: WebSphere Application Server/5.1
+Content-Type: text/xml; charset=utf-8
+Content-Language: en-GB
+Transfer-Encoding: chunked
+
+###
+<?xml version="1.0" encoding="UTF-8"?>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
+<SOAP-ENV:Body>
+<echoResponse xmlns="">
+<simpleComplexType>
+<complexTypeElement>8371</complexTypeElement>
+</simpleComplexType>
+</echoResponse>
+</SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+0

Added: webservices/axis/trunk/c/tests/auto_build/testcases/tests/ComplexTypeWithNillableSimpleElement.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/tests/ComplexTypeWithNillableSimpleElement.xml?rev=331793&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/tests/ComplexTypeWithNillableSimpleElement.xml (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/tests/ComplexTypeWithNillableSimpleElement.xml Tue Nov  8 04:20:01 2005
@@ -0,0 +1,19 @@
+<test>
+    <name>ComplexTypeWithNillableSimpleElement</name>
+    <description>ComplexTypeWithNillableSimpleElement</description>
+    <clientLang>cpp</clientLang>
+    <clientCode>ComplexTypeWithNillableSimpleElementClient.cpp</clientCode>
+    <wsdl>ComplexTypeWithNillableSimpleElement.wsdl</wsdl>
+    <expected>
+        <output>
+            ComplexTypeWithNillableSimpleElement_Output.expected
+        </output>
+        <request>
+            ComplexTypeWithNillableSimpleElement_Request.expected
+        </request> 
+        <serverResponse>
+            ComplexTypeWithNillableSimpleElement_Response.expected
+        </serverResponse>
+    </expected>
+	<endpoint>http://localhost:80/axis/ComplexTypeWithNillableSimpleElement</endpoint>
+</test>

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/unitTest.list
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/unitTest.list?rev=331793&r1=331792&r2=331793&view=diff
==============================================================================
Binary files - no diff available.

Added: webservices/axis/trunk/c/tests/auto_build/testcases/wsdls/ComplexTypeWithNillableSimpleElement.wsdl
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/wsdls/ComplexTypeWithNillableSimpleElement.wsdl?rev=331793&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/wsdls/ComplexTypeWithNillableSimpleElement.wsdl (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/wsdls/ComplexTypeWithNillableSimpleElement.wsdl Tue Nov  8 04:20:01 2005
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright 2003-2004 The Apache Software Foundation.                      -->
+<!-- (c) Copyright IBM Corp. 2004, 2005 All Rights Reserved                   -->
+<!--                                                                          -->
+<!-- Licensed under the Apache License, Version 2.0 (the "License");          -->
+<!-- you may not use this file except in compliance with the License.         -->
+<!-- You may obtain a copy of the License at                                  -->
+<!--                                                                          -->
+<!--        http://www.apache.org/licenses/LICENSE-2.0                        -->
+<!--                                                                          -->
+<!-- Unless required by applicable law or agreed to in writing, software      -->
+<!-- distributed under the License is distributed on an "AS IS" BASIS,        -->
+<!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -->
+<!-- See the License for the specific language governing permissions and      -->
+<!-- limitations under the License.                                           -->
+
+<wsdl:definitions targetNamespace="http://localhost/axis/Calculator"
+	xmlns:apachesoap="http://xml.apache.org/xml-soap"
+	xmlns:impl="http://localhost/axis/Calculator"
+	xmlns:intf="http://localhost/axis/Calculator"
+	xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+	xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
+	xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="">
+	<wsdl:types>
+		<schema elementFormDefault="qualified"
+			targetNamespace="http://localhost/axis/Calculator"
+			xmlns="http://www.w3.org/2001/XMLSchema"
+			xmlns:apachesoap="http://xml.apache.org/xml-soap"
+			xmlns:impl="http://localhost/axis/Calculator"
+			xmlns:intf="http://localhost/axis/Calculator"
+			xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+			<xsd:complexType name="SimpleComplexType">
+				<xsd:sequence>
+					<xsd:element name="complexTypeElement"
+						type="xsd:int" minOccurs="1" maxOccurs="1" nillable="true" />
+				</xsd:sequence>
+			</xsd:complexType>
+			<element name="echo">
+				<complexType>
+					<sequence>
+						<element name="simpleComplexType" type="impl:SimpleComplexType" />
+					</sequence>
+				</complexType>
+			</element>
+			<element name="echoResponse">
+				<complexType>
+					<sequence>
+						<element name="simpleComplexType" type="impl:SimpleComplexType" />
+					</sequence>
+				</complexType>
+			</element>
+		</schema>
+	</wsdl:types>
+
+	<wsdl:message name="echoResponse">
+
+		<wsdl:part element="impl:echoResponse" name="parameters" />
+
+	</wsdl:message>
+
+	<wsdl:message name="echoRequest">
+
+		<wsdl:part element="impl:echo" name="parameters" />
+
+	</wsdl:message>
+
+	<wsdl:portType name="ComplexTypeWithNillableSimpleElement">
+
+		<wsdl:operation name="echo">
+
+			<wsdl:input message="impl:echoRequest" name="addRequest" />
+
+			<wsdl:output message="impl:echoResponse" name="addResponse" />
+
+		</wsdl:operation>
+
+
+
+
+	</wsdl:portType>
+
+	<wsdl:binding name="ComplexTypeWithNillableSimpleElementSoapBinding"
+		type="impl:ComplexTypeWithNillableSimpleElement">
+
+		<wsdlsoap:binding style="document"
+			transport="http://schemas.xmlsoap.org/soap/http" />
+
+		<wsdl:operation name="echo">
+
+			<wsdlsoap:operation soapAction="ComplexTypeWithNillableSimpleElement#echo" />
+
+			<wsdl:input name="addRequest">
+
+				<wsdlsoap:body use="literal" />
+
+			</wsdl:input>
+
+			<wsdl:output name="addResponse">
+
+				<wsdlsoap:body use="literal" />
+
+			</wsdl:output>
+
+		</wsdl:operation>
+
+	</wsdl:binding>
+
+	<wsdl:service name="ComplexTypeWithNillableSimpleElement">
+
+		<wsdl:port
+			binding="impl:ComplexTypeWithNillableSimpleElementSoapBinding"
+			name="ComplexTypeWithNillableSimpleElement">
+
+			<wsdlsoap:address
+				location="http://localhost/axis/ComplexTypeWithNillableSimpleElement" />
+
+		</wsdl:port>
+
+	</wsdl:service>
+
+</wsdl:definitions>