axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From di...@apache.org
Subject svn commit: r368346 - in /webservices/axis/trunk/c: include/axis/client/ src/cbindings/client/ src/engine/client/ src/transport/ src/transport/axis3/ tests/auto_build/testcases/client/cpp/ tests/auto_build/testcases/output/
Date Thu, 12 Jan 2006 11:52:57 GMT
Author: dicka
Date: Thu Jan 12 03:52:43 2006
New Revision: 368346

URL: http://svn.apache.org/viewcvs?rev=368346&view=rev
Log:
Resolve issues with using transport properties API when no properties present.

Update TestTransportProperties testcase to test this behaviour, and also update following
recent changes to this portion of the API.

Modified:
    webservices/axis/trunk/c/include/axis/client/Stub.hpp
    webservices/axis/trunk/c/src/cbindings/client/StubC.cpp
    webservices/axis/trunk/c/src/engine/client/Stub.cpp
    webservices/axis/trunk/c/src/transport/SOAPTransport.h
    webservices/axis/trunk/c/src/transport/axis3/HTTPTransport.cpp
    webservices/axis/trunk/c/src/transport/axis3/HTTPTransport.hpp
    webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/TestTransportPropertiesClient.cpp
    webservices/axis/trunk/c/tests/auto_build/testcases/output/TestTransportProperties.expected

Modified: webservices/axis/trunk/c/include/axis/client/Stub.hpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/include/axis/client/Stub.hpp?rev=368346&r1=368345&r2=368346&view=diff
==============================================================================
--- webservices/axis/trunk/c/include/axis/client/Stub.hpp (original)
+++ webservices/axis/trunk/c/include/axis/client/Stub.hpp Thu Jan 12 03:52:43 2006
@@ -166,10 +166,11 @@
     * Repeated calls always retuen the same key unless 
     * getNextTransportPropertyKey() is called in between.
     *
+    * @param response  whether the response or outgoing message is being used.
     * @return Current transport property key. If there are no transport 
     * properties set or if iterator is at the end of the list, returns NULL.
     */
-    const char* getCurrentTransportPropertyKey();
+    const char* getCurrentTransportPropertyKey(bool response=true);
     
   /**
     * Accessor for transport property values.
@@ -201,7 +202,7 @@
     void deleteCurrentTransportProperty(bool response=true);
 
   /**
-    * Deletes the given occerance of the transport property key:value pair
+    * Deletes the given occurance of the transport property key:value pair
     * corresponding to the given key.
     *
     * This method does not advance the iterator in line with the deletes done.
@@ -453,8 +454,8 @@
        int getStatus();
 
   /**
-    * Set whether to Maitain session with service ot not.
-    * @param bSession - true is session should be maintained. False otherwise.
+    * Set whether to Maintain session with service ot not.
+    * @param bSession - true if session should be maintained. False otherwise.
     */
     void setMaintainSession(bool bSession);
 
@@ -562,7 +563,7 @@
     Call *m_pCall;
 
   /**
-    * Vector of Header Blok pointers
+    * Vector of Header Block pointers
     */
 #ifdef WIN32
   #pragma warning (disable : 4251)

Modified: webservices/axis/trunk/c/src/cbindings/client/StubC.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/cbindings/client/StubC.cpp?rev=368346&r1=368345&r2=368346&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/cbindings/client/StubC.cpp (original)
+++ webservices/axis/trunk/c/src/cbindings/client/StubC.cpp Thu Jan 12 03:52:43 2006
@@ -74,9 +74,9 @@
 	return s->getNextTransportPropertyKey((bool)(response!=0));
 }
 
