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 di...@apache.org on 2005/11/29 16:22:56 UTC
svn commit: r349729 - in
/webservices/axis/trunk/c/tests/auto_build/testcases: ./ client/cpp/
output/ tests/ wsdls/
Author: dicka
Date: Tue Nov 29 07:22:46 2005
New Revision: 349729
URL: http://svn.apache.org/viewcvs?rev=349729&view=rev
Log:
Add new test for Complex Types containing a Nillable element of the same name.
Added:
webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/SameComplexTypeAndNillableElementNameClient.cpp
webservices/axis/trunk/c/tests/auto_build/testcases/output/SameComplexTypeAndNillableElementName.expected
webservices/axis/trunk/c/tests/auto_build/testcases/output/SameComplexTypeAndNillableElementName_Request.expected
webservices/axis/trunk/c/tests/auto_build/testcases/output/SameComplexTypeAndNillableElementName_ServerResponse.expected
webservices/axis/trunk/c/tests/auto_build/testcases/tests/SameComplexTypeAndNillableElementName.xml
webservices/axis/trunk/c/tests/auto_build/testcases/wsdls/SameComplexTypeAndNillableElementName.wsdl
Modified:
webservices/axis/trunk/c/tests/auto_build/testcases/unitTest.list
Added: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/SameComplexTypeAndNillableElementNameClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/SameComplexTypeAndNillableElementNameClient.cpp?rev=349729&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/SameComplexTypeAndNillableElementNameClient.cpp (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/SameComplexTypeAndNillableElementNameClient.cpp Tue Nov 29 07:22:46 2005
@@ -0,0 +1,129 @@
+// 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 "SameComplexTypeAndNillableElementName.hpp"
+#include <axis/AxisException.hpp>
+#include <ctype.h>
+#include <iostream>
+#include <signal.h>
+
+void sig_handler(int);
+void PrintUsage();
+bool IsNumber(const char* p);
+
+int main(int argc, char* argv[])
+{
+ char endpoint[256];
+ const char* url="http://localhost:80/axis/Calculator";
+
+ signal(SIGILL, sig_handler);
+ signal(SIGABRT, sig_handler);
+ signal(SIGSEGV, sig_handler);
+ //signal(SIGQUIT, sig_handler);
+ //signal(SIGBUS, sig_handler);
+ signal(SIGFPE, sig_handler);
+
+ url = argv[1];
+
+ bool bSuccess = false;
+ int iRetryIterationCount = 3;
+
+ do
+ {
+ try
+ {
+ sprintf(endpoint, "%s", url);
+ SameComplexTypeAndNillableElementName ws(endpoint);
+
+ aType input;
+ xsd__int* inputValue = NULL;
+ input.setaType(inputValue);
+
+ aType * output = ws.complexTypeAndNillableElement(&input);
+ if (output != NULL)
+ {
+ xsd__int * outputValue = output->getaType();
+ if (outputValue != NULL)
+ {
+ cout << "aType->aType = " << *outputValue << endl;
+ }
+ else
+ {
+ cout << "aType->aType = NULL" << endl;
+ }
+ }
+ else
+ {
+ cout << "output is NULL" << endl;
+ }
+ bSuccess = true;
+ }
+ catch(AxisException& e)
+ {
+ bool bSilent = false;
+
+ if( e.getExceptionCode() == CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED)
+ {
+ if( iRetryIterationCount > 0)
+ {
+ bSilent = true;
+ }
+ }
+ else
+ {
+ iRetryIterationCount = 0;
+ }
+
+ if( !bSilent)
+ {
+ cout << "Exception : " << e.what() << endl;
+ }
+ }
+ catch(exception& e)
+ {
+ cout << "Unknown exception has occured" << endl;
+ }
+ catch(...)
+ {
+ cout << "Unknown exception has occured" << endl;
+ }
+ iRetryIterationCount--;
+ } while( iRetryIterationCount > 0 && !bSuccess);
+ cout<< "---------------------- TEST COMPLETE -----------------------------"<< endl;
+
+ return 0;
+}
+
+void PrintUsage()
+{
+ printf("Usage :\n Calculator <url>\n\n");
+ exit(1);
+}
+
+bool IsNumber(const char* p)
+{
+ for (int x=0; x < strlen(p); x++)
+ {
+ if (!isdigit(p[x])) return false;
+ }
+ return true;
+}
+
+void sig_handler(int sig) {
+ signal(sig, sig_handler);
+ cout << "SIGNAL RECEIVED " << sig << endl;
+ exit(1);
+}
+
Added: webservices/axis/trunk/c/tests/auto_build/testcases/output/SameComplexTypeAndNillableElementName.expected
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/output/SameComplexTypeAndNillableElementName.expected?rev=349729&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/output/SameComplexTypeAndNillableElementName.expected (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/output/SameComplexTypeAndNillableElementName.expected Tue Nov 29 07:22:46 2005
@@ -0,0 +1,2 @@
+aType->aType = NULL
+---------------------- TEST COMPLETE -----------------------------
Added: webservices/axis/trunk/c/tests/auto_build/testcases/output/SameComplexTypeAndNillableElementName_Request.expected
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/output/SameComplexTypeAndNillableElementName_Request.expected?rev=349729&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/output/SameComplexTypeAndNillableElementName_Request.expected (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/output/SameComplexTypeAndNillableElementName_Request.expected Tue Nov 29 07:22:46 2005
@@ -0,0 +1,16 @@
+POST /axis/SameComplexTypeAndNillableElementName HTTP/1.1
+Host: 127.0.0.1:13260
+Content-Type: text/xml; charset=UTF-8
+SOAPAction: "Calculator#add"
+Content-Length: 458
+
+<?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:complexTypeAndNillableElement xmlns:ns1="http://localhost/axis/Calculator">
+<ns1:Element><ns1:aType xsi:nil="true"></ns1:aType>
+</ns1:Element>
+</ns1:complexTypeAndNillableElement>
+</SOAP-ENV:Body>
+</SOAP-ENV:Envelope>
+
Added: webservices/axis/trunk/c/tests/auto_build/testcases/output/SameComplexTypeAndNillableElementName_ServerResponse.expected
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/output/SameComplexTypeAndNillableElementName_ServerResponse.expected?rev=349729&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/output/SameComplexTypeAndNillableElementName_ServerResponse.expected (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/output/SameComplexTypeAndNillableElementName_ServerResponse.expected Tue Nov 29 07:22:46 2005
@@ -0,0 +1,11 @@
+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/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><SOAP-ENV:Body><ns1:complexTypeAndNillableElementResponse xmlns:ns1="http://localhost/axis/Calculator"><ns1:Element><ns1:aType xsi:nil="true"></ns1:aType></ns1:Element></ns1:complexTypeAndNillableElementResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
+0
+
Added: webservices/axis/trunk/c/tests/auto_build/testcases/tests/SameComplexTypeAndNillableElementName.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/tests/SameComplexTypeAndNillableElementName.xml?rev=349729&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/tests/SameComplexTypeAndNillableElementName.xml (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/tests/SameComplexTypeAndNillableElementName.xml Tue Nov 29 07:22:46 2005
@@ -0,0 +1,19 @@
+<test>
+ <name>SameComplexTypeAndNillableElementName</name>
+ <description>SameComplexTypeAndNillableElementName</description>
+ <clientLang>cpp</clientLang>
+ <clientCode>SameComplexTypeAndNillableElementNameClient.cpp</clientCode>
+ <wsdl>SameComplexTypeAndNillableElementName.wsdl</wsdl>
+ <expected>
+ <request>
+ SameComplexTypeAndNillableElementName_Request.expected
+ </request>
+ <serverResponse>
+ SameComplexTypeAndNillableElementName_ServerResponse.expected
+ </serverResponse>
+ <output>
+ SameComplexTypeAndNillableElementName.expected
+ </output>
+ </expected>
+ <endpoint>http://localhost:80/axis/SameComplexTypeAndNillableElementName</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=349729&r1=349728&r2=349729&view=diff
==============================================================================
Binary files - no diff available.
Added: webservices/axis/trunk/c/tests/auto_build/testcases/wsdls/SameComplexTypeAndNillableElementName.wsdl
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/wsdls/SameComplexTypeAndNillableElementName.wsdl?rev=349729&view=auto
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/wsdls/SameComplexTypeAndNillableElementName.wsdl (added)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/wsdls/SameComplexTypeAndNillableElementName.wsdl Tue Nov 29 07:22:46 2005
@@ -0,0 +1,103 @@
+<?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/">
+ <element name="complexTypeAndNillableElement">
+ <complexType>
+ <sequence>
+ <element name="Element" type="impl:aType" />
+ </sequence>
+ </complexType>
+ </element>
+ <element name="complexTypeAndNillableElementResponse">
+ <complexType>
+ <sequence>
+ <element name="Element" type="impl:aType"/>
+ </sequence>
+ </complexType>
+ </element>
+ <complexType name="aType">
+ <sequence>
+ <element name="aType" nillable="true" type="xsd:int"/>
+ </sequence>
+ </complexType>
+ </schema>
+ </wsdl:types>
+
+ <wsdl:message name="complexTypeAndNillableElementResponse">
+
+ <wsdl:part element="impl:complexTypeAndNillableElementResponse" name="parameters"/>
+
+ </wsdl:message>
+
+ <wsdl:message name="complexTypeAndNillableElementRequest">
+
+ <wsdl:part element="impl:complexTypeAndNillableElement" name="parameters"/>
+
+ </wsdl:message>
+
+ <wsdl:portType name="SameComplexTypeAndNillableElementName">
+
+ <wsdl:operation name="complexTypeAndNillableElement">
+
+ <wsdl:input message="impl:complexTypeAndNillableElementRequest" name="addRequest"/>
+
+ <wsdl:output message="impl:complexTypeAndNillableElementResponse" name="addResponse"/>
+
+ </wsdl:operation>
+
+
+
+
+ </wsdl:portType>
+
+ <wsdl:binding name="SameComplexTypeAndNillableElementNameSoapBinding" type="impl:SameComplexTypeAndNillableElementName">
+
+ <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+
+ <wsdl:operation name="complexTypeAndNillableElement">
+
+ <wsdlsoap:operation soapAction="Calculator#add"/>
+
+ <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="SameComplexTypeAndNillableElementName">
+
+ <wsdl:port binding="impl:SameComplexTypeAndNillableElementNameSoapBinding" name="SameComplexTypeAndNillableElementName">
+
+ <wsdlsoap:address location="http://localhost/axis/SameComplexTypeAndNillableElementName"/>
+
+ </wsdl:port>
+
+ </wsdl:service>
+
+</wsdl:definitions>