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 sa...@apache.org on 2005/06/01 07:12:32 UTC
cvs commit: ws-axis/c/src/engine/client Call.cpp Stub.cpp
samisa 2005/05/31 22:12:32
Modified: c/src/engine/client Call.cpp Stub.cpp
Log:
Moved openConnection activities to Call class constructor because it is where the initialization of transport should be done
Revision Changes Path
1.111 +60 -8 ws-axis/c/src/engine/client/Call.cpp
Index: Call.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/engine/client/Call.cpp,v
retrieving revision 1.110
retrieving revision 1.111
diff -u -r1.110 -r1.111
--- Call.cpp 27 May 2005 10:25:59 -0000 1.110
+++ Call.cpp 1 Jun 2005 05:12:32 -0000 1.111
@@ -65,9 +65,59 @@
m_pTransport = NULL;
m_nTransportType = APTHTTP1_1;
- m_pTransport = SOAPTransportFactory::getTransportObject(m_nTransportType);
+
m_nStatus = AXIS_SUCCESS;
m_pchSessionID = NULL;
+
+ try
+ {
+ if( !m_pTransport)
+ {
+ m_pTransport = SOAPTransportFactory::getTransportObject(m_nTransportType);
+
+ if( !m_pTransport)
+ {
+ m_nStatus = AXIS_FAIL;
+ }
+ }
+
+ char * pcSSLChannelInfo = g_pConfig->getAxisConfProperty( AXCONF_SECUREINFO);
+ if( pcSSLChannelInfo && strlen( pcSSLChannelInfo) > 0)
+ {
+ char * pszArgPtr = NULL;
+ int iArgIndex = 0;
+ string sArguments[8];
+
+ pszArgPtr = strtok( pcSSLChannelInfo, ",");
+
+ while( pszArgPtr != NULL && iArgIndex < 8)
+ {
+ sArguments[iArgIndex] = pszArgPtr;
+
+ iArgIndex++;
+
+ pszArgPtr = strtok( NULL, ",");
+
+ while( pszArgPtr != NULL && *pszArgPtr == ' ' && *pszArgPtr != '\0')
+ {
+ pszArgPtr++;
+ }
+ }
+
+ m_nStatus = m_pTransport->setTransportProperty( SECURE_PROPERTIES, (const char *) &sArguments);
+ }
+ }
+ catch( AxisException& e)
+ {
+ char * pszError = new char[strlen( e.what()) + 1];
+ strcpy( pszError, e.what());
+
+ throw AxisGenException( e.getExceptionCode(), const_cast<char*>(pszError));
+ }
+ catch(...)
+ {
+ throw;
+ }
}
Call::~Call ()
@@ -91,14 +141,16 @@
int Call::setEndpointURI (const char* pchEndpointURI)
{
- if (m_pcEndPointUri)
+ /*if (m_pcEndPointUri)
delete [] m_pcEndPointUri;
m_pcEndPointUri = NULL;
if (pchEndpointURI)
{
m_pcEndPointUri = new char[strlen(pchEndpointURI)+1];
strcpy(m_pcEndPointUri, pchEndpointURI);
- }
+ }*/
+ m_pTransport->setEndpointUri(pchEndpointURI);
+
return AXIS_SUCCESS;
}
@@ -169,10 +221,10 @@
{
m_nStatus = AXIS_SUCCESS;
// remove_headers(&m_Soap);
- if (AXIS_SUCCESS != openConnection ()) {
+ /*if (AXIS_SUCCESS != openConnection ()) {
m_nStatus = AXIS_FAIL;
return AXIS_FAIL;
- }
+ }*/
if (m_pAxisEngine)
delete m_pAxisEngine;
m_pAxisEngine = new ClientAxisEngine ();
@@ -382,7 +434,7 @@
*/
int Call::openConnection()
{
- try
+ /*try
{
if( !m_pTransport)
{
@@ -438,9 +490,9 @@
catch(...)
{
throw;
- }
+ }*/
- return m_nStatus;
+ return m_nStatus = AXIS_SUCCESS;
}
/*
1.44 +7 -2 ws-axis/c/src/engine/client/Stub.cpp
Index: Stub.cpp
===================================================================
RCS file: /home/cvs/ws-axis/c/src/engine/client/Stub.cpp,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -r1.43 -r1.44
--- Stub.cpp 11 Apr 2005 12:22:45 -0000 1.43
+++ Stub.cpp 1 Jun 2005 05:12:32 -0000 1.44
@@ -34,8 +34,8 @@
{
m_pCall = new Call ();
m_pCall->setProtocol (eProtocol);
- m_pCall->setEndpointURI (pcEndPointUri);
m_pTransport = m_pCall->getTransport ();
+ m_pTransport->setEndpointUri( pcEndPointUri);
// Initialise m_viCurrentSOAPMethodAttribute to something sensible
// in case getFirstSOAPMethodAttribute isn't called first.
@@ -69,7 +69,11 @@
void
Stub::setEndPoint (const char *pcEndPoint)
{
- m_pCall->setEndpointURI (pcEndPoint);
+ if (m_pTransport)
+ {
+ m_pTransport->setEndpointUri( pcEndPoint);
+ }
+ //m_pCall->setEndpointURI (pcEndPoint);
}
void
@@ -295,6 +299,7 @@
void
Stub::setProxy (const char *pcProxyHost, unsigned int uiProxyPort)
{
+ //TODO - Samisa - This need to change in line with the changes to call open connection
m_pCall->setProxy (pcProxyHost, uiProxyPort);
}