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 da...@apache.org on 2004/09/07 12:55:28 UTC

cvs commit: ws-axis/c/tests/auto_build/testcases/output SimpleArray.cpp.out SimpleRef.cpp.out

damitha     2004/09/07 03:55:28

  Added:       c/tests/auto_build/testcases/client/cpp
                        SimpleArrayClient.cpp SimpleRefClient.cpp
               c/tests/auto_build/testcases/wsdls SimpleArray.wsdl
                        SimpleRef.wsdl
               c/tests/auto_build/testcases/output SimpleArray.cpp.out
                        SimpleRef.cpp.out
  Log:
  Tests for supporting simple arrays and ref types
  
  Revision  Changes    Path
  1.1                  ws-axis/c/tests/auto_build/testcases/client/cpp/SimpleArrayClient.cpp
  
  Index: SimpleArrayClient.cpp
  ===================================================================
  // ArrayClient.cpp : Defines the entry point for the console application.i
  //
  #include <string>
  using namespace std;
  
  #include "ArrayTestPortType.h"
  #include <axis/AxisGenException.h>
  
  #define ARRAYSIZE 2
  
  int main(int argc, char* argv[])
  {
  	int x;
  	char buffer1[100];
  	char endpoint[256];
  	const char* server="localhost";
  	const char* port="80";
  	try
          {
  	printf("Sending Requests to Server http://%s:%s ........\n\n", server, port);
  	sprintf(endpoint, "http://%s:%s/axis/array", server, port);
  	ArrayTestPortType ws(endpoint);
  	//testing echoIntArray
           intArrayType arrin;
           arrin.intItem.m_Array = new int[ARRAYSIZE];
           arrin.intItem.m_Size = ARRAYSIZE;
           for (x=0;x<ARRAYSIZE;x++)
           {
             arrin.intItem.m_Array[x] = x;
           }
           printf("invoking echoIntArray...\n");
           if (ws.echoIntArray(&arrin)->intItem.m_Array != NULL)
  	          printf("successful \n");
        else
  	          printf("failed \n");		
  	}
          catch(AxisException& e)
          {
              printf("Exception : %s\n", e.what());
          }
          catch(exception& e)
          {
              printf("Unknown exception has occured\n");
          }
          catch(...)
          {
              printf("Unknown exception has occured\n");
          }
  	return 0;
  }
  
  
  
  1.1                  ws-axis/c/tests/auto_build/testcases/client/cpp/SimpleRefClient.cpp
  
  Index: SimpleRefClient.cpp
  ===================================================================
  // InteropBaseClient.cpp : Defines the entry point for the console application.
  //
  #include <string>
  using namespace std;
  
  #include "RefTestPortType.h" 
  #include <axis/AxisGenException.h>
  
  #define ARRAYSIZE 2
  
  int main(int argc, char* argv[])
  {
  	int x;
  	char buffer1[100];
  	char endpoint[256];
  	const char* server="localhost";
  	const char* port="80";
  	try
          {
  	printf("Sending Requests to Server http://%s:%s ........\n\n", server, port);
  	sprintf(endpoint, "http://%s:%s/axis/ref", server, port);
  	//endpoint for Axis Java sample
  	//sprintf(endpoint, "http://%s:%s/axis/services/echo", server, port);
  	
  	RefTestPortType ws(endpoint);
  
  	printf("invoking echoInt..\n");
  	intType refint;
    	refint.intItem =56;
  
          if ((ws.echoInt(&refint))->intItem == 56)
          printf("successful\n");
          else
          printf("failed \n");
  
          }
          catch(AxisException& e)
          {
              printf("Exception : %s\n", e.what());
          }
          catch(exception& e)
          {
              printf("Unknown exception has occured\n");
          }
          catch(...)
          {
              printf("Unknown exception has occured\n");
          }
  	return 0;
  }
  
  
  
  1.1                  ws-axis/c/tests/auto_build/testcases/wsdls/SimpleArray.wsdl
  
  Index: SimpleArray.wsdl
  ===================================================================
  <?xml version="1.0"?>
  <definitions name="InteropTest" targetNamespace="http://soapinterop.org/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://soapinterop.org/" xmlns:s="http://soapinterop.org/xsd" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
  
  	<types>
  		<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapinterop.org/xsd">
  	                <import namespace = "http://schemas.xmlsoap.org/soap/encoding/"/>
  			
  			<element name="intItem" type="int" />
  			<complexType name="intArrayType">
  			<sequence>
  			<element ref="s:intItem" minOccurs="0" maxOccurs="unbounded" />
  			</sequence>
  			</complexType>
  
  
  		</schema>
  	</types>
  	<message name="echoIntArrayRequest">
  	      <part name ="inputIntArrayType" type="s:intArrayType"/>
  	</message> 
  	<message name="echoIntArrayResponse">
  	       <part name ="return" type="s:intArrayType"/>
          </message> 
  	
  	<portType name="ArrayTestPortType">
  	        <operation name="echoIntArray" parameterOrder="inputIntArrayType">
  		        <input message="tns:echoIntArrayRequest"/>
  		        <output message="tns:echoIntArrayResponse"/>
  		</operation>			
  		</portType>
  
  	<binding name="ArrayTestSoapBinding" type="tns:ArrayTestPortType">
  		<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
                 <operation name="echoIntArray">
                    <soap:operation soapAction="array#echoIntArray"/>
                    <input>
                        <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
                    </input>
                    <output>
                        <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
                    </output>
                 </operation>						
  	       
  	</binding>
   	<service name="array">
      		<port binding="tns:ArrayTestSoapBinding" name="arrayTest">
        		<soap:address location="http://localhost/axis/array"/>
      		</port>
    	</service>
  </definitions>
  
  
  
  1.1                  ws-axis/c/tests/auto_build/testcases/wsdls/SimpleRef.wsdl
  
  Index: SimpleRef.wsdl
  ===================================================================
  <?xml version="1.0"?>
  <definitions name="InteropTest" targetNamespace="http://soapinterop.org/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://soapinterop.org/" xmlns:s="http://soapinterop.org/xsd" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
  
  	<types>
  		<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapinterop.org/xsd">
  	                <import namespace = "http://schemas.xmlsoap.org/soap/encoding/"/>
  			
  			<element name="intItem" type="int" />
  			<complexType name="intType">
  			<sequence>
  			<element ref="s:intItem" />
  			</sequence>
  			</complexType>
  
  
  		</schema>
  	</types>
  	<message name="echoIntRequest">
  	      <part name ="inputIntType" type="s:intType"/>
  	</message> 
  	<message name="echoIntResponse">
  	       <part name ="return" type="s:intType"/>
          </message> 
  	
  	<portType name="RefTestPortType">
  	        <operation name="echoInt" parameterOrder="inputIntType">
  		        <input message="tns:echoIntRequest"/>
  		        <output message="tns:echoIntResponse"/>
  		</operation>			
  		</portType>
  
  	<binding name="RefTestSoapBinding" type="tns:RefTestPortType">
  		<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
                 <operation name="echoInt">
                    <soap:operation soapAction="ref#echoInt"/>
                    <input>
                        <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
                    </input>
                    <output>
                        <soap:body use="encoded" namespace="http://soapinterop.org/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
                    </output>
                 </operation>						
  	       
  	</binding>
   	<service name="ref">
      		<port binding="tns:RefTestSoapBinding" name="RefTest">
        		<soap:address location="http://localhost/axis/ref"/>
      		</port>
    	</service>
  </definitions>
  
  
  
  1.1                  ws-axis/c/tests/auto_build/testcases/output/SimpleArray.cpp.out
  
  Index: SimpleArray.cpp.out
  ===================================================================
  Sending Requests to Server http://localhost:80 ........
  
  invoking echoIntArray...
  successful 
  
  
  
  1.1                  ws-axis/c/tests/auto_build/testcases/output/SimpleRef.cpp.out
  
  Index: SimpleRef.cpp.out
  ===================================================================
  Sending Requests to Server http://localhost:80 ........
  
  invoking echoInt..
  successful