axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From perr...@apache.org
Subject cvs commit: ws-axis/c/tests/auto_build/testcases/wsdls TestTransportTimeout.wsdl
Date Mon, 20 Dec 2004 21:27:40 GMT
perryan     2004/12/20 13:27:40

  Added:       c/tests/auto_build/testcases/client/cpp
                        TestTransportPropertiesClient.cpp
                        TestTransportProtocolClient.cpp
                        TestTransportTimeoutClient.cpp
               c/tests/auto_build/testcases/output
                        TestTransportProperties.expected
                        TestTransportProtocol.expected
                        TestTransportTimeout.expected
               c/tests/auto_build/testcases/wsdls TestTransportTimeout.wsdl
  Log:
  New tests for transport specific APIs exposed in the Stub class.
  
  Revision  Changes    Path
  1.1                  ws-axis/c/tests/auto_build/testcases/client/cpp/TestTransportPropertiesClient.cpp
  
  Index: TestTransportPropertiesClient.cpp
  ===================================================================
  /*
   * This client tests setting and getting the transport properties.
   * The test framework also verify the message content on the wire.
   */
  
  #include "Calculator.hpp"
  #include <stdio.h>
  #include <iostream>
  
  void printProperties(Calculator *obj);
  
  int main(int argc, char* argv[])
  {
  	char endpoint[256];
  	const char* url="http://localhost:80/axis/Calculator";
  	int iResult;
  	int rc=1;
  
  	url = argv[1];
  
  	try
  	{
  		sprintf(endpoint, "%s", url);
  		Calculator ws(endpoint);
  		ws.setTransportProtocol(APTHTTP1_1);
  		ws.setTransportProperty("Accept-Language", " da, en-gb;q=0.8, en;q=0.7");
  		ws.setTransportProperty("Accept-Language", "l1");
  		ws.setTransportProperty("Date", "Mon Dec  6 13:37:06 GMT 2004");
  		ws.setTransportProperty("Accept-Language", "l22");
  		
  		cout << "Full properties list " << endl;
  		printProperties(&ws);
  
  		//deleting the transport with specific key value
  		ws.deleteTrasportProperty("Accept-Language",2);
  
  		cout << "After deleteTransportProperty(key,int) method  " << endl;
  		printProperties(&ws);
  
  		//Go to the last property and delete
  		ws.getFirstTrasportPropertyKey();
  		ws.getNextTrasportPropertyKey();
  		ws.getNextTrasportPropertyKey();
  		ws.deleteCurrentTrasportProperty();
  		cout << "After deleteCurrentProperty method " << endl;
  		printProperties(&ws);
  		
  		iResult = ws.add(2,3);
  		printf("%d\n", iResult);
  		rc=0;
  	}
  	catch(AxisException& e)
  	{
  		cout << "in AxisException block" << e.what() << endl;
  	}
  	catch(exception& e)
  	{
  		cout << "Unknown exception has occured" << endl;
  	}
  	catch(...)
  	{
  		cout << "Unspecified exception has occured" << endl;
  	}
  	return rc;
  }
  void printProperties(Calculator *obj)
  {
  	const char* transprop1;
  	transprop1 = obj->getFirstTrasportPropertyKey();
  	do
  	{
  		transprop1 = obj->getCurrentTrasportPropertyKey();
  		cout << "current transport property key = " << transprop1 ;
  		transprop1 = obj->getCurrentTrasportPropertyValue();
  		cout << " value = " << transprop1 << endl;
  	}
  	while ( (transprop1 = obj->getNextTrasportPropertyKey()) != NULL);
  	cout << "****************************************************** " << endl;
  	return ;	
  }
  
  
  
  1.1                  ws-axis/c/tests/auto_build/testcases/client/cpp/TestTransportProtocolClient.cpp
  
  Index: TestTransportProtocolClient.cpp
  ===================================================================
  #include "Calculator.hpp"
  #include <stdio.h>
  #include <iostream>
  
  int main(int argc, char* argv[])
  {
  	char endpoint[256];
  	const char* url="http://localhost:80/axis/Calculator";
  	int iResult;
  	int rc=1;
  
  	url = argv[1];
  
  	try
  	{
  		sprintf(endpoint, "%s", url);
  		Calculator ws(endpoint);
  		ws.setTransportProtocol(APTHTTP1_0);
  		cout << "Protocol used by the transport is  = " << ws.getTransportProtocol()
<< endl;
  		iResult = ws.add(2,3);
  		printf("Result is = %d\n", iResult);
  		ws.setTransportProtocol(APTHTTP1_1);
  		cout << "Protocol used by the transport is  = " << ws.getTransportProtocol()
<< endl;
  		iResult = ws.add(5,6);
  		printf("Result is = %d\n", iResult);
  		rc=0;
  	}
  	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 rc;
  }
  
  
  
  1.1                  ws-axis/c/tests/auto_build/testcases/client/cpp/TestTransportTimeoutClient.cpp
  
  Index: TestTransportTimeoutClient.cpp
  ===================================================================
  #include "Timeout.hpp"
  #include <stdio.h>
  #include <iostream>
  
  int main(int argc, char* argv[])
  {
  	char endpoint[256];
  	const char* url="http://localhost:80/axis/TestTransportTimeout";
  	int iResult;
  	int rc=1;
  
  	url = argv[1];
  
  	try
  	{
  		sprintf(endpoint, "%s", url);
  		Timeout ws(endpoint);
  		ws.setTransportTimeout(2);	
  
  		iResult = ws.add(2,3);
  		printf("%d\n", iResult);
  		rc=0;
  	}
  	catch(AxisException& e)
  	{
  	    cout << "in AxisException block"  << endl;
  	    printf("Exception : %s\n", e.what());
  	}
  	catch(exception& e)
  	{
  	    printf("Unknown exception has occured\n" );
  	}
  	catch(...)
  	{
  	    printf("Unknown exception has occured\n" );
  	}
  	return rc;
  }
  
  
  
  
  1.1                  ws-axis/c/tests/auto_build/testcases/output/TestTransportProperties.expected
  
  Index: TestTransportProperties.expected
  ===================================================================
  Full properties list 
  current transport property key = Accept-Language value =  da, en-gb;q=0.8, en;q=0.7
  current transport property key = Accept-Language value = l1
  current transport property key = Date value = Mon Dec  6 13:37:06 GMT 2004
  current transport property key = Accept-Language value = l22
  ****************************************************** 
  After deleteTransportProperty(key,int) method  
  current transport property key = Accept-Language value =  da, en-gb;q=0.8, en;q=0.7
  current transport property key = Date value = Mon Dec  6 13:37:06 GMT 2004
  current transport property key = Accept-Language value = l22
  ****************************************************** 
  After deleteCurrentProperty method 
  current transport property key = Accept-Language value =  da, en-gb;q=0.8, en;q=0.7
  current transport property key = Date value = Mon Dec  6 13:37:06 GMT 2004
  ****************************************************** 
  5
  
  
  
  1.1                  ws-axis/c/tests/auto_build/testcases/output/TestTransportProtocol.expected
  
  Index: TestTransportProtocol.expected
  ===================================================================
  Protocol used by the transport is  = 0
  Result is = 5
  Protocol used by the transport is  = 1
  Result is = 11
  
  
  
  1.1                  ws-axis/c/tests/auto_build/testcases/output/TestTransportTimeout.expected
  
  Index: TestTransportTimeout.expected
  ===================================================================
  in AxisException block
  Exception : AxisTransportException:Channel error connection timeout before receving Channel
