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 pr...@apache.org on 2006/02/10 16:56:42 UTC
svn commit: r376746 - in /webservices/axis/trunk/c/src:
engine/HandlerPool.cpp server/simple_axis_server/SimpleAxisServer.cpp
server/simple_axis_server/SimpleAxisTransport.cpp
transport/axis3/HTTPTransport.cpp wsdd/WSDDDeployment.cpp
Author: prestonf
Date: Fri Feb 10 07:56:39 2006
New Revision: 376746
URL: http://svn.apache.org/viewcvs?rev=376746&view=rev
Log:
Small updates for server side code.
Modified:
webservices/axis/trunk/c/src/engine/HandlerPool.cpp
webservices/axis/trunk/c/src/server/simple_axis_server/SimpleAxisServer.cpp
webservices/axis/trunk/c/src/server/simple_axis_server/SimpleAxisTransport.cpp
webservices/axis/trunk/c/src/transport/axis3/HTTPTransport.cpp
webservices/axis/trunk/c/src/wsdd/WSDDDeployment.cpp
Modified: webservices/axis/trunk/c/src/engine/HandlerPool.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/engine/HandlerPool.cpp?rev=376746&r1=376745&r2=376746&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/engine/HandlerPool.cpp (original)
+++ webservices/axis/trunk/c/src/engine/HandlerPool.cpp Fri Feb 10 07:56:39 2006
@@ -317,14 +317,13 @@
//unlock ();
}
-int HandlerPool::getWebService (BasicHandler** ppHandler, string &sSessionId,
- const WSDDHandler* pService)
+int HandlerPool::getWebService( BasicHandler ** ppHandler, string & sSessionId, const WSDDHandler * pService)
{
- int Status;
- if ((Status = getHandler (ppHandler, sSessionId, pService->getScope (),
- pService->getLibId ())) == AXIS_SUCCESS)
+ int Status = getHandler( ppHandler, sSessionId, pService->getScope(), pService->getLibId());
+
+ if( Status == AXIS_SUCCESS)
{
- if (0 != (*ppHandler)->_functions)
+ if( NULL != (*ppHandler)->_functions)
// C web service
{
/*if (AXIS_SUCCESS !=
@@ -337,8 +336,10 @@
*ppHandler = NULL;
}*/
}
- else if (0 == (*ppHandler)->_object)
- return AXIS_FAIL;
+ else if( NULL == (*ppHandler)->_object)
+ {
+ Status = AXIS_FAIL;
+ }
else
// C++ web service
{
Modified: webservices/axis/trunk/c/src/server/simple_axis_server/SimpleAxisServer.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/server/simple_axis_server/SimpleAxisServer.cpp?rev=376746&r1=376745&r2=376746&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/server/simple_axis_server/SimpleAxisServer.cpp (original)
+++ webservices/axis/trunk/c/src/server/simple_axis_server/SimpleAxisServer.cpp Fri Feb 10 07:56:39 2006
@@ -32,9 +32,9 @@
#include <sys/time.h>
#endif
+#include "SimpleAxisTransport.h"
#include <axis/AxisCPPConfigDefaults.hpp>
-#include "SimpleAxisTransport.h"
extern "C" int initialize_module (int bServer);
extern "C" int uninitialize_module ();
@@ -58,11 +58,11 @@
int
createTCPServerSocket (unsigned short port)
{
- int sock; /* socket to create */
- struct sockaddr_in echoServAddr; /* Local address */
+ int sock; /* socket to create */
+ struct sockaddr_in echoServAddr; /* Local address */
/* Create socket for incoming connections */
- if ((sock = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0)
+ if ((sock = (int) socket (PF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0)
printf ("%s\n", "socket() failed");
/* Construct local address structure */
@@ -102,7 +102,7 @@
clntLen = sizeof (echoClntAddr);
/* Wait for a client to connect */
- if ((clntSock = accept (servSock, (struct sockaddr *) &echoClntAddr,
+ if ((clntSock = (int) accept (servSock, (struct sockaddr *) &echoClntAddr,
&clntLen)) < 0)
{
printf ("%s\n", "accept() failed");
@@ -130,112 +130,116 @@
}
-int
-main (int argc, char *argv[])
+int main (int argc, char *argv[])
{
-
- int *servSock; /* Socket descriptors for server */
-
#ifdef WIN32
WSADATA wsaData; /* Structure for WinSock setup communication */
#else //Linux
#endif
- fd_set sockSet; /* Set of socket descriptors for select() */
- int maxDescriptor; /* Maximum socket descriptor value */
- struct timeval selTimeout; /* Timeout for select() */
- long timeout = 1000; /* Timeout value given on command-line */
- int running = 1;
- int iServerPort;
-
- int iPort;
- int noPorts = 1; /* Number of ports is argument count minus 2 */
- servSock = new int[noPorts];
- /* Initialize maxDescriptor for use by select() */
- maxDescriptor = -1;
-
+ fd_set sockSet; // Set of socket descriptors for select()
+ int maxDescriptor = -1; // Maximum socket descriptor value
+ struct timeval selTimeout; // Timeout for select()
+ long timeout = 1000; // Timeout value given on command-line
+ int running = 1;
+ int iServerPort;
+ int iPort;
+ int noPorts = 1; // Number of ports is argument count minus 2
+ int * servSock = new int[noPorts]; // Socket descriptors for server
- if (argc < 2)
+ if( argc < 2)
{
- printf ("Problem occurred.\nUsage: %s <Server Port>", argv[0]);
- exit (1);
+ printf( "Problem occurred.\nUsage: %s <Server Port>", argv[0]);
+
+ exit( 1);
}
#ifdef WIN32
- if (WSAStartup (MAKEWORD (2, 0), &wsaData) != 0) /* Load Winsock 2.0 DLL */
+ if( WSAStartup( MAKEWORD( 2, 0), &wsaData) != 0) /* Load Winsock 2.0 DLL */
{
- fprintf (stderr, "WSAStartup() failed");
- exit (1);
+ fprintf( stderr, "WSAStartup() failed");
+
+ exit( 1);
}
#else //Linux
#endif
/////////////
- iServerPort = atoi (argv[1]);
- if (iServerPort == 0)
- {
- printf ("Problem occurred. Error in specified server port");
- exit (1);
- }
- else
- {
- servSock[0] = createTCPServerSocket (iServerPort);
- /* Determine if new descriptor is the largest */
- if (servSock[0] > maxDescriptor)
- {
- maxDescriptor = servSock[0];
- }
- }
- ///////////////
+ iServerPort = atoi( argv[1]);
+
+ if( iServerPort == 0)
+ {
+ printf( "Problem occurred. Error in specified server port");
+ exit( 1);
+ }
+ else
+ {
+ servSock[0] = createTCPServerSocket( iServerPort);
+
+ // Determine if new descriptor is the largest
+ if( servSock[0] > maxDescriptor)
+ {
+ maxDescriptor = servSock[0];
+ }
+ }
+
+ // Ensure that configuration has the correct hostname
+
+ AxisCPPConfigDefaults config;
+
+ config.setListenPort( argv[1]);
+
+ int namelen = 128;
+ char * hostname = new char[namelen];
+
+ if( gethostname( hostname, namelen) == 0)
+ {
+ if( hostname!= NULL)
+ {
+ config.setNodeName( hostname);
+ }
+ }
+
+ config.apply();
//initializing Axis
- AxisCPPConfigDefaults config;
- config.setListenPort(argv[1]);
- int namelen = 128;
- char* hostname = new char[namelen];
- if (gethostname(hostname, namelen) == 0)
- {
- if (hostname!= NULL)
- {
- config.setNodeName( hostname );
- }
- }
- config.apply();
- initialize_module (1);
+
+ initialize_module( 1);
while (running)
{
- FD_ZERO (&sockSet);
- FD_SET (servSock[0], &sockSet);
+ FD_ZERO (&sockSet);
+ FD_SET (servSock[0], &sockSet);
- /* Timeout specification */
- /* This must be reset every time select() is called */
- selTimeout.tv_sec = timeout; /* timeout (secs.) */
- selTimeout.tv_usec = 0; /* 0 microseconds */
-
- if (select (maxDescriptor + 1, &sockSet, NULL, NULL, &selTimeout) == 0)
- {
- /*
- * DEBUG line
- * printf("No echo requests for %ld secs...Server still alive\n",
- * timeout);
- */
- }
- else
- {
- if (FD_ISSET (servSock[0], &sockSet))
- {
- //initializeStuff ();
- /*
- * DEBUG line
- * printf("Request on port %d (cmd-line position): \n", 0);
- */
- handleTCPClient (acceptTCPConnection (servSock[0]));
- }
- }
+ /* Timeout specification */
+ /* This must be reset every time select() is called */
+ selTimeout.tv_sec = timeout; /* timeout (secs.) */
+ selTimeout.tv_usec = 0; /* 0 microseconds */
+
+ if (select (maxDescriptor + 1, &sockSet, NULL, NULL, &selTimeout) ==
+ 0)
+ {
+ /*
+ * DEBUG line
+ * printf("No echo requests for %ld secs...Server still alive\n",
+ * timeout);
+ */
+ }
+ else
+ {
+ if (FD_ISSET (servSock[0], &sockSet))
+ {
+ //initializeStuff ();
+ /*
+ * DEBUG line
+ * printf("Request on port %d (cmd-line position): \n", 0);
+ */
+ handleTCPClient (acceptTCPConnection (servSock[0]));
+ }
+ }
- // AXISTRACE3("end of main while");
+ // AXISTRACE3("end of main while");
}
//uninitializing Axis
@@ -245,9 +249,9 @@
for (iPort = 0; iPort < noPorts; iPort++)
{
#ifdef WIN32
- closesocket (servSock[iPort]);
+ closesocket (servSock[iPort]);
#else //Linux
- close (servSock[iPort]);
+ close (servSock[iPort]);
#endif
}
Modified: webservices/axis/trunk/c/src/server/simple_axis_server/SimpleAxisTransport.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/server/simple_axis_server/SimpleAxisTransport.cpp?rev=376746&r1=376745&r2=376746&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/server/simple_axis_server/SimpleAxisTransport.cpp (original)
+++ webservices/axis/trunk/c/src/server/simple_axis_server/SimpleAxisTransport.cpp Fri Feb 10 07:56:39 2006
@@ -27,7 +27,7 @@
*/
#define SOAPACTION_METHODNAME_SEPARATOR "#"
-SimpleAxisTransport::SimpleAxisTransport (int iSocket)
+SimpleAxisTransport::SimpleAxisTransport( int iSocket)
{
m_eProtocolType = APTHTTP1_1;
m_iSocket = iSocket;
@@ -38,21 +38,28 @@
m_strSOAPAction = "";
}
-SimpleAxisTransport::~SimpleAxisTransport ()
+SimpleAxisTransport::~SimpleAxisTransport()
{
+ int iShutDownRes = shutdown( m_iSocket, SD_BOTH);
+ int iCloseSockRes = 0;
+
+#ifdef WIN32
+ iCloseSockRes = closesocket( m_iSocket);
+#else //Linux
+ iCloseSockRes = close( m_iSocket);
+#endif
}
-AXIS_TRANSPORT_STATUS
-SimpleAxisTransport::sendBytes (const char *pcSendBuffer,
- const void *pBufferId)
+AXIS_TRANSPORT_STATUS SimpleAxisTransport::sendBytes( const char *pcSendBuffer, const void *pBufferId)
{
m_strPayloadToSend += pcSendBuffer;
- return TRANSPORT_FINISHED;
+ return TRANSPORT_FINISHED;
+/*
if (!pBufferId) // temporary buffers should always sent immediately
{
- if ((send (m_iSocket, pcSendBuffer, strlen (pcSendBuffer), MSG_DONTROUTE)) == -1)
+ if ((send (m_iSocket, pcSendBuffer, (int) strlen( pcSendBuffer), MSG_DONTROUTE)) == -1)
return TRANSPORT_FAILED;
return TRANSPORT_FINISHED;
}
@@ -67,253 +74,296 @@
}
}
return TRANSPORT_IN_PROGRESS;
+*/
}
-int
-SimpleAxisTransport::
-setTransportProperty (AXIS_TRANSPORT_INFORMATION_TYPE type, const char *value)
+int SimpleAxisTransport::setTransportProperty( AXIS_TRANSPORT_INFORMATION_TYPE type, const char * value)
{
- const char *key = NULL;
- switch (type)
- {
- case SOAPACTION_HEADER: /* needed only in the client side ? */
- break;
- case SERVICE_URI: /* need to set ? */
- break;
- case OPERATION_NAME: /* need to set ? */
- break;
- case SOAP_MESSAGE_LENGTH:
- /* This is apache module and transport is http so the key */
- key = "Content-Length";
- break;
- default:;
- }
- if (key)
- {
- setTransportProperty (key, value);
- }
- return 0;
+ const char * key = NULL;
+ int iSuccess = AXIS_FAIL;
+
+ switch( type)
+ {
+ case SOAPACTION_HEADER: /* needed only in the client side ? */
+ break;
+
+ case SERVICE_URI: /* need to set ? */
+ break;
+
+ case OPERATION_NAME: /* need to set ? */
+ break;
+
+ case SOAP_MESSAGE_LENGTH: /* This is apache module and transport is http so the key */
+ key = "Content-Length";
+ break;
+
+ default:
+ ;
+ }
+
+ if( key)
+ {
+ iSuccess = setTransportProperty( key, value);
+ }
+
+ return AXIS_SUCCESS;
}
-AXIS_TRANSPORT_STATUS
-SimpleAxisTransport::flushOutput ()
+AXIS_TRANSPORT_STATUS SimpleAxisTransport::flushOutput()
{
- int contentLength = 0;
- char strtonum[8];
- contentLength = m_strPayloadToSend.length ();
- if (contentLength != 0) // do only if the http body is not empty.
+ int contentLength = (int) m_strPayloadToSend.length();
+ char strtonum[8];
+
+ if( contentLength != 0) // do only if the http body is not empty.
{
- sprintf (strtonum, "%d", contentLength);
- setTransportProperty (SOAP_MESSAGE_LENGTH, strtonum);
- m_strHTTPHeaders = std::string ("HTTP/1.1 200 OK\r\n") +
- std::string ("Server: Apache Axis C++/1.6\r\n") +
- std::string ("Connection: close\r\n") +
- m_strHTTPHeaders + std::string ("Content-Type: text/xml\r\n\r\n");
-
- if ((send
- (m_iSocket, m_strHTTPHeaders.c_str (), m_strHTTPHeaders.size (),
- MSG_DONTROUTE)) == -1)
- return TRANSPORT_FAILED;
- if ((send
- (m_iSocket, m_strPayloadToSend.c_str (),
- m_strPayloadToSend.length (), MSG_DONTROUTE)) == -1)
- return TRANSPORT_FAILED;
+ sprintf( strtonum, "%d", contentLength); // This assumes that the content length will be less that 8 digits (9,999,999 bytes).
+
+ setTransportProperty( SOAP_MESSAGE_LENGTH, strtonum);
+
+ m_strHTTPHeaders = std::string( "HTTP/1.1 200 OK\r\n") +
+ std::string( "Server: Apache Axis C++/1.6.a\r\n") +
+ std::string( "Connection: close\r\n") +
+ m_strHTTPHeaders +
+ std::string( "Content-Type: text/xml\r\n\r\n");
+
+ if( (send( m_iSocket,
+ m_strHTTPHeaders.c_str(),
+ (int) m_strHTTPHeaders.size(),
+ MSG_DONTROUTE)) == -1)
+ {
+ return TRANSPORT_FAILED;
+ }
+
+ if( (send( m_iSocket,
+ m_strPayloadToSend.c_str(),
+ (int) m_strPayloadToSend.length(),
+ MSG_DONTROUTE)) == -1)
+ {
+ return TRANSPORT_FAILED;
+ }
}
- return TRANSPORT_FINISHED;
+
+
+ return TRANSPORT_FINISHED;
}
-AXIS_TRANSPORT_STATUS
-SimpleAxisTransport::getBytes (char *pBuffer, int *piSize)
+AXIS_TRANSPORT_STATUS SimpleAxisTransport::getBytes( char * pBuffer, int * piSize)
{
- if (m_strReceived.length () <= 0)
+ if( m_strReceived.length () <= 0)
{
- pBuffer[0] = '\0';
- (*piSize) = 0;
- return TRANSPORT_FINISHED;
+ pBuffer[0] = '\0';
+ *piSize = 0;
+
+ return TRANSPORT_FINISHED;
}
- if ((int) m_strReceived.length () < (*piSize))
+
+ if( (int) m_strReceived.length() < *piSize)
{
- pBuffer[0] = '\0';
- strcat (pBuffer, m_strReceived.c_str ());
- (*piSize) = m_strReceived.length ();
- m_strReceived = "";
- return TRANSPORT_FINISHED;
+ pBuffer[0] = '\0';
+
+ strcat( pBuffer, m_strReceived.c_str());
+
+ *piSize = (int) m_strReceived.length();
+
+ m_strReceived = "";
+
+ return TRANSPORT_FINISHED;
}
else
{
- pBuffer[0] = '\0';
- std::string strToSend = m_strReceived.substr ((*piSize) - 1);
- strcat (pBuffer, strToSend.c_str ());
- (*piSize) = strToSend.length ();
-
- m_strReceived =
- m_strReceived.substr ((*piSize),
- m_strReceived.length () - (*piSize));
- return TRANSPORT_IN_PROGRESS;
+ pBuffer[0] = '\0';
+
+ std::string strToSend = m_strReceived.substr( *piSize - 1);
+
+ strcat( pBuffer, strToSend.c_str());
+
+ *piSize = (int) strToSend.length();
+
+ m_strReceived = m_strReceived.substr( (*piSize),
+ m_strReceived.length() - *piSize);
+
+ return TRANSPORT_IN_PROGRESS;
}
}
-void
-SimpleAxisTransport::readFromClient ()
+void SimpleAxisTransport::readFromClient()
{
- int len_read = 0;
- const unsigned int BUF_SIZE = 48000;
- char arr[BUF_SIZE];
+ int len_read = 0;
+ const unsigned int BUF_SIZE = 48000;
+ char arr[BUF_SIZE];
+ unsigned int iStartPos = (int) std::string::npos;
std::string strReceived = "";
- unsigned int iStartPos = std::string::npos;
+
do
{
- len_read = recv (m_iSocket, arr, BUF_SIZE - 1, 0);
- if (len_read < 0)
- return;
- arr[len_read] = '\0';
- strReceived = arr;
- iStartPos = strReceived.find ("\r\n\r\n");
- }
- while (iStartPos == std::string::npos);
+ len_read = recv( m_iSocket, arr, BUF_SIZE - 1, 0);
+
+ if( len_read < 0)
+ {
+ return;
+ }
+
+ arr[len_read] = '\0';
+
+ strReceived += arr;
+
+ iStartPos = (int) strReceived.find( "\r\n\r\n");
+ } while( iStartPos == std::string::npos);
iStartPos += 4;
- unsigned int uiServiceStartPos =
- strReceived.find ("POST ") + strlen ("POST ");
- unsigned int uiServiceEndPos = strReceived.find (" ", uiServiceStartPos);
- m_strServiceURI =
- strReceived.substr (uiServiceStartPos,
- uiServiceEndPos - uiServiceStartPos);
-
- unsigned int uiActionStartPos =
- strReceived.find ("SOAPAction: \"") + strlen ("SOAPAction: \"");
- unsigned int uiActionEndPos = strReceived.find ("\"", uiActionStartPos);
- m_strSOAPAction =
- strReceived.substr (uiActionStartPos,
- uiActionEndPos - uiActionStartPos);
+ unsigned int uiServiceStartPos = (unsigned int) (strReceived.find( "POST ") + strlen( "POST "));
+ unsigned int uiServiceEndPos = (unsigned int) strReceived.find( " ", uiServiceStartPos);
- unsigned int uiEnvelopePos = strReceived.find ("Envelope");
- while (uiEnvelopePos == std::string::npos)
- {
- len_read = recv (m_iSocket, arr, BUF_SIZE - 1, 0);
- arr[len_read] = '\0';
- strReceived += arr;
- uiEnvelopePos = strReceived.find ("Envelope");
- }
+ m_strServiceURI = strReceived.substr( uiServiceStartPos, uiServiceEndPos - uiServiceStartPos);
+
+ unsigned int uiActionStartPos =(unsigned int) (strReceived.find( "SOAPAction: \"") + strlen( "SOAPAction: \""));
+ unsigned int uiActionEndPos = (unsigned int) strReceived.find( "\"", uiActionStartPos);
+
+ m_strSOAPAction = strReceived.substr (uiActionStartPos, uiActionEndPos - uiActionStartPos);
- uiEnvelopePos += strlen ("Envelope");
- unsigned int uiEnvelopeEndPos =
- strReceived.find ("Envelope", uiEnvelopePos);
- while (uiEnvelopeEndPos == std::string::npos)
+ unsigned int uiEnvelopePos = (unsigned int) strReceived.find( "Envelope");
+
+ // Find the beginning of the SOAP message by finding the opening 'Envelope' tag.
+ while( uiEnvelopePos == std::string::npos)
+ {
+ len_read = recv (m_iSocket, arr, BUF_SIZE - 1, 0);
+
+ arr[len_read] = '\0';
+
+ strReceived += arr;
+
+ uiEnvelopePos = (unsigned int) strReceived.find( "Envelope");
+ }
+
+ uiEnvelopePos += (unsigned int) strlen( "Envelope");
+
+ unsigned int uiEnvelopeEndPos = (unsigned int) strReceived.find( "Envelope", uiEnvelopePos);
+
+ // Find the end of the SOAP message by finding the matching closing 'Envelope' tag.
+ while( uiEnvelopeEndPos == std::string::npos)
{
- len_read = recv (m_iSocket, arr, BUF_SIZE - 1, 0);
- arr[len_read] = '\0';
- strReceived += arr;
- uiEnvelopeEndPos = strReceived.find ("Envelope", uiEnvelopePos);
+ len_read = recv( m_iSocket, arr, BUF_SIZE - 1, 0);
+
+ arr[len_read] = '\0';
+
+ strReceived += arr;
+
+ uiEnvelopeEndPos = (unsigned int) strReceived.find( "Envelope", uiEnvelopePos);
}
- m_strReceived =
- strReceived.substr (iStartPos, strReceived.length () - iStartPos);
+
+ m_strReceived = strReceived.substr( iStartPos, strReceived.length () - iStartPos);
+
}
-const char *
-SimpleAxisTransport::
-getTransportProperty (AXIS_TRANSPORT_INFORMATION_TYPE eType)
+const char * SimpleAxisTransport::getTransportProperty( AXIS_TRANSPORT_INFORMATION_TYPE eType)
{
- switch (eType)
- {
- case SOAPACTION_HEADER:
- return getTransportProperty ("SOAPAction");
- case SERVICE_URI:
- readFromClient ();
- if (m_strServiceURI.find (AXIS_URI_EXTENSION) != std::string::npos)
+ switch( eType)
{
- unsigned int uiStartPos =
- m_strServiceURI.find (AXIS_URI_EXTENSION) +
- strlen (AXIS_URI_EXTENSION) + 1;
- m_strTransportPropertyURI =
- m_strServiceURI.substr (uiStartPos,
- m_strServiceURI.length () -
- uiStartPos);
- return m_strTransportPropertyURI.c_str();
+ case SOAPACTION_HEADER:
+ {
+ return getTransportProperty( "SOAPAction");
+ }
+
+ case SERVICE_URI:
+ {
+ readFromClient();
+
+ if( m_strServiceURI.find( AXIS_URI_EXTENSION) != std::string::npos)
+ {
+ unsigned int uiStartPos = (unsigned int) (m_strServiceURI.find( AXIS_URI_EXTENSION) +
+ strlen( AXIS_URI_EXTENSION) +
+ 1);
+
+ m_strTransportPropertyURI = m_strServiceURI.substr( uiStartPos,
+ m_strServiceURI.length() - uiStartPos);
+
+ return m_strTransportPropertyURI.c_str();
+ }
+
+ return m_strServiceURI.c_str();
+ }
+
+ case OPERATION_NAME:
+ {
+ unsigned int uiOpStart = (unsigned int) m_strSOAPAction.find( SOAPACTION_METHODNAME_SEPARATOR);
+
+ if( uiOpStart != std::string::npos)
+ {
+ uiOpStart += (unsigned int) strlen( SOAPACTION_METHODNAME_SEPARATOR);
+
+ m_strTransportPropertyOperation = m_strSOAPAction.substr( uiOpStart,
+ m_strSOAPAction.length() - uiOpStart);
+
+ return m_strTransportPropertyOperation.c_str();
+ }
+
+ return m_strSOAPAction.c_str();
+ }
+
+ case SOAP_MESSAGE_LENGTH:
+ {
+ return getTransportProperty( "Content-Length");
+ }
+
+ default:
+ {
+ ;
+ }
}
- else
- {
- return m_strServiceURI.c_str ();
- }
- case OPERATION_NAME:
- {
- unsigned int uiOpStart =
- m_strSOAPAction.find (SOAPACTION_METHODNAME_SEPARATOR);
- if (uiOpStart != std::string::npos)
- {
- uiOpStart += strlen (SOAPACTION_METHODNAME_SEPARATOR);
- m_strTransportPropertyOperation = m_strSOAPAction.substr (uiOpStart,
- m_strSOAPAction.length () -
- uiOpStart);
- return m_strTransportPropertyOperation.c_str();
- }
- else
- {
- return m_strSOAPAction.c_str ();
- }
- }
- case SOAP_MESSAGE_LENGTH:
- return getTransportProperty ("Content-Length");
- default:;
- }
- return NULL;
+
+ return NULL;
}
-int
-SimpleAxisTransport::setTransportProperty (const char *pcKey,
- const char *pcValue)
+int SimpleAxisTransport::setTransportProperty( const char * pcKey, const char * pcValue)
{
- m_strHTTPHeaders +=
- std::string (pcKey) + std::string (": ") + std::string (pcValue) +
- std::string ("\r\n");
+ m_strHTTPHeaders += std::string( pcKey) +
+ std::string( ": ") +
+ std::string( pcValue) +
+ std::string( "\r\n");
+
return 0;
}
-const char *
-SimpleAxisTransport::getTransportProperty (const char *pcKey, bool response)
+const char * SimpleAxisTransport::getTransportProperty( const char * pcKey, bool response)
{
return 0;
}
-void
-SimpleAxisTransport::setSessionId (const char *pcSessionId)
+void SimpleAxisTransport::setSessionId( const char * pcSessionId)
{
}
-const char *
-SimpleAxisTransport::getSessionId ()
+const char * SimpleAxisTransport::getSessionId()
{
return "this is temporary session id"; //TODO
}
-const char *
-SimpleAxisTransport::getServiceName ()
+const char * SimpleAxisTransport::getServiceName()
{
return 0; //TODO
}
-AXIS_PROTOCOL_TYPE
-SimpleAxisTransport::getProtocol ()
+AXIS_PROTOCOL_TYPE SimpleAxisTransport::getProtocol()
{
return APTHTTP1_1;
}
int SimpleAxisTransport::setProtocol(AXIS_PROTOCOL_TYPE eProtocol)
{
- if( eProtocol == APTHTTP1_1 || eProtocol == APTHTTP1_0 )
+ if( eProtocol == APTHTTP1_1 || eProtocol == APTHTTP1_0)
{
m_eProtocolType = eProtocol;
+
return AXIS_SUCCESS;
}
- else
- return AXIS_FAIL;
+
+ return AXIS_FAIL;
}
-int
-SimpleAxisTransport::getSubProtocol ()
+int SimpleAxisTransport::getSubProtocol()
{
return AXIS_HTTP_POST;
}
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=376746&r1=376745&r2=376746&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/transport/axis3/HTTPTransport.cpp (original)
+++ webservices/axis/trunk/c/src/transport/axis3/HTTPTransport.cpp Fri Feb 10 07:56:39 2006
@@ -647,7 +647,14 @@
if( m_iContentLength > 0 ||
(m_bReopenConnection && m_pActiveChannel->getSocket()))
{
- getNextDataPacket( "No data available for message.");
+ if( m_iContentLength > 0)
+ {
+ getNextDataPacket( "No data available for message.");
+ }
+ else
+ {
+ getNextDataPacket( "Expecting server connection to close.");
+ }
// Check for Mime header
if( m_bMimeTrue)
Modified: webservices/axis/trunk/c/src/wsdd/WSDDDeployment.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdd/WSDDDeployment.cpp?rev=376746&r1=376745&r2=376746&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdd/WSDDDeployment.cpp (original)
+++ webservices/axis/trunk/c/src/wsdd/WSDDDeployment.cpp Fri Feb 10 07:56:39 2006
@@ -103,18 +103,24 @@
return AXIS_SUCCESS;
}
-int WSDDDeployment::loadWSDD(const AxisChar* sWSDD)
+int WSDDDeployment::loadWSDD( const AxisChar * sWSDD)
{
- m_sWSDDPath = std::string(sWSDD);
- WSDDDocument* doc = new WSDDDocument(m_pLibNameIdMap);
- if (AXIS_SUCCESS != doc->getDeployment(sWSDD, this))
+ m_sWSDDPath = std::string( sWSDD);
+
+ WSDDDocument * doc = new WSDDDocument( m_pLibNameIdMap);
+
+ if( AXIS_SUCCESS != doc->getDeployment( sWSDD, this))
{
//printf("wsdd loading failed\n");
+
delete doc;
+
//return AXIS_FAIL;
- throw AxisWsddException(SERVER_WSDD_FILE_NOT_FOUND);
+ throw AxisWsddException( SERVER_WSDD_FILE_NOT_FOUND);
}
+
delete doc;
+
return AXIS_SUCCESS;
}