-AXISC_STORAGE_CLASS_INFO const char * axiscGetCurrentTransportPropertyKey(AXISCHANDLE stub)
{
+AXISC_STORAGE_CLASS_INFO const char * axiscGetCurrentTransportPropertyKey(AXISCHANDLE stub,
AxiscBool response) {
 	Stub *s = (Stub*)stub;
-	return s->getCurrentTransportPropertyKey();
+	return s->getCurrentTransportPropertyKey((bool)(response!=0));
 }
 
 AXISC_STORAGE_CLASS_INFO const char * axiscGetCurrentTransportPropertyValue(AXISCHANDLE stub,
AxiscBool response) {

Modified: webservices/axis/trunk/c/src/engine/client/Stub.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/engine/client/Stub.cpp?rev=368346&r1=368345&r2=368346&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/engine/client/Stub.cpp (original)
+++ webservices/axis/trunk/c/src/engine/client/Stub.cpp Thu Jan 12 03:52:43 2006
@@ -168,12 +168,12 @@
 }
 
 const char *
-Stub::getCurrentTransportPropertyKey ()
+Stub::getCurrentTransportPropertyKey (bool response)
 {
     if (m_pTransport)
-	return m_pTransport->getCurrentTransportPropertyKey ();
+	   return m_pTransport->getCurrentTransportPropertyKey (response);
     else
-	return NULL;
+	   return NULL;
 }
 
 const char *

Modified: webservices/axis/trunk/c/src/transport/SOAPTransport.h
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/transport/SOAPTransport.h?rev=368346&r1=368345&r2=368346&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/transport/SOAPTransport.h (original)
+++ webservices/axis/trunk/c/src/transport/SOAPTransport.h Thu Jan 12 03:52:43 2006
@@ -439,10 +439,11 @@
     * Repeated calls always retuen the same key unless 
     * getNextTransportPropertyKey() is called in between.
     *
+    * @param response get the response message property or the sent message property
     * @return Current transport property key. If there are no transport 
     * properties set or if iterator is at the end of the list, returns NULL.
     */
-    virtual const char* getCurrentTransportPropertyKey() { return 0; };
+    virtual const char* getCurrentTransportPropertyKey(bool response=true) { return 0; };
     
   /**
     * Accessor for transport property values.

Modified: webservices/axis/trunk/c/src/transport/axis3/HTTPTransport.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/transport/axis3/HTTPTransport.cpp?rev=368346&r1=368345&r2=368346&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/transport/axis3/HTTPTransport.cpp (original)
+++ webservices/axis/trunk/c/src/transport/axis3/HTTPTransport.cpp Thu Jan 12 03:52:43 2006
@@ -1446,43 +1446,56 @@
     }
 }
 
-const char * HTTPTransport::getCurrentTransportPropertyKey()
+const char * HTTPTransport::getCurrentTransportPropertyKey(bool response)
 {
-    if( m_viCurrentHeader == m_vHTTPHeaders.end())
-	{
-		return NULL;
-	}
+    if (response)
+    {
+        if( !m_viCurrentResponseHeader || m_viCurrentResponseHeader == m_vResponseHTTPHeaders.end())
+        {
+            return NULL;
+        }
+        else
+        {
+            return (*m_viCurrentResponseHeader).first.c_str();
+        }
+    }
     else
-	{
-		return (*m_viCurrentHeader).first.c_str();
-	}
+    {
+        if( !m_viCurrentHeader || m_viCurrentHeader == m_vHTTPHeaders.end())
+        {
+            return NULL;
+        }
+        else
+        {
+            return (*m_viCurrentHeader).first.c_str();
+        }
+    }
 }
 
 const char * HTTPTransport::getCurrentTransportPropertyValue(bool response)
 {
- if(response)
- {
-    if( m_viCurrentResponseHeader == m_vResponseHTTPHeaders.end())
+    if(response)
     {
-     return NULL;
-  }
+        if( !m_viCurrentResponseHeader || m_viCurrentResponseHeader == m_vResponseHTTPHeaders.end())
+        {
+            return NULL;
+        }
+        else
+        {
+            return (*m_viCurrentResponseHeader).second.c_str();
+        }
+    }
     else
-   {
-     return (*m_viCurrentResponseHeader).second.c_str();
-   }
-    
- }
- else
- {
-    if( m_viCurrentHeader == m_vHTTPHeaders.end())
-	{
-		return NULL;
-	}
-    else
-	{
-		return (*m_viCurrentHeader).second.c_str();
-	}
- }
+    {
+        if( !m_viCurrentHeader || m_viCurrentHeader == m_vHTTPHeaders.end())
+        {
+            return NULL;
+        }
+        else
+        {
+            return (*m_viCurrentHeader).second.c_str();
+        }
+    }
 }
 
 void HTTPTransport::deleteCurrentTransportProperty(bool response)

Modified: webservices/axis/trunk/c/src/transport/axis3/HTTPTransport.hpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/transport/axis3/HTTPTransport.hpp?rev=368346&r1=368345&r2=368346&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/transport/axis3/HTTPTransport.hpp (original)
+++ webservices/axis/trunk/c/src/transport/axis3/HTTPTransport.hpp Thu Jan 12 03:52:43 2006
@@ -96,7 +96,7 @@
     void					setSocket( unsigned int);
     const char *			getFirstTransportPropertyKey(bool response);
     const char *			getNextTransportPropertyKey(bool response);
-    const char *			getCurrentTransportPropertyKey();
+    const char *			getCurrentTransportPropertyKey(bool response);
     const char *			getCurrentTransportPropertyValue(bool response);
     void					deleteCurrentTransportProperty(bool response=true);
     void					deleteTransportProperty( char* pcKey, unsigned int uiOccurance = 1);

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/TestTransportPropertiesClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/TestTransportPropertiesClient.cpp?rev=368346&r1=368345&r2=368346&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/TestTransportPropertiesClient.cpp
(original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/TestTransportPropertiesClient.cpp
Thu Jan 12 03:52:43 2006
@@ -22,6 +22,7 @@
 #include <stdio.h>
 #include <iostream>
 
+void printProperties(Calculator *obj, bool response);
 void printProperties(Calculator *obj);
 
 int main(int argc, char* argv[])
@@ -58,10 +59,10 @@
 		printProperties(&ws);
 
 		//Go to the last property and delete
-		ws.getFirstTransportPropertyKey();
-		ws.getNextTransportPropertyKey();
-		ws.getNextTransportPropertyKey();
-		ws.deleteCurrentTransportProperty();
+		ws.getFirstTransportPropertyKey(false);
+		ws.getNextTransportPropertyKey(false);
+		ws.getNextTransportPropertyKey(false);
+		ws.deleteCurrentTransportProperty(false);
 		cout << "After deleteCurrentProperty method " << endl;
 		printProperties(&ws);
 		
@@ -93,7 +94,7 @@
 	}
 	catch(exception& e)
 	{
-		cout << "Unknown exception has occured" << endl;
+		cout << "Unknown exception has occured: "<< e.what() << endl;
 	}
 	catch(...)
 	{
@@ -104,18 +105,46 @@
   cout << "---------------------- TEST COMPLETE -----------------------------"<<
endl;	
 	return rc;
 }
+
 void printProperties(Calculator *obj)
 {
+	cout << " ** Request Properties **" << endl;
+	printProperties(obj, false);
+
+	cout << " ** Response Properties **" << endl;
+	printProperties(obj, true);
+	cout << " ****************************************************** " << endl;
+}
+
+void printProperties(Calculator *obj, bool response)
+{
 	const char* transprop1;
-	transprop1 = obj->getFirstTransportPropertyKey();
+	transprop1 = obj->getFirstTransportPropertyKey(response);
 	do
 	{
-		transprop1 = obj->getCurrentTransportPropertyKey();
-		cout << "current transport property key = " << transprop1 ;
-		transprop1 = obj->getCurrentTransportPropertyValue();
-		cout << " value = " << transprop1 << endl;
+		transprop1 = obj->getCurrentTransportPropertyKey(response);
+		cout << "     current transport property key = ";
+		if (transprop1)
+		{
+			cout  << transprop1 ;
+		}
+		else
+		{
+			cout << "<NULL>";
+		}
+
+		transprop1 = obj->getCurrentTransportPropertyValue(response);
+		cout << " value = ";
+		if (transprop1)
+		{
+			cout << transprop1;
+		}
+		else
+		{
+			cout << "<NULL>";
+		}
+		cout << endl;
 	}
-	while ( (transprop1 = obj->getNextTransportPropertyKey()) != NULL);
-	cout << "****************************************************** " << endl;
+	while ( (transprop1 = obj->getNextTransportPropertyKey(response)) != NULL);
 	return ;	
 }

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/output/TestTransportProperties.expected
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/output/TestTransportProperties.expected?rev=368346&r1=368345&r2=368346&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/output/TestTransportProperties.expected
(original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/output/TestTransportProperties.expected
Thu Jan 12 03:52:43 2006
@@ -1,17 +1,26 @@
 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
-****************************************************** 
+ ** Request Properties **
+     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
+ ** Response Properties **
+     current transport property key = <NULL> value = <NULL>
+ ****************************************************** 
 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
-****************************************************** 
+ ** Request Properties **
+     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
+ ** Response Properties **
+     current transport property key = <NULL> value = <NULL>
+ ****************************************************** 
 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
-****************************************************** 
+ ** Request Properties **
+     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
+ ** Response Properties **
+     current transport property key = <NULL> value = <NULL>
+ ****************************************************** 
 5
----------------------- TEST COMPLETE -----------------------------
\ No newline at end of file
+---------------------- TEST COMPLETE -----------------------------



Mime
View raw message