error: connection timed out before receving
  
  
  
  1.1                  ws-axis/c/tests/auto_build/testcases/wsdls/TestTransportTimeout.wsdl
  
  Index: TestTransportTimeout.wsdl
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <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">
   <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="add">
      <complexType>
       <sequence>
        <element name="arg_0_0" type="xsd:int"/>
        <element name="arg_1_0" type="xsd:int"/>
       </sequence>
      </complexType>
     </element>
     <element name="addResponse">
      <complexType>
       <sequence>
        <element name="addReturn" type="xsd:int"/>
       </sequence>
      </complexType>
     </element>
     <element name="sub">
      <complexType>
       <sequence>
        <element name="arg_0_1" type="xsd:int"/>
        <element name="arg_1_1" type="xsd:int"/>
       </sequence>
      </complexType>
     </element>
     <element name="subResponse">
      <complexType>
       <sequence>
        <element name="subReturn" type="xsd:int"/>
       </sequence>
      </complexType>
     </element>
     <element name="mul">
      <complexType>
       <sequence>
        <element name="arg_0_2" type="xsd:int"/>
        <element name="arg_1_2" type="xsd:int"/>
       </sequence>
      </complexType>
     </element>
     <element name="mulResponse">
      <complexType>
       <sequence>
        <element name="mulReturn" type="xsd:int"/>
       </sequence>
      </complexType>
     </element>
     <element name="div">
      <complexType>
       <sequence>
        <element name="arg_0_3" type="xsd:int"/>
        <element name="arg_1_3" type="xsd:int"/>
       </sequence>
      </complexType>
     </element>
     <element name="divResponse">
      <complexType>
       <sequence>
        <element name="divReturn" type="xsd:int"/>
       </sequence>
      </complexType>
     </element>
    </schema>
   </wsdl:types>
  
     <wsdl:message name="subResponse">
  
        <wsdl:part element="impl:subResponse" name="parameters"/>
  
     </wsdl:message>
  
     <wsdl:message name="mulResponse">
  
        <wsdl:part element="impl:mulResponse" name="parameters"/>
  
     </wsdl:message>
  
     <wsdl:message name="subRequest">
  
        <wsdl:part element="impl:sub" name="parameters"/>
  
     </wsdl:message>
  
     <wsdl:message name="divRequest">
  
        <wsdl:part element="impl:div" name="parameters"/>
  
     </wsdl:message>
  
     <wsdl:message name="divResponse">
  
        <wsdl:part element="impl:divResponse" name="parameters"/>
  
     </wsdl:message>
  
     <wsdl:message name="mulRequest">
  
        <wsdl:part element="impl:mul" name="parameters"/>
  
     </wsdl:message>
  
     <wsdl:message name="addResponse">
  
        <wsdl:part element="impl:addResponse" name="parameters"/>
  
     </wsdl:message>
  
     <wsdl:message name="addRequest">
  
        <wsdl:part element="impl:add" name="parameters"/>
  
     </wsdl:message>
  
     <wsdl:portType name="Timeout">
  
        <wsdl:operation name="add">
  
           <wsdl:input message="impl:addRequest" name="addRequest"/>
  
           <wsdl:output message="impl:addResponse" name="addResponse"/>
  
        </wsdl:operation>
  
        <wsdl:operation name="sub">
  
           <wsdl:input message="impl:subRequest" name="subRequest"/>
  
           <wsdl:output message="impl:subResponse" name="subResponse"/>
  
        </wsdl:operation>
  
        <wsdl:operation name="mul">
  
           <wsdl:input message="impl:mulRequest" name="mulRequest"/>
  
           <wsdl:output message="impl:mulResponse" name="mulResponse"/>
  
        </wsdl:operation>
  
        <wsdl:operation name="div">
  
           <wsdl:input message="impl:divRequest" name="divRequest"/>
  
           <wsdl:output message="impl:divResponse" name="divResponse"/>
  
        </wsdl:operation>
  
     </wsdl:portType>
  
     <wsdl:binding name="TestTransportTimeoutSoapBinding" type="impl:Timeout">
  
        <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
  
        <wsdl:operation name="add">
  
           <wsdlsoap:operation soapAction=""/>
  
           <wsdl:input name="addRequest">
  
              <wsdlsoap:body use="literal"/>
  
           </wsdl:input>
  
           <wsdl:output name="addResponse">
  
              <wsdlsoap:body use="literal"/>
  
           </wsdl:output>
  
        </wsdl:operation>
  
        <wsdl:operation name="sub">
  
           <wsdlsoap:operation soapAction=""/>
  
           <wsdl:input name="subRequest">
  
              <wsdlsoap:body use="literal"/>
  
           </wsdl:input>
  
           <wsdl:output name="subResponse">
  
              <wsdlsoap:body use="literal"/>
  
           </wsdl:output>
  
        </wsdl:operation>
  
        <wsdl:operation name="mul">
  
           <wsdlsoap:operation soapAction=""/>
  
           <wsdl:input name="mulRequest">
  
              <wsdlsoap:body use="literal"/>
  
           </wsdl:input>
  
           <wsdl:output name="mulResponse">
  
              <wsdlsoap:body use="literal"/>
  
           </wsdl:output>
  
        </wsdl:operation>
  
        <wsdl:operation name="div">
  
           <wsdlsoap:operation soapAction=""/>
  
           <wsdl:input name="divRequest">
  
              <wsdlsoap:body use="literal"/>
  
           </wsdl:input>
  
           <wsdl:output name="divResponse">
  
              <wsdlsoap:body use="literal"/>
  
           </wsdl:output>
  
        </wsdl:operation>
  
     </wsdl:binding>
  
     <wsdl:service name="TestTransportTimeout">
  
        <wsdl:port binding="impl:TestTransportTimeoutSoapBinding" name="TestTransportTimeoutPort">
  
           <wsdlsoap:address location="http://localhost/axis/TestTransportTimeout"/>
  
        </wsdl:port>
  
     </wsdl:service>
  
  </wsdl:definitions>
  
  
  

Mime
View raw message